First page Back Continue Last page Overview Image

Using Twin Axes, Part 2

fig, ax = plt.subplots()

fig.suptitle("City Statistics")

ax.set_ylabel("Population")

ax.set_xlabel("Citites")

ax2 = ax.twinx()

ax2.set_ylabel("Area")

city_frame["population"].plot(ax=ax,

style="b-",

use_index=True,

rot=90)

city_frame["area"].plot(ax=ax2,

style="g-",

use_index=True,

rot=90)