TextItem

class pyqtgraph.TextItem(text='', color=(200, 200, 200), html=None, anchor=(0, 0), border=None, fill=None, angle=0)[source]

GraphicsItem displaying unscaled text (the text will always appear normal even inside a scaled ViewBox).

__init__(text='', color=(200, 200, 200), html=None, anchor=(0, 0), border=None, fill=None, angle=0)[source]
Arguments:  
text The text to display
color The color of the text (any format accepted by pg.mkColor)
html If specified, this overrides both text and color
anchor A QPointF or (x,y) sequence indicating what region of the text box will be anchored to the item’s position. A value of (0,0) sets the upper-left corner of the text box to be at the position specified by setPos(), while a value of (1,1) sets the lower-right corner.
border A pen to use when drawing the border
fill A brush to use when filling within the border
setFont(*args)[source]

Set the font for this text.

See QtGui.QGraphicsTextItem.setFont().

setHtml(*args)[source]

Set the HTML code to be rendered by this item.

See QtGui.QGraphicsTextItem.setHtml().

setPlainText(*args)[source]

Set the plain text to be rendered by this item.

See QtGui.QGraphicsTextItem.setPlainText().

setText(text, color=(200, 200, 200))[source]

Set the text and color of this item.

This method sets the plain text of the item; see also setHtml().

setTextWidth(*args)[source]

Set the width of the text.

If the text requires more space than the width limit, then it will be wrapped into multiple lines.

See QtGui.QGraphicsTextItem.setTextWidth().