ADF icon indicating copy to clipboard operation
ADF copied to clipboard

[enhancement] Controlling vertical axis in _zonal_plot_preslat()

Open dan800 opened this issue 4 years ago • 2 comments

Currently this routine has a fixed ylim of [1000,1] and a linear scale. It would be nice to add optional kwargs to allow a custom pressure range and/or a log pressure scale to be specified. I am not sure how these arguments would get passed all the way down to _zonal_plot_preslat() -- would it be by adding **kwargs to zonal_plot(), plot_zonal_mean_and_save() and zonal_mean()?

dan800 avatar Jul 13 '21 21:07 dan800

Hi @dan800 , yes, I believe you should be able to add kwargs to the functions you listed and get the functionality you are looking for. We'll put it on our to-do list, although if you end up doing it yourself then feel free to open a PR and we'll get those modifications merged.

Also, if you do end up working on it and need any help or assistance with anything then feel free to respond to this issue we'll try to help as best we can. Thanks!

nusbaume avatar Jul 15 '21 21:07 nusbaume

@dan800 -- Just a tiny bit of follow up on this. I used the code you provided to me to develop an example of how a user can add their own plot. This is a different approach than passing kwargs to the existing plots, but I thought it would be a good example. The good news is that moving the plotting into ADF was mostly easy to do. There were some complications (self inflicted wounds, really), which motivated a discussion that is over at: https://github.com/NCAR/ADF/discussions/65

The upshot is that @nusbaume has been working to make it easier for a user to retrieve any information that ADF has access to. The way we imagine this working is that each plotting script (or whatever analysis) would be designed to get an ADF object as an input/argument to a function, extract whatever info is needed, and then do the work. This helps to make the ADF have a much cleaner user interface (which I'm sure will continue to evolve), and I hope will make it much easier for users to put in their own custom plots and analysis.

That helps, but still doesn't directly address this issue because we could still consider how to deal with kwargs that a user might want to pass into the included plotting scripts. I'm not sure what is the right way to go on this front. We might be able to leverage the new functionality and modify the included plotting scripts to look for any user-specified kwargs. The other option I can imagine is that we could modify the include plotting functions to all have optional kwargs included, and then the user could "wrap" the plotting scripts with their own customized scripts that modify the plots. The distinction between these is where the kwargs would be provided, the YAML file versus in a user-defined script. It might not even be an either/or situation.

brianpm avatar Nov 30 '21 17:11 brianpm