简体   繁体   中英

plt.show() does not display anything

I am using Jupyter notebook and I'm trying to plot graphs using subplots based on this video :

I just tried everything in the same format as shown in the video. When I do a simple plot,

For example,

plt.plot([1,2,3],[2,4,6])

It gives a normal result.

在此处输入图片说明

But, when I try to create two axis, like this,

ax1.plot(df.index, df['APT.AX'])
ax2.plot(df.index, df['A2M.AX'])

It just gives the following result:

Out: [<matplotlib.lines.Line2D at 0x1ab0e0db8b0>]

And when I enter plt.show() , it just does nothing.

I tried uninstalling and reinstalling matplotlib using conda. I have tried by adding %matplotlib inline before using it.

Anything I can do here?

That's not an error. Use show() in the next line or plt.show()

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM