SuperDARN / pydarn

Python library for visualizing SuperDARN Data
GNU Lesser General Public License v3.0
31 stars 11 forks source link

Kwargs for specific features of plots #361

Closed RemingtonRohel closed 1 month ago

RemingtonRohel commented 8 months ago

New Feature

Name: Kwargs handling

module: everywhere

package: every package

Scope

Passing kwargs to any and all matplotlib plotting calls.

Description

It would be a great addition if kwargs handling was extended so the user could specify kwargs for a specific feature of a plot. For example, plotting a geographic plot with coastlines, and I want to change the line thickness or color or alpha of the coastlines. Perhaps there can be a standardized coastlines_kwargs dictionary as an entry into kwargs that contains the kwargs specific for plotting the coastlines. This sort of behaviour could then be extended to all the interconnected plotting that pyDARN does, and would need to be pretty extensively documented in the function docstrings and ReadTheDocs so that it's clear to the users how to make use of this.

pyDARN Checklist

Development help

pyDARN does not have a dedicated development team on hand to full feature development. However, if you are able to provide some time and help, the community will try to aid you the best way they can in making your feature possible.

If you need help please indicate what expertise you are looking for:

User Interface

Example:

gridplot = pydarn.Grid.plot_grid(grid_data,
                                 start_time=start_time,
                                 lowlat=60,
                                 radar_label='INV',
                                 coastline=True,
                                 cmap=cmap,
                                 coastlines_kwargs={'alpha'=0.5, 'linewidth'=1.0})
RemingtonRohel commented 8 months ago

I realize after writing this that I can likely achieve the functionality of the above example by initializing an instance of Projs then passing that in as a kwarg to plot_grid. However, kwargs for Projs.POLAR is not currently implemented (it's there as a parameter to axis_polar, but is unused).

However, another example where specific kwargs of this sort may be useful: Passing in unique colors to ACF plots so that power and phase are different than the defaults and each other. Simply passing color=... won't be sufficient, since there are multiple ax.plot() and ax.scatter() calls, so more granularity is needed.

carleyjmartin commented 8 months ago

I think this will tie in nicely with a refactor for ax handlng too.