Zhaozhong Chen
Zhaozhong Chen

Reputation: 85

pyplot window doesn't plot things

x=[[ 0.          0.00221864  0.00488273 ..., -0.03966467 -0.03691193  -0.03415696]]
y=[[  0.00000000e+00   5.00000000e-03   1.00000000e-02 ...,   7.06000000e+00, 
       7.06500000e+00   0.00000000e+00]]
plt.plot(x,y)  
plt.show()

The data both have 1415 columns.
Then the figure looks like the following
enter image description here

Why does it show nothing?
Thanks for answering!

Upvotes: 0

Views: 32

Answers (1)

ImportanceOfBeingErnest
ImportanceOfBeingErnest

Reputation: 339745

You can't use nested lists to plot your data.
The following plots nothing

import matplotlib.pyplot as plt

x = [[1,2,3,4]]
y = [[2,3,1,4]]

plt.plot(x,y)
plt.show()

While this plots the values as expected.

import matplotlib.pyplot as plt

x = [1,2,3,4]
y = [2,3,1,4]

plt.plot(x,y)
plt.show()

Upvotes: 1

Related Questions