Quasars / orange-spectroscopy

Other
52 stars 58 forks source link

[ENH] Visualization parameters #605

Closed markotoplak closed 1 year ago

borondics commented 2 years ago

@markotoplak is there any chance we could merge this in the next few days? I am not sure if we have the line width changing feature available also, but I would also need that.

codecov-commenter commented 1 year ago

Codecov Report

Merging #605 (d621cea) into master (969b08c) will decrease coverage by 0.08%. The diff coverage is 88.35%.

:mega: This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##           master     #605      +/-   ##
==========================================
- Coverage   89.47%   89.39%   -0.08%     
==========================================
  Files          71       72       +1     
  Lines       11897    11971      +74     
==========================================
+ Hits        10645    10702      +57     
- Misses       1252     1269      +17     
markotoplak commented 1 year ago

I added the same basic visualization parameters to the HyperSpectra widget - mostly to see if I can use a single settings window to control both visualizations.

So now we need to decide where to go. I'd need advice:

And ideas? @borondics, @stuart-cls

stuart-cls commented 1 year ago

Very nice!

I agree, axis limits and line widths should be included (line widths is a frequent request).

For widgets, I agree about Preprocessor. I think Spectral Series should have it. I'm on the fence about Peak Fit: people want to use the fits plots but no one likes how awkward the current implementation makes that :) (it was only meant to show a representative few fits)

borondics commented 1 year ago

Cool stuff!! Thanks :)

I was wondering about the single parameter window possibility. The problem there will be that 1D spectra and 2D map plots require slightly different stuff that can mess up a bit the interface. I wonder if it would be nicer to have the visual settings belong to the axes and not the widget. Or somehow make two little icons in the widget status bar? Or just have one icon that would give a dropdown for the individual plots?

I agree with those parameters (display limits and line width) and there is one thing I've been dreaming about and I think it prevents us using the plots in paper: figure sizing. I know that the axes sizing is hard (although that would be ideal) but we could at least try something with the window that would make the axes area always the same?

stuart-cls commented 1 year ago

I think the combined settings for both figures in Hyperspectra works well and is intuitive. I can't imagine a situation where you need different Title formats for the two figures.

Good point about figure sizing / aspect ratio. That stuff would fit nicely in this menu as well if feasible.

I reviewed what the interactive Matplotlib window exposes as GUI settings, and we've basically covered it all if we include figure sizing.

markotoplak commented 1 year ago

Inspired by wrangling visual settings with @borondics I added view range limits for spectra (where we already had them in menus). Because they work differently that they used to - whetever is typed in is strictly adhered to in all (I hope) situations - I could not reuse the old settings (the old behaviour was that a user had to apply them manually, they were just saved).

I think this is not ready to be merged. Other settings can (and therefore should) be added separately.

Can anyone test it out a bit?

stuart-cls commented 1 year ago

Thanks Marko, this is nice! Having the separate window to live edit the figure is a great experience.

Regarding the View Range, it's quite weird now. When the View Range is active, none of the interactive figure tools work (zoom, rescale, etc). I guess this is the hard trade-off of optimizing for a particular figure, and exploring data, but this seems like too much of a swing toward the former.

A possible solution is to have some visible indicator (I think pyqtgraph does this with a little "A" button for autoscaling) that shows when the fixed limits are applied vs when you are zooming around. We could add (another!) setting in the drop down to toggle between them. That would at least be explicit, which is better than the old way where it was hard to tell if the figure limits were currently applied or not. The dynamic zoom tools could then be disabled in fixed limits mode.

One last thing, the "Reset" button. It's great to have a global reset but I was quite surprised to lose my figure captions when all I wanted was to reset the View Range limits! I predict this to be a future source of hair-pulling by our users.

markotoplak commented 1 year ago

Regarding the View Range, it's quite weird now. When the View Range is active, none of the interactive figure tools work (zoom, rescale, etc). I guess this is the hard trade-off of optimizing for a particular figure, and exploring data, but this seems like too much of a swing toward the former.

Yes, I know. I tried but could not think of a good compromise of actually setting view range limits and being able to explore, so then opted for two extremes: (1) no limits, free graph, explore as you will (2) limits, strict for export/display just as the user wants.

We could add (another!) setting in the drop down to toggle between them. That would at least be explicit, which is better than the old way where it was hard to tell if the figure limits were currently applied or not. The dynamic zoom tools could then be disabled in fixed limits mode.

So, if I simplify, you suggest adding a setting whether to observe set limits or not? I do agree this is easy to add, but I am not sure it is needed. I am limited by the dialog here. What we could do is add a checkbox in this dialog that enables/disables limits, if this is a common-enough operation.

I would not want to put that setting into the menu, because then you have two separate places for something very related and could be confusing (and would then really need some visual indicators, but I doubt even that would be enough to make it clear).

One last thing, the "Reset" button. It's great to have a global reset but I was quite surprised to lose my figure captions when all I wanted was to reset the View Range limits! I predict this to be a future source of hair-pulling by our users.

Funny, I did not notice that Reset button before. Yeah, I understand what can happen.. I hope for a single hair-splitting session per user. Perhaps we should add some space between settings and the buttons part... No idea what is the best thing to do there.

markotoplak commented 1 year ago

@borondics suggest adding some indication of axes lock.

markotoplak commented 1 year ago

I have added an Information that axes are locked. Before that, I tried adding a lock symbol on the graph, but positioning it proved tedious, plus it did not seem that clear.