pyqtgraph/examples
Carlos Pascual 23a46b5fb9
Add "left" and "right" step Modes (#1360)
* Add "lstep" and "rstep" step Modes

stepMode is currently either True or False. If it is True,
it requires the user to make len(x) = len(y)+1. This is
inconvenient because it makes it difficult to change the
stepMode on a given curve (just as one would change, e.g.,
its color).

This commit extends the current situation by introducing
two more step modes: "lstep" and "rstep", which do not require
passing an extra x value. In turn, this modes associate each
y value to either the left or the right boundary of the step.

For example, the "rstep" mode is handy when plotting "life"
digital signals in which x,y data pairs are appended as they
are read.

This commit does not modify the behaviour in case of stepMode=True

* Replace step mode names: lstep,rstep -> left,right

* Improve docs for stepMode

Reword docstring and add it to PlotDataItem class too

* Document left and right stepModes as added in v 0.12.0

TODO: confirm the exact version number to use here

* Add comments stress the need for "is True"

Some conditional statements in the code regarding stepMode are
done with "is True". This is actually required since other
possible values such as "left" also evaluate as true but should
not be caught.

* Deprecate boolean API for stepMode

Introduce stepMode="mid" as a replacement of stepMode=True,
but keeping full backwards compatibility with the old API.
Adapt docs, examples and tests accordingly.

* Raise ValueError on unsupported stepMode values

* Rename "mid" step mode to "center"

* Remove "added in 0.12.0" note

See https://github.com/pyqtgraph/pyqtgraph/pull/1360#discussion_r502746919

* Add deprecation warning when stepMode=True

Issue a DeprecationWarning if stepMode=True is being passed to the
constructor or setData() of PlotDataItem or PlotCurveItem.

Note: warnings module is imported locally so that it is esier to
remove once this check is no longer needed.

* Fix wrong syntax in last commit

Fix usage of "default" kwarg in dict.get()
2020-10-13 08:52:07 -07:00
..
cx_freeze Added cx_freeze example (thanks Jerry!) 2014-06-06 15:53:17 -06:00
optics workaround pyside bug #671 2018-05-23 21:12:16 -07:00
py2exe Fix: avoid importing py3 module from pyqt when using py2 2014-04-03 13:33:16 -04:00
relativity Fix QString handling 2018-06-22 17:31:58 -07:00
verlet_chain Fix verlet integration demo 2017-10-18 00:18:46 -07:00
__init__.py fixed import statements python3 compatibility 2013-04-29 08:13:28 -04:00
__main__.py Intercept light/dark modes transitions on MacOS. 2020-03-08 10:34:54 +01:00
Arrow.py Implement headWidth parameter for arrows (#385) 2020-06-09 22:04:29 -07:00
BarGraphItem.py Added BarGraphItem.shape() to allow better mouse interaction 2014-02-09 10:38:29 -05:00
beeswarm.py merged many changes from acq4 2013-03-26 13:46:26 -04:00
CLIexample.py python3 fixes 2013-02-24 23:09:03 -05:00
ColorButton.py python3 fixes 2013-02-24 23:09:03 -05:00
ConsoleWidget.py python3 fixes 2013-02-24 23:09:03 -05:00
contextMenu.py Replace deprecate class in examples 2018-02-16 12:21:39 +08:00
crosshair.py Replace deprecate class in examples 2018-02-16 12:21:39 +08:00
customGraphicsItem.py python3 fixes 2013-02-24 23:09:03 -05:00
CustomGraphItem.py Replace deprecate class in examples 2018-02-16 12:21:39 +08:00
customPlot.py Date axis item (#1154) 2020-04-27 11:43:22 -07:00
DataSlicing.py Added pg.gaussianFilter, removed all dependency on gaussian_filter 2014-03-11 19:01:34 -04:00
DataTreeWidget.py Cleanup, better support for tracebacks in DataTreeWidget 2014-09-25 15:21:28 -04:00
DateAxisItem_QtDesigner.py Date axis item (#1154) 2020-04-27 11:43:22 -07:00
DateAxisItem_QtDesigner.ui Date axis item (#1154) 2020-04-27 11:43:22 -07:00
DateAxisItem.py Date axis item (#1154) 2020-04-27 11:43:22 -07:00
designerExample_pyside2.py Fix up Qt.py and deprecate USE_XX variables 2018-02-16 20:42:34 -08:00
designerExample.py Added Qt.loadUiType function for PySide 2013-12-17 21:23:37 -05:00
designerExample.ui Patch/window handling (#468) 2020-06-01 11:23:18 -07:00
DiffTreeWidget.py Added DiffTreeWidget 2014-09-25 17:26:06 -04:00
dockarea.py minor cleanups 2014-05-08 09:50:26 -04:00
Draw.py python3 fixes 2013-02-24 23:09:03 -05:00
ErrorBarItem.py Add ErrorBarItem.setData 2014-06-27 10:55:55 -04:00
exampleLoaderTemplate_pyqt5.py Patch/window handling (#468) 2020-06-01 11:23:18 -07:00
exampleLoaderTemplate_pyqt.py Patch/window handling (#468) 2020-06-01 11:23:18 -07:00
exampleLoaderTemplate_pyside2.py Fix up Qt.py and deprecate USE_XX variables 2018-02-16 20:42:34 -08:00
exampleLoaderTemplate_pyside.py Patch/window handling (#468) 2020-06-01 11:23:18 -07:00
exampleLoaderTemplate.ui Patch/window handling (#468) 2020-06-01 11:23:18 -07:00
FillBetweenItem.py Fix some bugs in PyQt5 2015-01-17 00:21:33 +08:00
Flowchart.py Clean up examples / docs 2016-08-31 15:14:25 -07:00
FlowchartCustomNode.py Fix opt name for SpinBox: range -> bounds. 2016-04-11 21:05:21 -07:00
fractal.py add reduce import to fractal demo 2018-03-29 08:49:42 -07:00
GLBarGraphItem.py Added GLBarGraphItem example 2013-09-06 15:36:36 -04:00
GLImageItem.py examples: use integer division in indexing 2018-03-30 14:51:29 -04:00
GLIsosurface.py python3 fixes 2013-02-24 23:09:03 -05:00
GLLinePlotItem.py Fixed GLLinePlotItem line width option 2013-03-30 22:39:11 -04:00
GLMeshItem.py Allow GLMeshItem to draw edges from MeshData with face-indexed vertexes. 2014-03-10 23:04:10 -04:00
GLScatterPlotItem.py python3 fixes 2013-02-24 23:09:03 -05:00
GLshaders.py python3 fixes 2013-02-24 23:09:03 -05:00
GLSurfacePlot.py Added pg.gaussianFilter, removed all dependency on gaussian_filter 2014-03-11 19:01:34 -04:00
GLViewWidget.py python3 fixes 2013-02-24 23:09:03 -05:00
GLVolumeItem.py python3 fixes 2013-02-24 23:09:03 -05:00
GradientEditor.py - Major reorganization; we now follow the standard python package structure. 2012-12-26 17:51:52 -05:00
GradientWidget.py Fix some bugs in PyQt5 2015-01-17 00:21:33 +08:00
GraphicsLayout.py python3 fixes 2013-02-24 23:09:03 -05:00
GraphicsScene.py - Major reorganization; we now follow the standard python package structure. 2012-12-26 17:51:52 -05:00
GraphItem.py Replace deprecate class in examples 2018-02-16 12:21:39 +08:00
hdf5.py Import from python2_3 for all uses of basestring, cmp, and xrange 2015-05-19 09:29:55 -04:00
histogram.py Add "left" and "right" step Modes (#1360) 2020-10-13 08:52:07 -07:00
HistogramLUT.py Update histogramlut example to allow rgb mode 2017-09-26 08:50:31 -07:00
imageAnalysis.py Add image hover callback to imageAnalysis example 2018-07-07 00:10:15 -07:00
ImageItem.py python3 fixes 2013-02-24 23:09:03 -05:00
ImageView.py Clean up examples / docs 2016-08-31 15:14:25 -07:00
infiniteline_performance.py infinite line performance improvement 2016-02-04 03:28:59 +01:00
InfiniteLine.py Replace deprecate class in examples 2018-02-16 12:21:39 +08:00
initExample.py Fix up Qt.py and deprecate USE_XX variables 2018-02-16 20:42:34 -08:00
isocurve.py examples: use integer division in indexing 2018-03-30 14:51:29 -04:00
JoystickButton.py python3 fixes 2013-02-24 23:09:03 -05:00
Legend.py NEW options for LegendItem (#395) 2020-06-12 22:40:20 -07:00
linkedViews.py Replace deprecate class in examples 2018-02-16 12:21:39 +08:00
logAxis.py Replace deprecate class in examples 2018-02-16 12:21:39 +08:00
LogPlotTest.py Replace deprecate class in examples 2018-02-16 12:21:39 +08:00
MouseSelection.py Corrected mouse clicking on PlotCurveItem - now uses stroke outline instead of path shape 2013-12-19 09:56:58 -05:00
MultiplePlotAxes.py AxisItem bugfix: corrected x-linked view update behavior 2013-03-19 11:49:10 -04:00
multiplePlotSpeedTest.py Import from python2_3 for all uses of basestring, cmp, and xrange 2015-05-19 09:29:55 -04:00
MultiPlotSpeedTest.py Refactor MultiPlotSpeedTest.py 2018-02-03 11:01:03 +08:00
MultiPlotWidget.py Enhancement: [Issue/812]: just pass plotArgs keyword arguments 2020-07-19 19:16:07 +02:00
multiprocess.py Fixed print statements for python 3 2013-01-12 14:35:32 -05:00
optics_demos.py Replace deprecate class in examples 2018-02-16 12:21:39 +08:00
PanningPlot.py Replace deprecate class in examples 2018-02-16 12:21:39 +08:00
parallelize.py Import from python2_3 for all uses of basestring, cmp, and xrange 2015-05-19 09:29:55 -04:00
parametertree.py Added context menu option to paramtree 2020-05-22 16:05:52 +02:00
PColorMeshItem.py Solve artifacts issues 2020-10-12 12:45:13 +02:00
PlotAutoRange.py Replace deprecate class in examples 2018-02-16 12:21:39 +08:00
PlotSpeedTest.py python3 fixes 2013-02-24 23:09:03 -05:00
Plotting.py Replace deprecate class in examples 2018-02-16 12:21:39 +08:00
PlotWidget.py Add warning about PySide 5.14, avoid a confusing error message that would appear with 5.14 2020-05-29 23:42:35 -07:00
ProgressDialog.py Prevent dialog from moving label/bar widgets on resize when nested 2017-10-04 09:01:51 -07:00
relativity_demo.py Added new demos: 2014-05-22 01:22:12 -04:00
RemoteGraphicsView.py Bugfixes: 2013-11-06 23:14:27 -05:00
RemoteSpeedTest.py python3 fixes 2013-02-24 23:09:03 -05:00
ROIExamples.py minor fixes 2018-06-15 14:18:38 -07:00
ROItypes.py Replaced usage of deprecated ROI classes in example (#946) 2019-06-21 21:19:02 -07:00
ScaleBar.py Replace deprecate class in examples 2018-02-16 12:21:39 +08:00
ScatterPlot.py Peque scatter symbols (#1244) 2020-06-10 23:03:43 -07:00
ScatterPlotSpeedTest.py Fix up Qt.py and deprecate USE_XX variables 2018-02-16 20:42:34 -08:00
ScatterPlotSpeedTestTemplate_pyqt5.py flip template line endings 2018-05-24 08:54:31 -07:00
ScatterPlotSpeedTestTemplate_pyqt.py Patch/window handling (#468) 2020-06-01 11:23:18 -07:00
ScatterPlotSpeedTestTemplate_pyside2.py flip pyside2 template line endings 2018-05-17 09:02:41 -07:00
ScatterPlotSpeedTestTemplate_pyside.py Patch/window handling (#468) 2020-06-01 11:23:18 -07:00
ScatterPlotSpeedTestTemplate.ui Patch/window handling (#468) 2020-06-01 11:23:18 -07:00
ScatterPlotWidget.py Fix py3 string handling in scatterplotwidget example 2018-05-09 10:56:01 -07:00
scrollingPlots.py Replace deprecate class in examples 2018-02-16 12:21:39 +08:00
SimplePlot.py Merge branch 'viewbox_limits' into develop 2014-02-04 20:32:44 -05:00
SpinBox.py Add example and test demonstrating spinbox bug 2018-01-24 09:11:42 -08:00
Symbols.py Peque scatter symbols (#1244) 2020-06-10 23:03:43 -07:00
syntax.py Use raw strings to get rid of DeprecationWarning 2020-09-20 13:59:44 -07:00
TableWidget.py TableWidget updates: 2013-03-06 06:27:24 -05:00
template.py Fix some bugs in PyQt5 2015-01-17 00:21:33 +08:00
test_examples.py Examples Should Be Tested on PySide2 5.14.2.2 2020-06-02 22:44:17 -07:00
text.py Fixed TextItem briefly drawing with incorrect transform. 2016-09-14 18:18:33 -07:00
TreeWidget.py python3 fixes 2013-02-24 23:09:03 -05:00
utils.py Add PColorMeshItem example to the app 2020-07-15 10:30:41 +02:00
verlet_chain_demo.py corrections to manifest 2014-12-23 15:55:52 -05:00
VideoSpeedTest.py Fix UnboundLocalError in VideoSpeedTest. 2019-09-13 01:07:57 -04:00
VideoTemplate_pyqt5.py add missing example template file 2016-11-04 22:47:10 -07:00
VideoTemplate_pyqt.py Fix VideoSpeedTest to disable RawImageGLWidget when openGL is unavailable 2016-10-26 09:26:01 -07:00
VideoTemplate_pyside2.py flip pyside2 template line endings 2018-05-17 09:02:41 -07:00
VideoTemplate_pyside.py Fix VideoSpeedTest to disable RawImageGLWidget when openGL is unavailable 2016-10-26 09:26:01 -07:00
VideoTemplate.ui Fix VideoSpeedTest to disable RawImageGLWidget when openGL is unavailable 2016-10-26 09:26:01 -07:00
ViewBox.py Fix line width in a few examples 2015-02-28 11:26:45 -05:00
ViewBoxFeatures.py Replace deprecate class in examples 2018-02-16 12:21:39 +08:00
ViewLimits.py Removed duplicate limit-setting arguments 2014-01-31 13:04:47 -05:00