-
-
Notifications
You must be signed in to change notification settings - Fork 67
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
Log plots support #206
Comments
@florian6973, If you would use the plotly-resampler log support branch see #207, would the code snippets added in the comments resolve your issue? Main things I did:
Kind regards, |
Hi @florian6973, no problem at all! You had an interesting use-case, and this functionality was not yet supported by plotly-resampler, so was certainly worthwhile to investigate!
If you read this part of the documentation, you will see that the
I can see that the second demo visualizes the data via a log x and log-y? So If you would use the fyi: Could you send me some example data from your log-log FT plot? I think that would make a good use-case to add in the examples. Kind regards, |
Thank you very much for your explanations, and sorry for this late reply! Oh I see, I was not aware there was such a feature in plotly-resampler about gaps... This is quite nice indeed! It also means that later a LogGapHandler could be implemented? Yes exactly, regarding the log-log plots, I just used your code and I added the line Sure, the idea is to plot the FFT of a single-cell recording, and to be able to see at the same time the LFP frequencies (a few Hz) and the frequencies related to spikes (10^2 to 10^3 Hz). Please find attached a sample, even if I am not sure this is the best one to see it well. This is 1-sec recording of one channel,. If you need any additional information, please let me know, Best regards, |
Mhmm, I am not following you 100%; I just loaded the Can you give me some example data and code where your log gap issue occurs, even when the nogaphandler is set? |
Hi @florian6973, Thank you for sharing the clarifcation of the examples and sharing your code, very useful. Regarding your zoom-resample issue: Regarding the gaps: [... imports and LogLTTB class ...]
n = 100_000
y = np.sin(np.arange(n) / 2_000) + np.random.randn(n) / 10
fr = FigureResampler()
fr.add_trace(
go.Scattergl(mode="lines+markers", marker_color=np.abs(y) / np.max(np.abs(y))),
hf_x=np.arange(n),
# NOTE: this y can be negative as it is a noisy sine wave
# hf_y=y,
hf_y=np.abs(y),
downsampler=LogLTTB(),
gap_handler=NoGapHandler(),
max_n_samples=10000,
)
fr.update_xaxes(type="log")
fr.update_yaxes(type="log")
fr.update_layout(template="plotly_white", title="log axis demo")
fr.show_dash(mode='inline') If you use |
I think this issue can be closed if (i) the log plot PR gets merged and (ii) the above answer resolved your question! |
Thank you very much Jonas for all your explanations and help! |
The PR is now merged on the main branch, After I fixed another issue, I will create a new release candidate! |
@florian6973 we just created |
Hi!
I am trying to use plotly-resampler for log plots, but since it is a linear downsampling, it does not work (bad resolution on the left on the graph). Would you know a workaround by any chance, or if it is a planned feature?
Thanks!
The text was updated successfully, but these errors were encountered: