Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/364.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python Pyqtgraph plotwidget:无法将轴刻度的字体重量更改为粗体_Python_Fonts_Pyqtgraph_Xticks - Fatal编程技术网

Python Pyqtgraph plotwidget:无法将轴刻度的字体重量更改为粗体

Python Pyqtgraph plotwidget:无法将轴刻度的字体重量更改为粗体,python,fonts,pyqtgraph,xticks,Python,Fonts,Pyqtgraph,Xticks,如何使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)

如何使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)

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

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

谢谢,它起作用了。虽然我不知道为什么它没有情节线那么大胆,但比以前要好。