Help us understand the problem. What is going on with this article?

PyQtGraphでグラフを描写する その2 - プロットの詳細設定

More than 3 years have passed since last update.

その2 プロットの詳細設定

2.png

import sys
from PySide.QtCore import *
from PySide.QtGui import *
import pyqtgraph as pg


class GraphWindow(QMainWindow):

    def __init__(self, parent = None):

        super(GraphWindow, self).__init__(parent)

        # 1 PlotWidgetを作成する
        pw = pg.PlotWidget()

        # 1 ウィンドウにウィジェットを設定する
        self.setCentralWidget(pw)

        # 1 plotItemを呼び出す
        p1 = pw.plotItem

        # 1 散布図と折れ線グラフを描写する
        ## 2 プロットの詳細を設定する
        p1.addItem(pg.PlotCurveItem(x = [0, 1, 2, 3 ,4], 
                                    y = [0, 1, 2, 3 ,4], 
                                    pen = pg.mkPen(color = "r", style = Qt.SolidLine),
                                    antialias = True))
        p1.addItem(pg.ScatterPlotItem(x = [0, 1, 2, 3 ,4], 
                                      y = [4, 3, 2, 1, 0], 
                                      symbol = "x", 
                                      pen = pg.mkPen(None), 
                                      brush = pg.mkBrush("b"),
                                      size = 7.5,
                                      antialias = True))


if __name__ == '__main__':
    # Qt Applicationを作ります
    app = QApplication(sys.argv)
    # formを作成して表示します
    mainWin = GraphWindow()
    mainWin.show()
    # Qtのメインループを開始します
    sys.exit(app.exec_())
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away