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

BUG: plot_spectra() does not correctly plot a decreasing axis #1972

Closed
jat255 opened this issue Jun 5, 2018 · 1 comment
Closed

BUG: plot_spectra() does not correctly plot a decreasing axis #1972

jat255 opened this issue Jun 5, 2018 · 1 comment
Milestone

Comments

@jat255
Copy link
Member

jat255 commented Jun 5, 2018

If the scale of the x-axis is negative (common in IR spectroscopy), using the plot_spectra function will plot the data in increasing order:

Example plotting using s.plot():
image

Example using plot_spectra():
image

This is because matplotlib defaults to an increasing axis, and there is no explicit setting of axes limits like there is in signal.plot() (see https://github.com/hyperspy/hyperspy/blob/RELEASE_next_minor/hyperspy/drawing/signal1d.py#L113-L116).

This shouldn't be too hard to fix by copying those lines or similar into plot_spectra

@jat255 jat255 changed the title BUG: plot_spectra does not correctly plot a decreasing axis BUG: plot_spectra() does not correctly plot a decreasing axis Jun 5, 2018
@ericpre
Copy link
Member

ericpre commented Jun 27, 2018

Fixed in #1973.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants