- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
如何使 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)
关于python - Pyqtgraph plotwidget : cannot change font weight of axis ticks to BOLD,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62642579/
我正在尝试使用 PyQt 绘图小部件创建实时数据图。我读到 PyQt 是绘制实时图表的最佳选择,但到目前为止我还没有取得任何成功。 我尝试使用方法 followed here 绘制随机数据然而,这种方
我正在尝试构建一个桌面应用程序,该应用程序将在一些流数据到达时绘制图表。我希望能够打开多个窗口来监控不同的流。 在我开始关闭图表窗口之前,它工作得很好。 我遇到的问题是,关闭我的一个图表窗口经常会导致
我正在制作一个时间序列监控程序。 我想从 x 轴范围的一半开始更改绘图的颜色。对于 100 x 20 的绘图小部件,我想将最后 50 个数据点更改为另一种颜色。 每传递 xx 项数据时,如何绘制自定义
这是我的代码: import sys import numpy as np import pyqtgraph as pg from PyQt5.QtWidgets import QApplicatio
我正在尝试将 pyqtgraph 中的自定义 AxisItem 添加到由 Qt Designer 生成的现有 PlotWidget。有相关话题here ,但是没有代码示例的确切答案,我无法发表评论,所
我正在尝试将样式设置为 pyqtgraph.PlotWidget 绘图区域的轴。我正在使用: font = QFont() font.setPointSize(14) font.setBold(Tru
我在使用 PySide 和 Qt Designer 制作的 GUI 方面需要一些帮助。在我的 Gui 代码中,我有 PlotWidget,我想在其中实现 pyqtgraph。 我正在尝试实现的 PyQ
作为问题的延续,我已经解决了 here几天前,我有一个 PyQt4 GUI,它嵌入了两个 PyQtGraph 的 PlotWidgets,每个 PlotWidgets 从一个按钮触发的线程随机附加数组
我在网格中放置了一些小部件。但这些小部件始终存在奇怪的行为。 如果将一个 ImageView 和 PlotWidget 放在附近,ImageView 会收缩,PlotWidged 会拉伸(stretc
我正在尝试制作一个应用程序,我想在其中使用多个 PlotWidgets 来绘制来 self 的 Arduino 中最多 5 个传感器的信号。一旦我有两个更新图,GUI 就没有响应,我需要暂停/重新开始
如何使 x 轴刻度加粗? plot_1 = pg.PlotWidget() plot_1.setBackground('w') pen = pg.mkPen(color="k", width=3, s
我正在尝试在 PyQt5 的 pqytplot plotwidget 中添加光标位置的读数。我发现这段代码可以满足我的要求,但在一个独立的窗口中,所有内容都在一个程序文件中: import pyqtg
我正在尝试使 PlotWidget 移动(从左到右)非常快,就像它是心电图一样。这是我想要的示例(除了他使用 PyQwt(这与我的项目不兼容,因为我使用 PySide(而不是 PyQt),而且我也希望
我是一名优秀的程序员,十分优秀!