proplot-dev / proplot

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

adding custom abc and multiple titles #294 #317

Closed pratiman-91 closed 2 years ago

pratiman-91 commented 2 years ago

Description

Currently, abc does not consider the custom text. A provision can be made to incorporate that. Multiple titles can be incorporated in the format. I know there are ways that the functions may not be even needed. However, it is for the sake of consistency and making the user end code simple.

Modified Code for abc

import proplot as pplt
fig = pplt.figure(space=0, refwidth='10em')
axs = fig.subplots(nrows=3, ncols=2)
axs.format(
    abc=('A','B','1','2','a','b'), abcloc='ul',
    xticks='null', yticks='null', facecolor='gray5',
    xlabel='x axis', ylabel='y axis',
)

Output

abc_title

Modified Code title

import proplot as pplt
fig = pplt.figure(space=0, refwidth='10em')
axs = fig.subplots(nrows=3, ncols=2)
axs.format(
    urtitle=('Title 1', 'Title 2', 'Test 1', 'Test2', 'Exp1', 'Exp2'),
    xticks='null', yticks='null', facecolor='gray5',
    xlabel='x axis', ylabel='y axis',
)

Output

muliple_titles

lukelbd commented 2 years ago

Looks good to me! Like the implementation, very simple / minimal. Thanks for the help.

lukelbd commented 2 years ago

Just cleaned up the input validation (e.g. for case where 3 titles are passed but figure contains only 2 axes), internals, and format docstring in a quick commit (fe792114).