proplot-dev / proplot

🎨 A succinct matplotlib wrapper for making beautiful, publication-quality graphics
https://proplot.readthedocs.io
MIT License
1.07k stars 96 forks source link

The attribute fontsize in legend can not execute. #383

Closed whpldgs closed 1 year ago

whpldgs commented 1 year ago

Description

When set fontsize=300 in legend, the attribute fontsize in legend can not execute, the legned fontsize unchanged.

import proplot as pplt

labels = ['a', 'bb', 'ccc', 'ddddd', 'eeeee']

fig, axs = pplt.subplots(ncols=2, share=False, axwidth=3)
hs1, hs2 = [], []

state = np.random.RandomState(51423)
for i,label in enumerate(labels):
    data = (state.rand(20) - 0.45).cumsum(axis=0)
    h1 = axs[0].plot(data, lw=4, label=label, legend='ul',
                     legend_kw={'order':'F', 'title':'column major'})
    hs1.extend(h1)
    h2 = axs[1].plot(data, lw=4, label=label, legend='r', cycle='Set3', 
                     legend_kw={'ncols':1, 'order':'F', 'frame':False, 'title':'No Frame', 'fontsize':40})
    hs2.extend(h2)

# Outer legends
axs[0].legend(loc='b', ncols=3, facecolor='red', fontsize=300)

图片

AWSisco commented 1 year ago

This might be a duplicate of #331, which was resolved. If you are using an older version of proplot, it might be worth updating to the latest development version to see if that fixes the fontsize functionality.

whpldgs commented 1 year ago

Thank you! Use the command "pip install proplot", still install an old version proplot. To install a development version of proplot, can resolove this issue.