I'd seen that example, but it looked like it was attaching text at specific 
data coordinates, and the text moves with the data.

I wanted my text to be floating over the data (or more likely, floating 
over an absence of data) centered in the visible plot area, not attached to 
any specific point.

Looking at that example again, I noticed the comment in at the top of the 
file: "For text that can be placed in a layout, use LabelItem". I looked 
through the source code for LabelItem usage examples but I didn't see much.

On Thursday, March 25, 2021 at 10:43:13 AM UTC-4 [email protected] wrote:

> Hi Jeff,
> I think the text item example might fit your needs. 
>
>
> On Thursday, March 25, 2021 at 2:49:30 PM UTC+1 [email protected] 
> wrote:
>
>>
>> I've got what I hope is a simple question here. 
>>
>> Background: I've got a pair of plots, and I can add axis labels using 
>> setLabel() and I can change the plot title using setTitle(). These work 
>> great. 
>>
>> I'd like to do something similar during error conditions and have the 
>> text right in the middle of the plot. Seems like it should be easy enough, 
>> as pyqtgraph is very flexible. I looked through the API and I didn't see 
>> anything quite right though. I don't want to attach it to a point in the 
>> graph, because usually there aren't points when I want to show the error. 
>> Ideally the message would be centered right in the middle of where the data 
>> would normally be displayed.
>>
>> What's the easiest way to accomplish this? 
>>
>> Thanks,
>> Jeff
>>
>

-- 
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/b8feddee-ff70-4181-a14e-c15b15b8b724n%40googlegroups.com.

Reply via email to