1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

PyQtGraphでうんこを描画する方法

Last updated at Posted at 2022-06-12

PyQtGraphでうんこを描画する方法を説明する。

完成イメージ

スクリーンショット 2022-06-12 16.55.08.png

コード

unko.py
import sys
from PyQt6.QtWidgets import QApplication, QWidget
import pyqtgraph as pg


class GuiWindow(QWidget):

    def __init__(self, parent=None):
        super().__init__(parent)
        self.グラフを描画する()

    def グラフを描画する(self):
        self.graph = pg.GraphicsLayoutWidget(show=True)
        self.p = self.graph.addPlot()

        # unko
        self.p.plot(x=[10, 60],
                    y=[10, 10],
                    pen=pg.mkPen((100,53,44), width=150))
        self.p.plot(x=[20, 50],
                    y=[25, 25],
                    pen=pg.mkPen((100,53,44), width=150))
        self.p.plot(x=[30, 40],
                    y=[40, 40],
                    pen=pg.mkPen((100,53,44), width=150))
        self.p.plot(x=[35, 36],
                    y=[55, 55],
                    pen=pg.mkPen((100,53,44), width=100))

        # 枠
        self.p.plot(x=[-10, 100, 100, -10],
                    y=[-10, -10  , 100, 100],
                    pen=pg.mkPen('black', width=5))

if __name__ == '__main__':
    app = QApplication(sys.argv)
    window = GuiWindow()
    sys.exit(app.exec())
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?