From 392c3c6c17ad92bd552473b1e15a5dbc1dd4333e Mon Sep 17 00:00:00 2001 From: Luke Campagnola Date: Sun, 14 Feb 2016 23:15:39 -0800 Subject: [PATCH] Added symbol example to menu; minor cleanups to symbol example. --- examples/Symbols.py | 9 ++++++--- examples/utils.py | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/examples/Symbols.py b/examples/Symbols.py index 2cbd60f7..3dd28e13 100755 --- a/examples/Symbols.py +++ b/examples/Symbols.py @@ -1,7 +1,9 @@ # -*- coding: utf-8 -*- """ -This example shows all the symbols available into pyqtgraph. -New in version 0.9.11 +This example shows all the scatter plot symbols available in pyqtgraph. + +These symbols are used to mark point locations for scatter plots and some line +plots, similar to "markers" in matplotlib and vispy. """ import initExample ## Add path to library (just for examples; you do not need this) @@ -9,7 +11,7 @@ from pyqtgraph.Qt import QtGui, QtCore import pyqtgraph as pg app = QtGui.QApplication([]) -win = pg.GraphicsWindow(title="Pyqtgraph symbols") +win = pg.GraphicsWindow(title="Scatter Plot Symbols") win.resize(1000,600) pg.setConfigOptions(antialias=True) @@ -27,6 +29,7 @@ plot.plot([7, 8, 9, 10, 11], pen=(217,83,25), symbolBrush=(217,83,25), symbolPen plot.plot([8, 9, 10, 11, 12], pen=(237,177,32), symbolBrush=(237,177,32), symbolPen='w', symbol='star', symbolSize=14, name="symbol='star'") plot.plot([9, 10, 11, 12, 13], pen=(126,47,142), symbolBrush=(126,47,142), symbolPen='w', symbol='+', symbolSize=14, name="symbol='+'") plot.plot([10, 11, 12, 13, 14], pen=(119,172,48), symbolBrush=(119,172,48), symbolPen='w', symbol='d', symbolSize=14, name="symbol='d'") +plot.setXRange(-2, 4) ## Start Qt event loop unless running in interactive mode or using pyside. if __name__ == '__main__': diff --git a/examples/utils.py b/examples/utils.py index 3ff265c4..cbdf69c6 100644 --- a/examples/utils.py +++ b/examples/utils.py @@ -22,6 +22,7 @@ examples = OrderedDict([ ('Console', 'ConsoleWidget.py'), ('Histograms', 'histogram.py'), ('Beeswarm plot', 'beeswarm.py'), + ('Symbols', 'Symbols.py'), ('Auto-range', 'PlotAutoRange.py'), ('Remote Plotting', 'RemoteSpeedTest.py'), ('Scrolling plots', 'scrollingPlots.py'),