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

Toggle logarithmic y-axis scale on plots #3

Open
Keaton-Blair opened this issue Apr 29, 2022 · 1 comment
Open

Toggle logarithmic y-axis scale on plots #3

Keaton-Blair opened this issue Apr 29, 2022 · 1 comment
Labels
bug Something isn't working wontfix This will not be worked on

Comments

@Keaton-Blair
Copy link
Contributor

For the Bokeh plots, it would be very helpful to be able to toggle between a log scale and linear scale on the y-axis. At the very least, changing the first plot (SNR vs. wavelength) to a log scale by default when trying to calculate exposure time (log(exp) vs. wavelength) would make it much easier to fit the entire data range within the plot, and much easier to view.

@Keaton-Blair
Copy link
Contributor Author

Unfortunately, Bokeh's JavaScript API has no way to change the axis scale on a plot once it has already been created. So, the only way to toggle between scales currently would be to switch between entirely separate plots.

This could be accomplished in one of two ways:

  • Creating an additional plot when the page loads, but keeping one plot permanently hidden, so that only one of the two plots are ever shown at the same time.
  • Deleting and replacing the plot whenever we wish to switch between log and linear axis scales.

However, due to Bokeh's internal organization, both of these approaches are currently unfeasible. Because the plots are grouped together in a GridPlot object, which improves the layout, organization, and responsiveness of the three plots, both of these approaches would require modifying the GridPlot by either toggling the visibility of plots or adding and removing plots. I've implemented both of these approaches, but they both generate a number of bugs that are much worse than the log scale problem we want to solve.

Bokeh's development is ongoing, and it's worth returning to the documentation (docs.bokeh.org/en/latest/docs/user_guide/bokehjs.html) in the future to see if these issues have been resolved. Note that the Bokeh source files in the ETC are stored in src/imports, and would need to be manually updated if a future version of Bokeh is implemented.

@Keaton-Blair Keaton-Blair added bug Something isn't working wontfix This will not be worked on labels Apr 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

1 participant