I have a question when I draw a graph using matplotlib in Python Pandas.

Asked 2 years ago, Updated 2 years ago, 43 views

When creating a subplot by subtracting Fig.add_subplot

The returned object is called AxesSubplot, but I don't understand the meaning of AxesSubplot even after searching.

I'm not sure how it affects the results or coding because it's returned to Axes Subplotㅠ<

pandas matplotlib python3

2022-09-21 14:19

1 Answers

Axes object returns, not AxesSubplot.

After you create a subplot, you can draw a graph as follows.

import matplotlib.pyplot as plt
fig = plt.figure()

ax1 = fig.add_subplot(221)
ax1.plot([1, 5])

ax2 = fig.add_subplot(223)
ax2.plot([5, 10])
plt.show()

If you draw it, it looks like this.


2022-09-21 14:19

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.