Hi,

Glad it is of some use to you! Items can be removed from the legend in two 
ways:
# Remove by label
l.removeItem("my red plot")
# Remove by reference to plot item
l.removeItem(c2)


There isn't a l.clear() method or similar, which would be nice, but keeping 
with the theme of this thread, here's a hacky one-liner to do that:
# Remove all items
[ l.removeItem(sample.item) for sample, label in list(l.items) ]

Patrick

On Wednesday, 24 April 2019 09:22:58 UTC+9:30, Jaime Heiss wrote:
>
> Thank you so much Patrick.
> This is almost perfect!
> I just have one stupid question:
> How do I clear the legend every time I clear the plot?
>
> Thanks!
>
> On Saturday, April 20, 2019 at 12:25:53 PM UTC-7, Jaime Heiss wrote:
>>
>> Hello.
>> Is there any updated documentation about legend handling?
>> I need to remove the box, change background color and make thicker lines 
>> as well as horizontal lines instead of the diagonals. If anybody could post 
>> an example, I will appreciate it. 
>>
>> Thanks.
>>
>>

-- 
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/b58df232-a516-4a67-a98d-5a95df766325%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to