mantle-convection-constrained / terratools

Tools to read, analyse and visualise models written by the TERRA mantle convection code
https://terratools.readthedocs.io/en/latest/
MIT License
6 stars 5 forks source link

Allowing plotting to existing axes #152

Closed jamespanton93 closed 1 month ago

jamespanton93 commented 1 month ago

In this PR, which relates to #115 , I have added the ability to pass in figure and axis handles into some of the plotting routines, namely plot_layer, plot_section, plot_spectral_heterogeneity and plot_hp_map. I have also made these functions return the handle to the colorbar to allow greater flexibility to users when producing figures. As such calls to these plotting functions in tests and examples have been updated in this PR.

Before your first pull request:

For all pull requests:

For new features/models or changes of existing features:

anowacki commented 4 weeks ago

Great! Good to see this.

Just to note that there are breaking changes in here, so before making the next release we should either:

  1. go with this as is, but bump the version to 2.0.0; or
  2. make the extra colourbar handle returns backwards-compatible (e.g. by only returning the new things when a new keyword argument is set) and only do a minor version bump (because these are new features).

I'm fairly relaxed about either.

These also need items in the changelog.

jamespanton93 commented 4 weeks ago

Thanks Andy, I think I prefer the backwards compatible option - I will make a new PR with the relevant changes. I would also include #153 in the next release, this is also a new feature.