简体   繁体   中英

why spines doesn't work with plot() but works with subplot() in matplotlib?

When I use plot() function to draw plot in matplotlib.

plot().spines doesn't show me the spines

but subplot().spines gives output

Why don't they return same output?

No they don't return the same output. In fact, pyplot.plot is a plotting function which returns a sequence of Line2D objects, while pyplot.subplot is a gridding function which returns a matplotlib.axes._subplots.AxesSubplot object.

在此处输入图片说明

While the AxesSubplot has spines (as one can imaginge from the image), the Line2D does not have any spines (it's a simple line, what would spines be for it?).

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