1# -*- coding: utf-8 -*-
2"""
3Simple logarithmic plotting test
4"""
5
6import initExample ## Add path to library (just for examples; you do not need this)
7
8
9from pyqtgraph.Qt import QtGui, QtCore
10import numpy as np
11import pyqtgraph as pg
12
13app = pg.mkQApp("Log Plot Example")
14
15win = pg.GraphicsLayoutWidget(show=True, title="Basic plotting examples")
16win.resize(1000,600)
17win.setWindowTitle('pyqtgraph example: LogPlotTest')
18
19
20p5 = win.addPlot(title="Scatter plot, axis labels, log scale")
21x = np.random.normal(size=1000) * 1e-5
22y = x*1000 + 0.005 * np.random.normal(size=1000)
23y -= y.min()-1.0
24mask = x > 1e-15
25x = x[mask]
26y = y[mask]
27p5.plot(x, y, pen=None, symbol='t', symbolPen=None, symbolSize=10, symbolBrush=(100, 100, 255, 50))
28p5.setLabel('left', "Y Axis", units='A')
29p5.setLabel('bottom', "Y Axis", units='s')
30p5.setLogMode(x=True, y=False)
31
32
33if __name__ == '__main__':
34    pg.exec()
35