Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENH] Visualization parameters #605

Merged
merged 11 commits into from
Apr 14, 2023
Merged

Conversation

markotoplak
Copy link
Collaborator

No description provided.

@markotoplak markotoplak marked this pull request as draft March 23, 2022 13:29
@markotoplak markotoplak changed the title Spectra visualization parameters [ENH] Spectra visualization parameters Mar 23, 2022
@markotoplak markotoplak marked this pull request as ready for review March 23, 2022 15:28
Copy link
Member

@stuart-cls stuart-cls left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice! I have a few comments:

  • Widgets that re-use the Spectra widget (Peakfit, Hyperspectra) are losing the ability to annotate the figures. I guess we can plan to re-add it but we should make an issue to track that
  • How did you decide which visual items to put here and which ones to leave in the little menu? It seems arbitrary. It's a much nicer experience typing into the separate window and seeing your changes updated on the graph than trying to edit things one-by-one in the little drop-down. In particular, I'm thinking of the Define view range, which I find currently hard to use.

Otherwise, I didn't see any problems bringing old workflows forward into this.

Thanks,
Stuart

orangecontrib/spectroscopy/widgets/owspectra.py Outdated Show resolved Hide resolved
@borondics
Copy link
Member

@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
Copy link

codecov-commenter commented Oct 10, 2022

Codecov Report

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

📣 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 markotoplak force-pushed the spectra-params2 branch 2 times, most recently from 85fa435 to af4617d Compare October 11, 2022 11:32
@markotoplak markotoplak changed the title [ENH] Spectra visualization parameters [ENH] Visualization parameters Oct 11, 2022
@markotoplak
Copy link
Collaborator Author

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:

  • What should we add to these settings? I think adding axis limits (define view range) would make sense, also we could add line thickness, which is now not a parameter. Any other ideas?
  • Where do we add them to? Do we also need these for preprocessor widgets? I believe visualizations in those widgets are not meant to become final plots so I am leaning towards "no".

And ideas? @borondics, @stuart-cls

@markotoplak markotoplak marked this pull request as draft October 11, 2022 11:42
@stuart-cls
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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 markotoplak force-pushed the spectra-params2 branch 7 times, most recently from 414d52e to b457eb6 Compare March 21, 2023 12:05
@markotoplak markotoplak marked this pull request as ready for review March 21, 2023 12:06
@markotoplak
Copy link
Collaborator Author

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?

@markotoplak markotoplak force-pushed the spectra-params2 branch 2 times, most recently from cf680b4 to 376c6f5 Compare March 21, 2023 14:03
self.setText(str_or_empty(value))


@_add_control.register(FloatOrUndefined)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@VesnaT, here I am using two of your private decorators. I think they are really useful and should be made public. That is the only way to get a new type of control into the visual settings dialog, right?

@stuart-cls
Copy link
Member

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
Copy link
Collaborator Author

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
Copy link
Collaborator Author

@borondics suggest adding some indication of axes lock.

@markotoplak
Copy link
Collaborator Author

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.

@markotoplak markotoplak force-pushed the spectra-params2 branch 2 times, most recently from b3575e5 to 094f46a Compare April 13, 2023 13:08
@markotoplak markotoplak merged commit db227c5 into Quasars:master Apr 14, 2023
@markotoplak markotoplak deleted the spectra-params2 branch April 20, 2023 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants