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

changing x/y axis display labels & error bar display #159

Open
eggulbahar opened this issue Dec 5, 2024 · 2 comments
Open

changing x/y axis display labels & error bar display #159

eggulbahar opened this issue Dec 5, 2024 · 2 comments

Comments

@eggulbahar
Copy link

Hello, I have been using lcviz to plot xmm-newton lightcurve data. To do that I have been using a read_lightcurve() function that converts XMM-Newton light curve file into a LightCurve object. I have been wondering how could I change the displayed y-axis name from flux to count rate when the data is plotted, as this is the usual way we present xmm lightcurves. Furthermore, I have been struggling to display any of the y-axis error bars. I have included it in my LightCurve object conversion ( LightCurve(time=time, data=tab, flux=tab['rate'], flux_err=tab['error']) ), but for some reason they are not displayed. Am I perhaps missing a step? Many thanks!

@kecnry
Copy link
Member

kecnry commented Dec 6, 2024

I have been wondering how could I change the displayed y-axis name from flux to count rate when the data is plotted

Changing the axes labels isn't technically supported, as they are managed automatically by the code. However, you can access internal methods to "hack" a change to the labels (i.e. before exporting the plot) if you'd like. Note that this is not considered public API so is subject to change in future releases:

lcviz.viewers['flux-vs-time']._obj.state.x_axislabel = 'new x label'
lcviz.viewers['flux-vs-time']._obj.state.y_axislabel = 'new y label'

I have been struggling to display any of the y-axis error bars...

Uncertainty handling is unfortunately not yet implemented (but already on our list - I'll try to bump it up to get it in sooner).

@eggulbahar
Copy link
Author

Thank you for the answer! Looking forward to the uncertainty handling.
Also one last final question, is there another internal method/hack I can use to change the plotting of the time in seconds instead of days. The LightCurve object I pass does indeed have the time column in seconds however when i plot it, its in days and I was hoping to keep it so.

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

No branches or pull requests

2 participants