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

User specified arguments in sw_plotspec ignored if 'mode', 'auto' (the default) used #132

Closed
mducle opened this issue Mar 17, 2023 · 0 comments · Fixed by #180
Closed

User specified arguments in sw_plotspec ignored if 'mode', 'auto' (the default) used #132

mducle opened this issue Mar 17, 2023 · 0 comments · Fixed by #180

Comments

@mducle
Copy link
Member

mducle commented Mar 17, 2023

For 'mode', 'auto' (mode 4) and for non-powder mode, sw_plotspec tries to determine what type of spectra is being plotted and then calls itself again with 'mode', 'disp' or 'mode', 'color', however this second call ignores certain user arguments without warning.

Specifically:

  1. For spectra without swConv (e.g. not run through sw_egrid), sw_plotspec calls itself again with 'mode', 'disp' but overrides every argument except for qlabel.
  2. For spectra with swConv, it calls itself again with 'mode', 'color' but overrides dashed, and colorbar.

Behaviour 2 is ok, but behaviour 1 is quite annoying and unexpected for users.

sw_plotspec should be refactored to either:

  1. Avoid this recursive call (e.g. just set mode to 'disp')
  2. Or emit a warning that user provided arguments will be ignored.
@mducle mducle mentioned this issue Apr 25, 2024
mducle added a commit that referenced this issue May 20, 2024
* Fix bug where imag always plots in auto mode #172

* Allow row vector for hkl for single point #179

* Fix inverted user colormap #131

* Refactor sw_plotspec to avoid recursive calls #132

* Add fitspec fixes suggested by K Richardson #98

* Add spinw obj to spec for twin cases in fitspec #158

* Fix spec spinw object issues in fitmode

spinwave() now creates a .obj field regardless
  When fitmode=true, this a barebones struct
  When fitmode=false, this is a full spinw object
Fix issue with sw_plotspec when using fastmode/fitmode
Add basic test for fitspec() to check twins handling

* Fix bug in sw_plotspec 'fastmode' handling

* Fix issues from review. Add change log.
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 a pull request may close this issue.

1 participant