Skip to content
New issue

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

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

Already on GitHub? # to your account

Implement histogram-style (steps, not real histogram) plots for specviz #385

Closed
eteq opened this issue Jan 13, 2021 · 6 comments · Fixed by #1595
Closed

Implement histogram-style (steps, not real histogram) plots for specviz #385

eteq opened this issue Jan 13, 2021 · 6 comments · Fixed by #1595
Labels
feature Feature request specviz

Comments

@eteq
Copy link
Contributor

eteq commented Jan 13, 2021

This was discussed in several places in #133 but I'm now realizing we never broke out an issue to specifically do this.

The goal here is to implement "histogram-style" plots instead of "line plots" - i.e., have the points on the spectrum be plotted as the center of a "box"-like plot instead of joining the segments directly as a line. For optical spectra this is typically more physical because they are closer to the concept of "flux in boxes" vs "samples from a continuous signal".

Not everyone agrees on what I just said there, so for this issue that should be an option. After this is implemented we can discuss whether it should be the default (which is what I advocated for in #133, but others were less convinced.)

🐱

@eteq eteq added the specviz label Jan 13, 2021
@nancymac519
Copy link

The "histogram-style" plot mode is essential; please implement. It's the most realistic way to view any data that are binned into pixels. i agree with eteq that it should be the default; I used to get really tired of nagging students to use it with IRAF.

R calls this plot style "step plot" or "stair step" plot, a much better term than "histogram," which properly refers to a completely different type of graph.

I'm not yet a SpecViz user, and will not be a consistent user until this is implemented, but i would like to be. Thanks!

@karlglazebrook
Copy link

karlglazebrook commented Nov 9, 2021

Found this when I was seeing if anyone else had requested this.

Yes this is the superior way to plot spectra, as they contain pixels.

In matplotlib the command would be plt.step(wav, flux, where='mid') or plt.plot(..., drawstyle='steps-mid')

@pllim pllim added the feature Feature request label Nov 9, 2021
@nancymac519
Copy link

nancymac519 commented Nov 9, 2021 via email

@pllim pllim changed the title Implement histogram-style plots for specviz Implement histogram-style (steps, not real histogram) plots for specviz Feb 15, 2022
@pllim
Copy link
Contributor

pllim commented Feb 15, 2022

Solution from @astrofrog : Change profile viewer over at glue-jupyter to pass in marks for edges of the steps instead of middle.

https://github.com/glue-viz/glue-jupyter/blob/d6c9dd72714d5f3d872289bdcac5a9acc2161232/glue_jupyter/bqplot/profile/layer_artist.py#L71

@PatrickOgle
Copy link
Contributor

I disagree that this should be default. For high SNR spectra with thousands of wavelength bins, it adds clutter.
It should definitely be an option.

@kecnry
Copy link
Member

kecnry commented May 5, 2022

It will be an exposed option in the layer options with glue-viz/glue-jupyter#309 (glue work already merged in glue-viz/glue#2292), but will default to using steps (as this is how the profile viewer already worked in matplotlib within glue). If we want to change the default in jdaviz to not using steps, we will need extra logic on our end whenever a new layer is added to override glue's default or we can suggest the change upstream.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
feature Feature request specviz
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants