Python Basics Tutorial Matplotlib Twin Axes Method

preview_player
Показать описание
Learn how to use the twinx method from matplotlib for python programming

twitter: @python_basics

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

This is great. Thx. Looking for a way to combine twinx with animated plots.

CrudChronicles
Автор

Is it possible to put a legend and another y-spine on the left side?

I'd like to create a plot with the date on the x-axis, and temperature, pressure, humidity, and wind speed on 4 y-axis (each with their own scale). To spread things out a bit, I'd like to put 2 legends/spines on the left and 2 on the right past the spine. Putting the legend and new spine on the right, past the plot box works:
ax3.legend(loc='upper right', bbox_to_anchor=(1.75, 1), ncol=2, borderaxespad=0)
ax3.spines['right'].set_position(('axes', 1.15))

But the left side is always inside the figure with the data! How can I move things such that the new legend/spines are in the whitespace to the left of the plot?

bennguyen