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

Consider different figure style for different type of plots #114

Open
MOchiara opened this issue Nov 14, 2024 · 4 comments
Open

Consider different figure style for different type of plots #114

MOchiara opened this issue Nov 14, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@MOchiara
Copy link
Member

No description provided.

@eleanorfrajka
Copy link
Collaborator

Does this mean replicating glidertest.mplstyle?

I think this could be a good idea. One problem at present is that some figures need a different aspect ratio in order to plot well. E.g., plot_vertical_speeds_with_histograms() looks fine with the figsize 14,10. But plot_ts() looks wonky.

Solution could be

  • to tailor as many glidertest_*.mplstyle as there are figures (which defeats the purpose)
  • agree a small number (4) of total styles, and massage each figure/plotting function to fit.

It may be worth thinking about this at the same time as thinking about generating a "glidertest summary" or some other standard output, and what format that would take. Might need a separate issue. Chiara and I chatted about this briefly--that there could be the option to run glidertest from the command line which would take as input the OG1 *.nc file, automatically run a default set of tests/checks and figures based on the data variables/sensors available in the file, and then generate an output (e.g. PDF format, readable in landscape as a slide deck).

Argument for landscape/slide deck mean that it can easily be used e.g. in meetings to discuss the data, and really sets some stringent requirements on readability (that folks are often willing to overlook in a portrait-type PDF). And if you want a more compressed printed form, you can just put two slides to a page.

If this summary output is one of the desired outputs from glidertest, then it may help set constraints on the figures to be generated.

@callumrollo
Copy link
Member

I think the idea of a landscape slideshow format report is a good guiding principle to how glidertest figures should look. I am also very drawn to the idea of mass producing little interactive jupyter notebook reports for each dataset.

From a technical standpoint, we should be able to take the demo notebook and convert it into slides using RISE. These interactive slides can also be exported to netcdf. I'll knock together a demo

@MOchiara
Copy link
Member Author

The weird TS needs to be resolved but it looks to me like you so want it squared are forcing the size?
@eleanorfrajka

# Adjust the width of ax[1] to match the size of the frame of ax[2]
box1 = ax[1].get_position()
box2 = ax[2].get_position()
dw = box1.width-box2.width
ax[1].set_position([box1.x0+dw, box1.y0, box2.width, box1.height])
# Adjust the height of ax[2] to match the width of ax[0]
box0 = ax[0].get_position()
dh = box0.height - box2.height
ax[2].set_position([box2.x0, box2.y0 - dh, box2.width, box0.width])
# Adjust the height of ax[2] to match the width of ax[0]
box0 = ax[0].get_position()
box2 = ax[2].get_position()
fig_width, fig_height = fig.get_size_inches()
new_height = box0.width *  fig_width / fig_height
ax[2].set_position([box2.x0, box2.y0, box2.width, new_height])

@eleanorfrajka
Copy link
Collaborator

Yeah, so this is an attempt to make the printed axis size the same for the two subplots. That way, the ticks are the same distance apart and you could, in theory, cut out the plot and hold it up to a window to overlay things.

So -- the width of the TS plot (in salinity) is the same size as the width of the histogram of salinity only, and the height of the TS plot is the same length as the width of the histogram of temperature only.

I did something like this in the plot_vertical_speeds_with_histograms() plot. The lower left axes will always be smaller than or equal to the top left axes. So I shrunk the size of the lower left axes so that the tick marks are the same distance apart. It's finicky, and picky, and not strictly necessary. But this way the visual representations of the data are more similar.

It's a bit like this plot from Louis, where the 1-d histogram plots have been rotated so that the axes align:

@eleanorfrajka eleanorfrajka added the enhancement New feature or request label Nov 28, 2024
@MOchiara MOchiara linked a pull request Dec 2, 2024 that will close this issue
@MOchiara MOchiara removed a link to a pull request Dec 2, 2024
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