matplotlib using twinx and twiny together (like twinxy)

If I understand your question right, you want to plot two things on the same axes with no shared axis. There is probably a better way to do this, but you can stack twinx (doc) and twiny (doc) as such

ax # your first axes
ax_new = ax.twinx().twiny()

Which will give you tick marks on all sides of the plot. ax will plot against the bottom and left, ax_new will plot against the top and right.

Leave a Comment

tech