UCL / dxh

Collection of helper functions for working with DOLFINx Python interface
http://github-pages.ucl.ac.uk/dxh/
MIT License
3 stars 0 forks source link

Adding option to share value axis in plots #21

Closed matt-graham closed 1 month ago

matt-graham commented 1 month ago

Resolves #19

Adds a new share_value_axis boolean argument to dxh.plot_1d_functions and dxh.plot_2d_functions that allows using a shared axis scaling for function values when multiple functions are being plotted. For 1D functions this corresponds to using a shared vertical axis scaling. For 2D functions plotted as a pseudocolor plot this corresponds to using a common normalization to the colormapping used, and for 2D functions plotted as a surface plot this corresponds to using a common scaling on the vertical (z) axis (and a common normalization to the colormapping if relevant).

Tests are also extended to cover both values of new argument.

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 97.1%. Comparing base (fad6e67) to head (f558c9e). Report is 1 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #21 +/- ## ======================================= + Coverage 96.9% 97.1% +0.2% ======================================= Files 1 1 Lines 191 201 +10 Branches 38 40 +2 ======================================= + Hits 185 195 +10 Misses 4 4 Partials 2 2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

matt-graham commented 1 month ago

@Phillu99 let me know if what I've added here resolves the issue from your perspective.