Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide option to move the legend and logo #24

Open
jgieseler opened this issue Nov 7, 2022 · 0 comments
Open

Provide option to move the legend and logo #24

jgieseler opened this issue Nov 7, 2022 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@jgieseler
Copy link
Owner

jgieseler commented Nov 7, 2022

Provide option(s) to allow the user to easily move the position of the legend and the Solar-MACH logo. They are defined using matplotlib:

# legend
leg1 = ax.legend(loc=(1.2, 0.7), fontsize=13)

#logo
ax.text(0.94, 0.16, 'Solar-MACH', fontfamily='DejaVu Serif', fontsize=28,
        ha='right', va='bottom', transform=fig.transFigure)
ax.text(0.94, 0.12, 'https://solar-mach.github.io', fontfamily='DejaVu Sans', fontsize=18,
        ha='right', va='bottom', transform=fig.transFigure)

Maybe the best approach is to follow matplotlib's standard legend placement, that look like the following. The location can be provided by an integer or by a string like 'lower right':
image

So, for solarmach, the example in Python (the streamlit version would use GUI elements, e.g., a dropdown menu for each variable) would look like:

# locations provided by y and x position, e.g. 'upper right'
fig, ax = sm.plot(loc_legend='lower left', loc_logo='center right')

Note that in Python, it should already now be possible to change those locations by using the option to return the matplotlib figure object and modify it afterwards, but this is not straightforward.

@jgieseler jgieseler added enhancement New feature or request good first issue Good for newcomers labels Nov 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant