Hello! Thank you for your respond!
I started with doing that method but it didn't work as when i called
clear(), it removed the data from the graph as it supposed to but when i
started to plot again, calling another function, it started where it
stopped and showed previous plots.
It feels like it never actually empty the setData or DataItem.
example:
win = pg.GraphicsWindow(...)
p1 = win.addPlot(...)
curve1= p1.plot()
curve2=p1.plot()
def somefunction():
if x=something:
curve1.clear()
curve2.clear()
def replot():
plot new data
curve1.setData(x)
curve2.setData(y)
My point is, at function "replot" it plots old values and start where
"somefunction" was called, where clear() was called. Does it work for you
when you call clear?
On Fri, May 11, 2018 at 4:08 AM, Patrick <[email protected]> wrote:
> Hi Hamza,
>
> It's missing from the documentation of PlotDataItem (
> http://www.pyqtgraph.org/documentation/_modules/pyqtgraph/graphicsItems/
> PlotDataItem.html) but there is a clear() method, which should do what
> you want. Alternatively, you could probably setData(0).
>
> (I find looking at the source code found behind the green "[source]" link
> in the documentation can reveal a few useful undocumented features).
>
> Patrick
>
> On Friday, 11 May 2018 03:26:15 UTC+9:30, HK wrote:
>>
>>
>> Hello!
>> I have made a graph that plots sensor signals, and i have it in a class
>> such Qt4 GUI can show it in widget. I have tried few things lately but it
>> haven't fulfilled my wishes.
>> I want my graph to reset/reload or whatever you want to call it when i
>> want to start new measurements, that is graph with no data plotted.
>> I've been trying repaint, update etc but can't quite get it to work,
>> matter fact i dont understand if i am using repaint/update correctly.
>>
>> Any suggestions how i may solve this issue?
>>
>> Best Regards,
>>
>> Hamza
>>
> --
> 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/00b270c5-b395-466d-891b-ba87a3c77d06%40googlegroups.com
> <https://groups.google.com/d/msgid/pyqtgraph/00b270c5-b395-466d-891b-ba87a3c77d06%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>
--
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/CAOm7sooJwXvszjicOZ-O9yctXFfOvtaSfxhvQ4S-M%2BY3Vfqr7w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.