2

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)
eyllanesc
  • 235,170
  • 19
  • 170
  • 241
jabbarlee
  • 110
  • 2
  • 11

1 Answers1

2

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)
eyllanesc
  • 235,170
  • 19
  • 170
  • 241