Matplotlib Tutorial 11: Adding Second Y-Axis

preview_player
Показать описание
In this video, I am explaining how to plot two graphs in one figure with separate y-axes, but sharing the same x-axis.

You can find more matplotlib tutorials on my website:

Рекомендации по теме
Комментарии
Автор

Please countinu with this series in future...and some examples of root

sumankhan
Автор

I am following most of your series.
I have learnt a lot.keep uploading good stuff.
One thing i would love to say that you really are a good teacher.your students are very lucky to have you.

mariamkhan
Автор

Can multiple y-data be plotted on the same figure, each showing their own scale? I also tried the matplotlib "axes_grid example code"*, which does have multiple y-series, but the x and y scale is the same for all the data :(

I have a csv file containing a date, followed by temperature, pressure, uv-index, humidity, etc. I'd like to :

1) use the same x-axis (date) for all the different y-data (preferably superimposed on top of each other instead of each in its own area). The y-axis would need to show the different scales for the different y-values (0F-100F, 25hg-35hg, 1uvi-10uvi, etc).
2) On the legend, I'd like to click on the different lines to either show or hide that data (and its scale).

*
ax.plot(x, i * x, label=r'$y={}x$'.format(i))
secondary_y=True, ax2 = ax1.twinx(), ax1.sharex(ax2), get_shared_y_axes, ax2.autoscale . ax2 = plt.subplot(212, sharex = ax1)

bennguyen
Автор

Is it possible to plot a contour map of a city using python?

ezeprince