matplotlib using twinx and twiny together (like twinxy)

Can I have both twinx and twiny together (i.e. something like twinxy)? I want to put a CDF on a bar plot where the X axis of the bar plot is in log-scale. I cannot make the Ys together, because the bar plot y range is very large comparing [0,1] for CDF.

Any ideas?

Thanks,


Solution 1:

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.