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
Append data and set data difference #4
Comments
Yes, you got it right. DataConnector has two methods to update plot data, |
Great, Is it possible to retain data when using cb_append_datapoint? I would like to pan and look at the past data when streaming is stopped. Do I need to modify the append_datapoint implementation to be able store past data? Or do we have any other way to hold old data? Thanks. |
No, in the current implementation you display everything what is in the queue. You can remove max_point parameter so no data will be thrown away, but that would slow down plotting performance drastically (if you want to plot in high frequencies). I'm currently working on a new version employing range_controller, which would enable you to plot only part of the collected data, pretty much doing what you want. But it still need some development and I'm planning to release it soon. |
You can try version 0.4.2, which supports scrolling view for X or Y axis. You don't have to reset or remove any data in |
Thank you, I just looked at the update. I will give it a try. Thanks again. |
Hi, |
So the whole concept of new update is to calculate offset based on the space between ticks. If you base your data generator on time, you can then calculate how many ticks to set in max_points and how to set offsets. Let's say we have data generator set to 100Hz (100 ticks / second). We want to hold 2 minutes in our max_points and then show full one minute worth of data with roll_on_tick every second. You would create: And data connector like this (assuming 100Hz data generator): This would do the job. But there is one problem, that before we accumulate 60000 points we would see big empty space on the left side. That's normal, because that what our offset_left = 60 produces. x[0] - 60 * (x[max] - x[min]). Try following example if it does what you need. You can then scale ticks sizes to your situation. If you really need to stick to external timers, then of course you need to change other things.
|
I've added option to plot data with range controller and with version 0.4.4 it's also possible to plot multiple plots inside one view with different plot rates (one_plot_multiple_plot_rates.py example). I will close this issue as resolved. Thank you for your interest and ideas, which helped to improve pglive and make it more useful for others. |
Hi, I am a little confused with cb_set_data and cb_append_data_point. Source code says, it "replaces current data" for cb_set_data, and "appends new data point" for cb_append_data_point. My understanding is that, when using cb_append_data_point, we can retain old data. For instance, if the plot widget is set to max_points of 600, the plot will start scrolling when it reaches max_points, but we will be able to pan and look at the past data if cb_append_data_point is used. Whereas, if we use cb_set_data, points in the view box will be replaced by a new set of data points when max_point is reached. Please let me know if this is correct. Thanks.
The text was updated successfully, but these errors were encountered: