MDANSE icon indicating copy to clipboard operation
MDANSE copied to clipboard

Refactor plotters

Open oerc0122 opened this issue 4 months ago • 1 comments

Description of work Refactor all the plotters to use generator constructs, gridspecs and attempt to reduce code-duplication.

Fixes Prevent number of plots corresponding to number of datasets.

To test Try to break plotting with weird sequences of button presses.

oerc0122 avatar Nov 07 '25 14:11 oerc0122

I have been testing the plotter. What I found so far is:

  1. Grid plots of 1D datasets have an empty legend.

  2. If I plot into Grid or Single with legend switched off, and switch it on afterwards, I get an exception: <class 'AttributeError'> 'NoneType' object has no attribute 'set_visible'

  3. Heatmap plot is labelling the plot axes wrong. In my test, time was shown as Q and Q was shown as time. Screenshot 2025-11-10 at 11 51 59

  4. Heatmap plots start off without any legend. If I switch legend off and on, the legend appears.

  5. If I try to plot a vector summary from the plot creator like this

Screenshot 2025-11-10 at 12 07 03

the plot type ends up being Single and not Vectors:

Screenshot 2025-11-10 at 12 06 42

While we do not want to allow Vectors plot type for normal data sets, it should still be possible to use Vectors for vectors.

  1. For Single and Heatmap plots, switching the legend off and on makes all the subplots resize. Before: Screenshot 2025-11-10 at 12 18 02

After: Screenshot 2025-11-10 at 12 18 12

MBartkowiakSTFC avatar Nov 10 '25 12:11 MBartkowiakSTFC