Ok I have worked out how to keep the x-axis time spacing constant by
using setRange(). So now whether I have 1 sample or 3000 samples view range
remain constant.
def update(self):
"""Update every Minute """
self.pqg_plot_item_data.setData(y=list(self.data),x=list(self.time))
self.pqg_plot_viewbox.setRange(xRange=(self.time[-1]-1000*20,self.time[-
1])) # approx 20 sec range
self.value_display.setText("Current Altitude = "+str(self.data[-1]))
The issue remain is:
1. How to notify the plot if I change the range by right clicking and
dragging side ways. Currently the graph is being updated every second and
hence any right click dragging is lost due to every-second update. If I can
know the change in range on x-axis, I can update the x-axis with new range.
--
You received this message because you are subscribed to the Google Groups
"pyqtgraph" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/pyqtgraph/06cf06e4-ed6a-468f-aa5a-92ffa7125909%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.