jabbarlee
jabbarlee

Reputation: 140

Pyqtgraph plotwidget: cannot change font weight of axis ticks to BOLD

How can I make x axis ticks bold?

plot_1 = pg.PlotWidget()
plot_1.setBackground('w')
pen = pg.mkPen(color="k", width=3, style=QtCore.Qt.SolidLine)

plot_1 .setTitle("Title", color="k", size="18pt")
plot_1 .plot(xvals, yvals, pen=pen)
styles = {'color': 'r', 'font-size': '12px', 'font-weight': 'bold'}
plot_1 .setLabel('bottom', 'X label', **styles)

Upvotes: 2

Views: 976

Answers (1)

eyllanesc
eyllanesc

Reputation: 243937

You have to use the setTickFont() method to set the font to the axis:

fn = QtGui.QFont()
# fn.setPointSize(20)
fn.setBold(True)
plot_1.getAxis("bottom").setTickFont(fn)

Upvotes: 2

Related Questions