【问题标题】:pyqtgraph custom grid [Python/Qt]pyqtgraph 自定义网格 [Python/Qt]
【发布时间】:2019-08-01 15:01:24
【问题描述】:

我正在尝试使我的绘图包含一个具有特定功能的网格,例如网格线分隔,但我不确定 pyqtgraph 是否允许它。有谁知道如何做到这一点?

【问题讨论】:

    标签: python-3.x pyqt pyqtgraph


    【解决方案1】:

    pyqtgraph 中的 PlotItem 类包含一个 showGrid 函数。例如:

    plot_example = pyqtgraph.plot(x_values, y_values)
    plot_example.showGrid(True, True, 0.5)
    

    默认情况下,showGrid(x=None, y=None, alpha=None)。第一个参数指定是否显示 x 网格,第二个参数指定是否显示 y 网格,alpha 为网格提供可变的不透明度。

    更多信息可以在这里找到:http://www.pyqtgraph.org/documentation/_modules/pyqtgraph/graphicsItems/PlotItem/PlotItem.html#PlotItem.showGrid

    【讨论】:

      猜你喜欢
      • 2017-02-03
      • 2013-02-07
      • 2018-09-12
      • 1970-01-01
      • 1970-01-01
      • 2014-06-15
      • 2018-06-11
      • 1970-01-01
      • 2018-07-23
      相关资源
      最近更新 更多