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

plot utility to annotate figure with platform ID #143

Open
eleanorfrajka opened this issue Nov 28, 2024 · 6 comments
Open

plot utility to annotate figure with platform ID #143

eleanorfrajka opened this issue Nov 28, 2024 · 6 comments
Labels
enhancement New feature or request

Comments

@eleanorfrajka
Copy link
Collaborator

eleanorfrajka commented Nov 28, 2024

For each plotting function which generates its own fig, add some annotation outside the axes (top left? bottom right?) to print the platform ID from the ds input.

For example, GMT has a feature to add a little time stamp to figures:

Could instead be the platform ID (logo optional).

@eleanorfrajka eleanorfrajka added the enhancement New feature or request label Nov 28, 2024
@eleanorfrajka eleanorfrajka changed the title feat request: plot utility to annotate figure with platform ID plot utility to annotate figure with platform ID Nov 28, 2024
@MOchiara
Copy link
Member

MOchiara commented Dec 4, 2024

I can make a function but we have a small problem at the moment. The relevant info are at the moment called glider_serial or glider_model but in OG1 they are supposed to be called with 'PLATFORM' at the beginning
image

@MOchiara
Copy link
Member

MOchiara commented Dec 5, 2024

I a have a draft of this function (we have to fix the nomenclature in the attributes though). It is somewhat hard to choose a universal right location if we have it as a True or False (ex. add_annotation=True as a parameter in all plotting functions)

@callumrollo
Copy link
Member

Yeah that's on me! A fault in the demo file. Will fix next week after the vocab/format meeting. I don't know how you've designed you draft, but for me this would make sense as a secondary function. Like:

fig, ax = plots.plot_ts(ds)
fig = add_meta_to_fig(fig, ds, location='bottom right')

@MOchiara
Copy link
Member

MOchiara commented Dec 5, 2024

Yeah that or within the function and it is True as default and can be turned off but then it is annoying to position if you do want it but just not in that exact corner

@callumrollo
Copy link
Member

Yeah, I think this works better as a secondary/wrapper function. That's why we return fig and ax after all!

In my experience, once a function has more than ~ 4 arguments/kwargs it becomes real messy to maintain. So best to separate out the functionality

@eleanorfrajka
Copy link
Collaborator Author

I am less worried about whether it shows up in the right corner. I kind of see it as a useful badge for non-production figures, and assume that if anyone wants a figure for an actual publication, that they'll pull out the fig, ax themselves for fine tuning. (Or in a pinch, they'll just crop the tag, as long as it appears outside what would otherwise be necessary to include for a rectangular crop of the figure--retaining all axes labels, legends, colobars but squeezing off any excess whitespace.. the tag could then be in the whitespace.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants