pylab.ylabel: put label on the other side

A

Antoine De Groote

Hey everybody,

I'm plotting graphs with 2 y-axes, which I created using

ax_left = pylab.subplot(111)
ax_right = pylab.twinx()

Then I switch the sides of the ticks:

ax_left.yaxis.tick_right()
ax_right.yaxis.tick_left()

This works, the ticks are on the opposite sides (left axis ticks are on
the right side and vice-versa).

But, when I want to label the y-axes with for example

pylab.axes(ax_left)
pylab.ylabel('Some label')

they are on the wrong side, i.e. not on the same side as the ticks of
the corresponding y-axis. For this example, the label would be on the
left side instead of the right side.

This is giving me headaches for quite a few hours now, so maybe somebody
knows a solution.

Regards,
antoine
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,434
Messages
2,571,691
Members
48,796
Latest member
Greg L.

Latest Threads

Top