clawpack / visclaw

Clawpack visualization tools
http://www.clawpack.org
BSD 3-Clause "New" or "Revised" License
29 stars 47 forks source link

Add more attributes to some plot classes to simplify things commonly done #291

Closed rjleveque closed 1 year ago

rjleveque commented 1 year ago

I added new attributes to ClawPlotFIgure and ClawPlotAxes to simplify doing various things in setplot.py, all of which could be done using kwargs and/or afteraxes commands, but these are things I do so frequently that I think they should be made simpler.

I think it is all backward compatible, it just makes some things easier.

The figure below shows a new version of a plot from the standard chile2010 example, using this modified setplot.py that takes advantage of some of the new attributes: https://github.com/rjleveque/geoclaw/blob/plot_updates/examples/tsunami/chile2010/setplot.py

Note in particular:

chile2010_frame5

Compare to http://www.clawpack.org/gallery/_static/geoclaw/examples/tsunami/chile2010/_plots/frame0005fig0.html

rjleveque commented 1 year ago

I decided to add fontsize attributes directly to title, title, xlabel, ylabel, xticks, yticks, to require less use of kwargs for this common situation, and updated the chile2010 example to use this, and also to illustrate how xticks locations and rotation can be specified in xticks_kwargs chile2010_frame5a .

rjleveque commented 1 year ago

These seem to be working well.