Skip to content

[Bug]: can not set ylabel fontsize in host_subplot #28124

@BHM-Bob

Description

@BHM-Bob

Bug summary

can not set ylabel fontsize in host_subplot with ax.set_ylabel
matplotlib==3.7.5

Code for reproduction

# normal plot
fig, ax1 = plt.subplots(figsize = (10, 8))
ax1.bar([1, 2, 3], [1, 2, 3], color = 'black')
ax1.set_ylabel('ylabel', fontsize = 20)
plt.suptitle('subplots fontsize=20', fontsize = 20)
plt.title('subplots fontsize=10', fontsize = 10)
plt.show()

# host_subplot
ax2 = host_subplot(111, axes_class=axisartist.Axes)
ax2.figure.set_size_inches((10, 8))
ax2.bar([1, 2, 3], [1, 2, 3], color = 'black')
ax2.set_ylabel('ylabel', fontsize = 20) # this code does not work
# ax2.axis['left'].label.set_fontsize(20) # this code works
plt.suptitle('host_subplot fontsize=20', fontsize = 20)
plt.title('host_subplot fontsize=10', fontsize = 10)
plt.show()

Actual outcome

ax2 has ylabel and it's font size is NOT 20 as ax1

Expected outcome

ax2 has ylabel and it's font size is 20 as ax1

Additional information

ax2.set_ylabel('ylabel', fontsize = 20) # this code does not work
# ax2.axis['left'].label.set_fontsize(20) # this code works

Operating system

windows10

Matplotlib Version

3.7.5

Matplotlib Backend

TkAgg

Python version

Python 3.8.10

Jupyter version

No response

Installation

pip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions