Hi,
I don't know if this is the best way to do it, but something like this
works for axis labels:
self.plot = self.addPlot()
self.plot.setLabels(left="Left axis")
font = self.plot.getAxis("left").label.font()
font.setFamily("Serif")
self.plot.getAxis("left").label.setFont(font)
self.plot.getAxis("left").setTickFont(font)
For other items, you may need to do something similar, but look at the code
to see what the QtGui.QGraphicsTextItem is called. For example, for a
TextItem
(http://www.pyqtgraph.org/documentation/_modules/pyqtgraph/graphicsItems/TextItem.html#TextItem)
you would use t.textItem.font() and t.textItem.setFont().
Patrick
On Tuesday, 12 February 2019 01:54:50 UTC+10:30, ip138 wrote:
>
> Hi,
> I'm currently trying to change the font-family of pyqtgraph. I
> successfully changed font-size or font-color of the graphs, but how can I
> change the font-family?
> Thank you for your help!
>
--
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/ca1f1b51-aeb9-459c-9fef-8db9491f1e6a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.