2

如何使 x 轴刻度加粗?

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)
4

1 回答 1

2

您必须使用该setTickFont()方法将字体设置为轴:

fn = QtGui.QFont()
# fn.setPointSize(20)
fn.setBold(True)
plot_1.getAxis("bottom").setTickFont(fn)
于 2020-06-30T02:22:00.170 回答