Commit 2a13994a authored by tommy3001's avatar tommy3001
Browse files

Bugfix: Malformed tables.

All argument lists with `**Arguments:**`
parent 22797752
......@@ -47,27 +47,27 @@ class ArrowItem(QtGui.QGraphicsPathItem):
Changes the appearance of the arrow.
All arguments are optional:
================= =================================================
**Keyword Arguments:**
angle Orientation of the arrow in degrees. Default is
0; arrow pointing to the left.
headLen Length of the arrow head, from tip to base.
default=20
headWidth Width of the arrow head at its base.
tipAngle Angle of the tip of the arrow in degrees. Smaller
values make a 'sharper' arrow. If tipAngle is
specified, ot overrides headWidth. default=25
baseAngle Angle of the base of the arrow head. Default is
0, which means that the base of the arrow head
is perpendicular to the arrow tail.
tailLen Length of the arrow tail, measured from the base
of the arrow head to the end of the tail. If
this value is None, no tail will be drawn.
default=None
tailWidth Width of the tail. default=3
pen The pen used to draw the outline of the arrow.
brush The brush used to fill the arrow.
================= =================================================
====================== =================================================
**Keyword**
angle Orientation of the arrow in degrees. Default is
0; arrow pointing to the left.
headLen Length of the arrow head, from tip to base.
default=20
headWidth Width of the arrow head at its base.
tipAngle Angle of the tip of the arrow in degrees. Smaller
values make a 'sharper' arrow. If tipAngle is
specified, ot overrides headWidth. default=25
baseAngle Angle of the base of the arrow head. Default is
0, which means that the base of the arrow head
is perpendicular to the arrow tail.
tailLen Length of the arrow tail, measured from the base
of the arrow head to the end of the tail. If
this value is None, no tail will be drawn.
default=None
tailWidth Width of the tail. default=3
pen The pen used to draw the outline of the arrow.
brush The brush used to fill the arrow.
====================== =================================================
"""
self.opts.update(opts)
......
......@@ -156,17 +156,17 @@ class AxisItem(GraphicsWidget):
def setLabel(self, text=None, units=None, unitPrefix=None, **args):
"""Set the text displayed adjacent to the axis.
============= =============================================================
Arguments
text The text (excluding units) to display on the label for this
axis.
units The units for this axis. Units should generally be given
without any scaling prefix (eg, 'V' instead of 'mV'). The
scaling prefix will be automatically prepended based on the
range of data displayed.
**args All extra keyword arguments become CSS style options for
the <span> tag which will surround the axis label and units.
============= =============================================================
============== =============================================================
**Arguments:**
text The text (excluding units) to display on the label for this
axis.
units The units for this axis. Units should generally be given
without any scaling prefix (eg, 'V' instead of 'mV'). The
scaling prefix will be automatically prepended based on the
range of data displayed.
**args All extra keyword arguments become CSS style options for
the <span> tag which will surround the axis label and units.
============== =============================================================
The final text generated for the label will look like::
......
......@@ -35,14 +35,14 @@ class TickSliderItem(GraphicsWidget):
def __init__(self, orientation='bottom', allowAdd=True, **kargs):
"""
============= =================================================================================
============== =================================================================================
**Arguments:**
orientation Set the orientation of the gradient. Options are: 'left', 'right'
'top', and 'bottom'.
allowAdd Specifies whether ticks can be added to the item by the user.
tickPen Default is white. Specifies the color of the outline of the ticks.
Can be any of the valid arguments for :func:`mkPen <pyqtgraph.mkPen>`
============= =================================================================================
orientation Set the orientation of the gradient. Options are: 'left', 'right'
'top', and 'bottom'.
allowAdd Specifies whether ticks can be added to the item by the user.
tickPen Default is white. Specifies the color of the outline of the ticks.
Can be any of the valid arguments for :func:`mkPen <pyqtgraph.mkPen>`
============== =================================================================================
"""
## public
GraphicsWidget.__init__(self)
......@@ -103,13 +103,13 @@ class TickSliderItem(GraphicsWidget):
## public
"""Set the orientation of the TickSliderItem.
============= ===================================================================
============== ===================================================================
**Arguments:**
orientation Options are: 'left', 'right', 'top', 'bottom'
The orientation option specifies which side of the slider the
ticks are on, as well as whether the slider is vertical ('right'
and 'left') or horizontal ('top' and 'bottom').
============= ===================================================================
orientation Options are: 'left', 'right', 'top', 'bottom'
The orientation option specifies which side of the slider the
ticks are on, as well as whether the slider is vertical ('right'
and 'left') or horizontal ('top' and 'bottom').
============== ===================================================================
"""
self.orientation = orientation
self.setMaxDim()
......@@ -136,13 +136,13 @@ class TickSliderItem(GraphicsWidget):
"""
Add a tick to the item.
============= ==================================================================
============== ==================================================================
**Arguments:**
x Position where tick should be added.
color Color of added tick. If color is not specified, the color will be
white.
movable Specifies whether the tick is movable with the mouse.
============= ==================================================================
x Position where tick should be added.
color Color of added tick. If color is not specified, the color will be
white.
movable Specifies whether the tick is movable with the mouse.
============== ==================================================================
"""
if color is None:
......@@ -265,14 +265,14 @@ class TickSliderItem(GraphicsWidget):
def setTickColor(self, tick, color):
"""Set the color of the specified tick.
============= ==================================================================
============== ==================================================================
**Arguments:**
tick Can be either an integer corresponding to the index of the tick
or a Tick object. Ex: if you had a slider with 3 ticks and you
wanted to change the middle tick, the index would be 1.
color The color to make the tick. Can be any argument that is valid for
:func:`mkBrush <pyqtgraph.mkBrush>`
============= ==================================================================
tick Can be either an integer corresponding to the index of the tick
or a Tick object. Ex: if you had a slider with 3 ticks and you
wanted to change the middle tick, the index would be 1.
color The color to make the tick. Can be any argument that is valid for
:func:`mkBrush <pyqtgraph.mkBrush>`
============== ==================================================================
"""
tick = self.getTick(tick)
tick.color = color
......@@ -284,14 +284,14 @@ class TickSliderItem(GraphicsWidget):
"""
Set the position (along the slider) of the tick.
============= ==================================================================
============== ==================================================================
**Arguments:**
tick Can be either an integer corresponding to the index of the tick
or a Tick object. Ex: if you had a slider with 3 ticks and you
wanted to change the middle tick, the index would be 1.
val The desired position of the tick. If val is < 0, position will be
set to 0. If val is > 1, position will be set to 1.
============= ==================================================================
tick Can be either an integer corresponding to the index of the tick
or a Tick object. Ex: if you had a slider with 3 ticks and you
wanted to change the middle tick, the index would be 1.
val The desired position of the tick. If val is < 0, position will be
set to 0. If val is > 1, position will be set to 1.
============== ==================================================================
"""
tick = self.getTick(tick)
val = min(max(0.0, val), 1.0)
......@@ -305,12 +305,12 @@ class TickSliderItem(GraphicsWidget):
## public
"""Return the value (from 0.0 to 1.0) of the specified tick.
============= ==================================================================
============== ==================================================================
**Arguments:**
tick Can be either an integer corresponding to the index of the tick
or a Tick object. Ex: if you had a slider with 3 ticks and you
wanted the value of the middle tick, the index would be 1.
============= ==================================================================
tick Can be either an integer corresponding to the index of the tick
or a Tick object. Ex: if you had a slider with 3 ticks and you
wanted the value of the middle tick, the index would be 1.
============== ==================================================================
"""
tick = self.getTick(tick)
return self.ticks[tick]
......@@ -319,11 +319,11 @@ class TickSliderItem(GraphicsWidget):
## public
"""Return the Tick object at the specified index.
============= ==================================================================
============== ==================================================================
**Arguments:**
tick An integer corresponding to the index of the desired tick. If the
argument is not an integer it will be returned unchanged.
============= ==================================================================
tick An integer corresponding to the index of the desired tick. If the
argument is not an integer it will be returned unchanged.
============== ==================================================================
"""
if type(tick) is int:
tick = self.listTicks()[tick][0]
......@@ -366,14 +366,14 @@ class GradientEditorItem(TickSliderItem):
Create a new GradientEditorItem.
All arguments are passed to :func:`TickSliderItem.__init__ <pyqtgraph.TickSliderItem.__init__>`
============= =================================================================================
=============== =================================================================================
**Arguments:**
orientation Set the orientation of the gradient. Options are: 'left', 'right'
'top', and 'bottom'.
allowAdd Default is True. Specifies whether ticks can be added to the item.
tickPen Default is white. Specifies the color of the outline of the ticks.
Can be any of the valid arguments for :func:`mkPen <pyqtgraph.mkPen>`
============= =================================================================================
orientation Set the orientation of the gradient. Options are: 'left', 'right'
'top', and 'bottom'.
allowAdd Default is True. Specifies whether ticks can be added to the item.
tickPen Default is white. Specifies the color of the outline of the ticks.
Can be any of the valid arguments for :func:`mkPen <pyqtgraph.mkPen>`
=============== =================================================================================
"""
self.currentTick = None
self.currentTickColor = None
......@@ -445,13 +445,13 @@ class GradientEditorItem(TickSliderItem):
"""
Set the orientation of the GradientEditorItem.
============= ===================================================================
============== ===================================================================
**Arguments:**
orientation Options are: 'left', 'right', 'top', 'bottom'
The orientation option specifies which side of the gradient the
ticks are on, as well as whether the gradient is vertical ('right'
and 'left') or horizontal ('top' and 'bottom').
============= ===================================================================
orientation Options are: 'left', 'right', 'top', 'bottom'
The orientation option specifies which side of the gradient the
ticks are on, as well as whether the gradient is vertical ('right'
and 'left') or horizontal ('top' and 'bottom').
============== ===================================================================
"""
TickSliderItem.setOrientation(self, orientation)
self.translate(0, self.rectSize)
......@@ -588,11 +588,11 @@ class GradientEditorItem(TickSliderItem):
"""
Return a color for a given value.
============= ==================================================================
============== ==================================================================
**Arguments:**
x Value (position on gradient) of requested color.
toQColor If true, returns a QColor object, else returns a (r,g,b,a) tuple.
============= ==================================================================
x Value (position on gradient) of requested color.
toQColor If true, returns a QColor object, else returns a (r,g,b,a) tuple.
============== ==================================================================
"""
ticks = self.listTicks()
if x <= ticks[0][1]:
......@@ -648,12 +648,12 @@ class GradientEditorItem(TickSliderItem):
"""
Return an RGB(A) lookup table (ndarray).
============= ============================================================================
============== ============================================================================
**Arguments:**
nPts The number of points in the returned lookup table.
alpha True, False, or None - Specifies whether or not alpha values are included
in the table.If alpha is None, alpha will be automatically determined.
============= ============================================================================
nPts The number of points in the returned lookup table.
alpha True, False, or None - Specifies whether or not alpha values are included
in the table.If alpha is None, alpha will be automatically determined.
============== ============================================================================
"""
if alpha is None:
alpha = self.usesAlpha()
......@@ -702,13 +702,13 @@ class GradientEditorItem(TickSliderItem):
"""
Add a tick to the gradient. Return the tick.
============= ==================================================================
============== ==================================================================
**Arguments:**
x Position where tick should be added.
color Color of added tick. If color is not specified, the color will be
the color of the gradient at the specified position.
movable Specifies whether the tick is movable with the mouse.
============= ==================================================================
x Position where tick should be added.
color Color of added tick. If color is not specified, the color will be
the color of the gradient at the specified position.
movable Specifies whether the tick is movable with the mouse.
============== ==================================================================
"""
......@@ -748,16 +748,16 @@ class GradientEditorItem(TickSliderItem):
"""
Restore the gradient specified in state.
============= ====================================================================
============== ====================================================================
**Arguments:**
state A dictionary with same structure as those returned by
:func:`saveState <pyqtgraph.GradientEditorItem.saveState>`
state A dictionary with same structure as those returned by
:func:`saveState <pyqtgraph.GradientEditorItem.saveState>`
Keys must include:
Keys must include:
- 'mode': hsv or rgb
- 'ticks': a list of tuples (pos, (r,g,b,a))
============= ====================================================================
- 'mode': hsv or rgb
- 'ticks': a list of tuples (pos, (r,g,b,a))
============== ====================================================================
"""
## public
self.setColorMode(state['mode'])
......
......@@ -28,29 +28,29 @@ class GraphItem(GraphicsObject):
"""
Change the data displayed by the graph.
============ =========================================================
Arguments
pos (N,2) array of the positions of each node in the graph.
adj (M,2) array of connection data. Each row contains indexes
of two nodes that are connected.
pen The pen to use when drawing lines between connected
nodes. May be one of:
============== =========================================================
**Arguments:**
pos (N,2) array of the positions of each node in the graph.
adj (M,2) array of connection data. Each row contains indexes
of two nodes that are connected.
pen The pen to use when drawing lines between connected
nodes. May be one of:
* QPen
* a single argument to pass to pg.mkPen
* a record array of length M
with fields (red, green, blue, alpha, width). Note
that using this option may have a significant performance
cost.
* None (to disable connection drawing)
* 'default' to use the default foreground color.
* QPen
* a single argument to pass to pg.mkPen
* a record array of length M
with fields (red, green, blue, alpha, width). Note
that using this option may have a significant performance
cost.
* None (to disable connection drawing)
* 'default' to use the default foreground color.
symbolPen The pen used for drawing nodes.
``**opts`` All other keyword arguments are given to
:func:`ScatterPlotItem.setData() <pyqtgraph.ScatterPlotItem.setData>`
to affect the appearance of nodes (symbol, size, brush,
etc.)
============ =========================================================
symbolPen The pen used for drawing nodes.
``**opts`` All other keyword arguments are given to
:func:`ScatterPlotItem.setData() <pyqtgraph.ScatterPlotItem.setData>`
to affect the appearance of nodes (symbol, size, brush,
etc.)
============== =========================================================
"""
if 'adj' in kwds:
self.adjacency = kwds.pop('adj')
......
......@@ -28,18 +28,18 @@ class InfiniteLine(GraphicsObject):
def __init__(self, pos=None, angle=90, pen=None, movable=False, bounds=None):
"""
============= ==================================================================
============== ==================================================================
**Arguments:**
pos Position of the line. This can be a QPointF or a single value for
vertical/horizontal lines.
angle Angle of line in degrees. 0 is horizontal, 90 is vertical.
pen Pen to use when drawing line. Can be any arguments that are valid
for :func:`mkPen <pyqtgraph.mkPen>`. Default pen is transparent
yellow.
movable If True, the line can be dragged to a new position by the user.
bounds Optional [min, max] bounding values. Bounds are only valid if the
line is vertical or horizontal.
============= ==================================================================
pos Position of the line. This can be a QPointF or a single value for
vertical/horizontal lines.
angle Angle of line in degrees. 0 is horizontal, 90 is vertical.
pen Pen to use when drawing line. Can be any arguments that are valid
for :func:`mkPen <pyqtgraph.mkPen>`. Default pen is transparent
yellow.
movable If True, the line can be dragged to a new position by the user.
bounds Optional [min, max] bounding values. Bounds are only valid if the
line is vertical or horizontal.
============= ==================================================================
"""
GraphicsObject.__init__(self)
......
......@@ -18,14 +18,14 @@ class IsocurveItem(GraphicsObject):
"""
Create a new isocurve item.
============= ===============================================================
============== ===============================================================
**Arguments:**
data A 2-dimensional ndarray. Can be initialized as None, and set
later using :func:`setData <pyqtgraph.IsocurveItem.setData>`
level The cutoff value at which to draw the isocurve.
pen The color of the curve item. Can be anything valid for
:func:`mkPen <pyqtgraph.mkPen>`
============= ===============================================================
data A 2-dimensional ndarray. Can be initialized as None, and set
later using :func:`setData <pyqtgraph.IsocurveItem.setData>`
level The cutoff value at which to draw the isocurve.
pen The color of the curve item. Can be anything valid for
:func:`mkPen <pyqtgraph.mkPen>`
============== ===============================================================
"""
GraphicsObject.__init__(self)
......@@ -45,12 +45,12 @@ class IsocurveItem(GraphicsObject):
"""
Set the data/image to draw isocurves for.
============= ========================================================================
============== ========================================================================
**Arguments:**
data A 2-dimensional ndarray.
level The cutoff value at which to draw the curve. If level is not specified,
the previously set level is used.
============= ========================================================================
data A 2-dimensional ndarray.
level The cutoff value at which to draw the curve. If level is not specified,
the previously set level is used.
============== ========================================================================
"""
if level is None:
level = self.level
......
......@@ -38,7 +38,7 @@ class LabelItem(GraphicsWidget, GraphicsWidgetAnchor):
a CSS style string:
==================== ==============================
**Style Arguments:**
**Style**
color (str) example: 'CCFF00'
size (str) example: '8pt'
bold (bool)
......
......@@ -21,17 +21,17 @@ class LegendItem(GraphicsWidget, GraphicsWidgetAnchor):
"""
def __init__(self, size=None, offset=None):
"""
========== ===============================================================
Arguments
size Specifies the fixed size (width, height) of the legend. If
this argument is omitted, the legend will autimatically resize
to fit its contents.
offset Specifies the offset position relative to the legend's parent.
Positive values offset from the left or top; negative values
offset from the right or bottom. If offset is None, the
legend must be anchored manually by calling anchor() or
positioned by calling setPos().
========== ===============================================================
============== ===============================================================
**Arguments:**
size Specifies the fixed size (width, height) of the legend. If
this argument is omitted, the legend will autimatically resize
to fit its contents.
offset Specifies the offset position relative to the legend's parent.
Positive values offset from the left or top; negative values
offset from the right or bottom. If offset is None, the
legend must be anchored manually by calling anchor() or
positioned by calling setPos().
============== ===============================================================
"""
......@@ -61,14 +61,14 @@ class LegendItem(GraphicsWidget, GraphicsWidgetAnchor):
"""
Add a new entry to the legend.
=========== ========================================================
Arguments
item A PlotDataItem from which the line and point style
of the item will be determined or an instance of
ItemSample (or a subclass), allowing the item display
to be customized.
title The title to display for this item. Simple HTML allowed.
=========== ========================================================
============== ========================================================
**Arguments:**
item A PlotDataItem from which the line and point style
of the item will be determined or an instance of
ItemSample (or a subclass), allowing the item display
to be customized.
title The title to display for this item. Simple HTML allowed.
============== ========================================================
"""
label = LabelItem(name)
if isinstance(item, ItemSample):
......@@ -85,10 +85,10 @@ class LegendItem(GraphicsWidget, GraphicsWidgetAnchor):
"""
Removes one item from the legend.
=========== ========================================================
Arguments
title The title displayed for this item.
=========== ========================================================
============== ========================================================
**Arguments:**
title The title displayed for this item.
============== ========================================================
"""
# Thanks, Ulrich!
# cycle for a match
......
......@@ -30,19 +30,19 @@ class LinearRegionItem(UIGraphicsItem):
def __init__(self, values=[0,1], orientation=None, brush=None, movable=True, bounds=None):
"""Create a new LinearRegionItem.
============= =====================================================================
============== =====================================================================
**Arguments:**
values A list of the positions of the lines in the region. These are not
limits; limits can be set by specifying bounds.
orientation Options are LinearRegionItem.Vertical or LinearRegionItem.Horizontal.
If not specified it will be vertical.
brush Defines the brush that fills the region. Can be any arguments that
are valid for :func:`mkBrush <pyqtgraph.mkBrush>`. Default is
transparent blue.
movable If True, the region and individual lines are movable by the user; if
False, they are static.
bounds Optional [min, max] bounding values for the region
============= =====================================================================
values A list of the positions of the lines in the region. These are not
limits; limits can be set by specifying bounds.
orientation Options are LinearRegionItem.Vertical or LinearRegionItem.Horizontal.
If not specified it will be vertical.
brush Defines the brush that fills the region. Can be any arguments that
are valid for :func:`mkBrush <pyqtgraph.mkBrush>`. Default is
transparent blue.
movable If True, the region and individual lines are movable by the user; if
False, they are static.
bounds Optional [min, max] bounding values for the region
============= =====================================================================
"""
UIGraphicsItem.__init__(self)
......@@ -89,10 +89,10 @@ class LinearRegionItem(UIGraphicsItem):
def setRegion(self, rgn):
"""Set the values for the edges of the region.
============= ==============================================
============= ==============================================
**Arguments:**
rgn A list or tuple of the lower and upper values.
============= ==============================================
rgn A list or tuple of the lower and upper values.
============= ==============================================
"""
if self.lines[0].value() == rgn[0] and self.lines[1].value() == rgn[1]:
return
......
......@@ -291,18 +291,18 @@ class PlotDataItem(GraphicsObject):
Set the downsampling mode of this item. Downsampling reduces the number
of samples drawn to increase performance.
=========== =================================================================
Arguments
ds (int) Reduce visible plot samples by this factor. To disable,
set ds=1.
auto (bool) If True, automatically pick *ds* based on visible range
mode 'subsample': Downsample by taking the first of N samples.
This method is fastest and least accurate.
'mean': Downsample by taking the mean of N samples.
'peak': Downsample by drawing a saw wave that follows the min
and max of the original data. This method produces the best
visual representation of the data but is slower.
=========== =================================================================
============== =================================================================
**Arguments:**
ds (int) Reduce visible plot samples by this factor. To disable,
set ds=1.
auto (bool) If True, automatically pick *ds* based on visible range
mode 'subsample': Downsample by taking the first of N samples.
This method is fastest and least accurate.
'mean': Downsample by taking the mean of N samples.
'peak': Downsample by drawing a saw wave that follows the min
and max of the original data. This method produces the best
visual representation of the data but is slower.
============== =================================================================
"""