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.