Groups
Groups
Sign in
Groups
Groups
pyqtgraph
Conversations
About
Send feedback
Help
How to change the text style of axis labels and titles
57 views
Skip to first unread message
JJ
unread,
Aug 5, 2021, 8:55:26 AM
8/5/21
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to pyqtgraph
Is there any workaround to support this? I can set the tick font as follows:
plot_item = plotwidget1.getPlotItem()
axis = plot_item.getAxis('bottom')
font = QFont("Roboto")
axis.setTickFont(font)
However, there is no function to support the font style of the actual axis label.
plot_item.setLabel('bottom', 'time') #how to change the font?
Patrick
unread,
Aug 5, 2021, 10:43:22 PM
8/5/21
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to pyqtgraph
Hi,
I think Google Groups lost my reply to this... apologies if double posting. Try getting the label property of the axis and using setFont() on that.
#...
font =
self
.plot.getAxis(
"left"
).label.font()
font.setFamily(
"Serif"
)
self
.plot.getAxis(
"left"
).label.setFont(font)
self
.plot.getAxis(
"left"
).setTickFont(font)
#...
Patrick
Reply all
Reply to author
Forward
0 new messages