-2

I am practicing matplotlib. I am using the following code:

import matplotlib.pyplot as plt

    y = [1,2,3,4,5]
    x = [10,12,5,8,3]

    plt.plot(x,y)
    plt.title('Line Chart')
    plt.xlabel('x-axis')
    plt.ylabel('y-axis')
    plt.show

There is not issue with it, but the graph is not shown.

I installed matplotlib already. I can't find the library as extension in VS

This is what I got in the console (including the space in-between):

"PS C:\Users\HP>

& C:/Users/HP/AppData/Local/Programs/Python/Python312/python.exe "c:/Users/HP/OneDrive/Python Training/Matplotlib Training 1.py" PS C:\Users\HP> "

Thank.

#I am expecting to visualize the data.

1
  • 3
    plt.show should be plt.show() Commented Feb 8, 2024 at 11:22

1 Answer 1

1

change plt.show to plt.show() to execute the show method.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.