File: plotTest.py

package info (click to toggle)
python-pyqtgraph 0.13.7-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 8,068 kB
  • sloc: python: 54,043; makefile: 129; ansic: 40; sh: 2
file content (20 lines) | stat: -rw-r--r-- 613 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import sys

import pyqtgraph as pg
from pyqtgraph.Qt import QtWidgets

# For packages that require scipy, these may be needed: 
#   from scipy.stats import futil
#   from scipy.sparse.csgraph import _validation

pg.setConfigOption('background','w')
pg.setConfigOption('foreground','k')
app = QtWidgets.QApplication(sys.argv)

pw = pg.plot(x = [0, 1, 2, 4], y = [4, 5, 9, 6])
pw.showGrid(x=True,y=True)
text = pg.TextItem(html='<div style="text-align: center"><span style="color: #000000;"> %s</span></div>' % "here",anchor=(0.0, 0.0)) 
text.setPos(1.0, 5.0)
pw.addItem(text)
status = app.exec_()
sys.exit(status)