matplotlib/mplcairo

y-axis title rotated

nbecker opened this issue · 5 comments

{'python': '3.10.2 (main, Jan 17 2022, 00:00:00) [GCC 11.2.1 20211203 (Red Hat 11.2.1-7)]',
'mplcairo': '0.4',
'matplotlib': '3.5.1',
'cairo': '1.17.4',
'freetype': '2.11.0',
'pybind11': '2.8.1',
'raqm': '0.7.2',
'hb': '2.9.1'}

Very strange issue. Ran a script I've been using for years, and now the y axis label comes out rotated.
I am using Multipage

from mplcairo.multipage import MultiPage

When multipage is not used (the script has option to plot to screen instead) the issue does not appear.

It's not feasible to attach the script and data.

Attached is the pdf output showing the sideways y-axis label, which was produced by:
ax.set_ylabel('bler')
results.2022-02-08.pdf

Actually, I can easily reproduce this

import numpy as np
from mplcairo.multipage import MultiPage
import matplotlib.pyplot as plt
cm = MultiPage('test_mpl.pdf')

with cm as pdf:
    x = np.arange(10)
    y = x**2
    fig, ax = plt.subplots()
    ax.plot (x, y, 'x')
    ax.grid()
    ax.set_ylabel('bler')
    ax.set_xlabel(r'$\lambda$')
    pdf.savefig (fig)
    plt.close()

test_mpl.pdf

This is fixed as of master by a9e546f. (Can you confirm this?)

Did this fix make it into the version available on pypi? I still see it there but not when installing from git.

Took me a while, but I finally release v0.5. Enjoy :)