Back

While using sub plots i am getting error pls guide me

Created 4 years ago
23 Views
1 Comments
KrishnaKumarf0cb51
@KrishnaKumarf0cb51
KrishnaKumarf0cb51
@KrishnaKumarf0cb51Profile is locked. Login

plt.subplots

ax=plt.subplots(2,1)

ax[0].plot(x,y,marker="v",color="r",linestyle="-")

ax[1].plot(y,z,marker="o",color="g",linestyle="--")

ax[0].set_ylabel("xlabel")

ax[1].set_ylabel("ylabel")

plt.show()

I am getting error

plt.subplots
ax=plt.subplots(2,1)
ax[0].plot(x,y,marker="v",color="r",linestyle="-")
ax[1].plot(y,z,marker="o",color="g",linestyle="--")
ax[0].set_ylabel("xlabel")
ax[1].set_ylabel("ylabel")
plt.show()
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-54-49d441fdc0e5> in <module>
      2 plt.subplots
      3 ax=plt.subplots(2,1)
----> 4 ax[0].plot(x,y,marker="v",color="r",linestyle="-")
      5 ax[1].plot(y,z,marker="o",color="g",linestyle="--")
      6 ax[0].set_ylabel("xlabel")

AttributeError: 'Figure' object has no attribute 'plot'

Comments
Please login to comment.