Plots¶
Contents
Plots¶
Summary
A rich plot widget. |
|
The position of a selected |
|
Container for axis configuration properties. |
- class dearpygui_obj.plots.Plot(**config)[source]¶
Bases:
dearpygui_obj.wrapper.widget.Widget,dearpygui_obj.wrapper.widget.ItemWidgetMxA rich plot widget.
- xaxis: PlotXAxisConfig¶
The X-axis
- yaxis: PlotYAxisConfig¶
The Y-axis
- y2axis: PlotOptYAxisConfig¶
Optional Y-axis 2
- y3axis: PlotOptYAxisConfig¶
Optional Y-axis 3
Read or modify the ‘no_menus’ config property.
- add_dataseries(series: DataSeries, *, update_bounds: bool = True) None[source]¶
Add a
DataSeriesto this plot (or update it).Updates the data series if it has already been added.
- remove_dataseries(series: DataSeries) None[source]¶
Remove a
DataSeriesfrom this plot if it has been added.
- set_xlimits(limits: Optional[PlotLimits]) None[source]¶
Set the
(min, max)limits for the x-axis, or passNoneto use automatic limits.
- set_ylimits(limits: Optional[PlotLimits]) None[source]¶
Set the
(min, max)limits for the y-axis, or passNoneto use automatic limits.
- set_xticks(ticks: Optional[Iterable[TickLabel]]) None[source]¶
Set the tick labels for the x-axis, or pass
Noneto use automatic ticks.
- set_yticks(ticks: Optional[Iterable[TickLabel]]) None[source]¶
Set the tick labels for the y-axis, or pass
Noneto use automatic ticks.
- add_annotation(text: str, pos: Tuple[float, float], offset: Tuple[float, float], *, color: ColorRGBA = None, clamped: bool = True) PlotAnnotation[source]¶
Creates a
PlotAnnotationand adds it to the plot.
- get_mouse_pos() Optional[Tuple[float, float]][source]¶
Returns the
(x, y)mouse position in the plot if it is hovered, orNone.
- get_selected_query_area() Optional[PlotQueryArea][source]¶
Returns a
PlotQueryAreafor the selected query area if there is one.A query area can be selected by the user by holding control and right-click dragging in a plot. If a query area has not been selected, this will return
None.
- class dearpygui_obj.plots.PlotQueryArea(x_min: float, x_max: float, y_min: float, y_max: float)[source]¶
Bases:
tupleThe position of a selected
Plotquery area.- property min_corner: Tuple[float, float]¶
Returns
(x_min, y_min)as a tuple.
- property max_corner: Tuple[float, float]¶
Returns
(x_max, y_max)as a tuple.
Axis Configuration¶
- class dearpygui_obj.plots.PlotAxisConfig(plot: dearpygui_obj.plots.Plot, axis: dearpygui_obj.plots.PlotAxis)[source]¶
Bases:
objectContainer for axis configuration properties.
This class can be used to modify the configuration of a single axis of a
Plot.
- class dearpygui_obj.plots.PlotXAxisConfig(plot: dearpygui_obj.plots.Plot, axis: dearpygui_obj.plots.PlotAxis)[source]¶
Bases:
dearpygui_obj.plots.PlotAxisConfigConfiguration container for plot X-axis.
- axis: dearpygui_obj.plots.PlotXAxis¶
- class dearpygui_obj.plots.PlotYAxisConfig(plot: dearpygui_obj.plots.Plot, axis: dearpygui_obj.plots.PlotAxis)[source]¶
Bases:
dearpygui_obj.plots.PlotAxisConfigConfiguration container for plot Y-axis.
- axis: dearpygui_obj.plots.PlotYAxis¶
- class dearpygui_obj.plots.PlotOptYAxisConfig(plot: dearpygui_obj.plots.Plot, axis: dearpygui_obj.plots.PlotAxis)[source]¶
Bases:
dearpygui_obj.plots.PlotYAxisConfigConfiguration container for optional Y-axes.
This class is similar to
PlotYAxisConfig. It provides theenabledproperty which can be used to enable or disable the optional Y-axes.- axis: dearpygui_obj.plots.PlotYAxis¶
- property enabled: bool¶
Enable or disable the optional Y-axis.
Plot Markup¶
Summary
Adds a plot annotation. |
|
Adds a point with text on a plot. |
PlotAnnotation¶
- class dearpygui_obj.plots.PlotAnnotation(plot: Plot, text: str, pos: Tuple[float, float], offset: Tuple[float, float], *, color: ColorRGBA = None, clamped: bool = True)[source]¶
Bases:
objectAdds a plot annotation.
Note
DPG does not support modifying existing plot annoations (other than to delete). Any methods provided that “mutate” the annotation actually delete and re-create the annotation in DPG.
- property is_valid: bool¶
Falseif the annotation has been deleted.
- property id: str¶
- property plot: dearpygui_obj.plots.Plot¶
- property text: str¶
- property color: dearpygui_obj.data.ColorRGBA¶
If
None, then the annotation will have no callout bubble.
- property clamped: bool¶
If
True, the label will be free to shift so that it is not clipped by the plot limits.
- property x: float¶
- property y: float¶
- property offset: Tuple[float, float]¶
PlotText¶
- class dearpygui_obj.plots.PlotText(label: str, pos: Tuple[float, float], *, vertical: bool = False, offset: Tuple[int, int] = (0, 0), axis: YAxis = <dearpygui_obj.plots.PlotYAxis object>)[source]¶
Bases:
objectAdds a point with text on a plot.
Due to the limitations of DPG the each PlotText instance must have a unique label within each plot that it is added to.
- property id: str¶
- property axis: dearpygui_obj.plots.PlotYAxis¶
Set the Y-axis used to display the data series.
- update(plot: dearpygui_obj.plots.Plot, update_bounds: bool = True) None[source]¶
Data Series¶
Summary
Abstract base class for plot data series. |
|
Descriptor used to get/set non-data config properties for |
|
Collection type that allows set/get of individual data fields of a data series. |
|
Adds an area series to a plot. |
|
Adds a bar series to a plot. |
|
Adds a candle series to a plot. |
|
Adds an error series to a plot. |
|
Adds a heat series to a plot. |
|
Adds an infinite horizontal line series to a plot. |
|
Adds an infinite vertical line series to a plot. |
|
Adds a line series to a plot. |
|
Adds a pie chart to a plot. |
|
Adds a scatter series to a plot. |
|
Adds a single-sided shade series to a plot. |
|
Adds a single-sided shade series to a plot. |
|
Add a stair series to a plot. |
|
Add a stem series to a plot. |
Base Class¶
- class dearpygui_obj.wrapper.dataseries.DataSeries(label: str, data: Iterable, *, axis: YAxis = <dearpygui_obj.plots.PlotYAxis object>, **config: Any)[source]¶
Bases:
abc.ABC,MutableSequence[dearpygui_obj.wrapper.dataseries.TRecord]Abstract base class for plot data series.
- property id: str¶
- property axis: PlotYAxis¶
Set the Y-axis used to display the data series.
- update(plot: dearpygui_obj.plots.Plot, update_bounds: bool = True) None[source]¶
Updates a plot with this DataSeries.
If this DataSeries has not been added to the plot before, this method will add it.
Any changes made to a DataSeries’s properties will only take effect when this method is called.
- Parameters
plot – the
Plotto update.update_bounds – also update plot bounds if
True.
- __getitem__(index: int) dearpygui_obj.wrapper.dataseries.TRecord[source]¶
- __getitem__(index: slice) Iterable[TRecord]
Get data from the dataseries using an index or slice.
- __setitem__(index: int, item: dearpygui_obj.wrapper.dataseries.TRecord) None[source]¶
- __setitem__(index: slice, item: Iterable[TRecord]) None
Modify the data series using an index or slice.
- extend(items: Iterable[Any]) None[source]¶
S.extend(iterable) – extend sequence by appending elements from the iterable
- index(value[, start[, stop]]) integer – return first index of value.[source]¶
Raises ValueError if the value is not present.
Supporting start and stop arguments is optional, but recommended.
- class dearpygui_obj.wrapper.dataseries.DataSeriesConfig(key: Optional[str] = None)[source]¶
Bases:
objectDescriptor used to get/set non-data config properties for
DataSeriesobjects.
- class dearpygui_obj.wrapper.dataseries.DataSeriesCollection(series: dearpygui_obj.wrapper.dataseries.DataSeries, key: int)[source]¶
Bases:
MutableSequence[dearpygui_obj.wrapper.dataseries.TValue]Collection type that allows set/get of individual data fields of a data series.
Individual data fields are read-write. Appending, inserting, or deleting individual fields is not permitted however. Any operations that change the length of the sequence will raise a
TypeError.- __getitem__(index: int) dearpygui_obj.wrapper.dataseries.TValue[source]¶
- __getitem__(index: slice) Iterable[TValue]
Get values for a particular data field using index or slice.
Area Series¶
- class dearpygui_obj.plots.dataseries.AreaSeries(label: str, data: Iterable[Any], color: ColorRGBA, fill: ColorRGBA, **config: Any)[source]¶
Bases:
dearpygui_obj.wrapper.dataseries.DataSeries[dearpygui_obj.plots.dataseries.XYData]Adds an area series to a plot.
- color: ColorRGBA¶
- fill: ColorRGBA¶
Bar Series¶
- class dearpygui_obj.plots.dataseries.BarSeries(label: str, data: Iterable[Any], **config: Any)[source]¶
Bases:
dearpygui_obj.wrapper.dataseries.DataSeries[dearpygui_obj.plots.dataseries.XYData]Adds a bar series to a plot.
Candle Series¶
- class dearpygui_obj.plots.dataseries.CandleSeries(label: str, data: Iterable[Any], **config: Any)[source]¶
Bases:
dearpygui_obj.wrapper.dataseries.DataSeries[dearpygui_obj.plots.dataseries.CandleSeriesData]Adds a candle series to a plot.
- bull_color: ColorRGBA¶
- bear_color: ColorRGBA¶
Error Series¶
- class dearpygui_obj.plots.dataseries.ErrorSeries(label: str, data: Iterable[Any], **config: Any)[source]¶
Bases:
dearpygui_obj.wrapper.dataseries.DataSeries[dearpygui_obj.plots.dataseries.ErrorSeriesData]Adds an error series to a plot.
Heat Series¶
Infinite Line Series¶
- class dearpygui_obj.plots.dataseries.HLineSeries(label: str, x: Iterable[float], **config: Any)[source]¶
Bases:
dearpygui_obj.wrapper.dataseries.DataSeries[tuple]Adds an infinite horizontal line series to a plot.
- color: ColorRGBA¶
Line Series¶
- class dearpygui_obj.plots.dataseries.LineSeries(label: str, data: Iterable[Any], **config: Any)[source]¶
Bases:
dearpygui_obj.wrapper.dataseries.DataSeries[dearpygui_obj.plots.dataseries.XYData]Adds a line series to a plot.
- color: ColorRGBA¶
Pie Series¶
- class dearpygui_obj.plots.dataseries.PieSeriesData(value: float, label: str)[source]¶
Bases:
tupleData record type for
PieSeries.
- class dearpygui_obj.plots.dataseries.PieSeries(label: str, data: Iterable[Any], x: float, y: float, radius: float, **config: Any)[source]¶
Bases:
dearpygui_obj.wrapper.dataseries.DataSeries[dearpygui_obj.plots.dataseries.PieSeriesData]Adds a pie chart to a plot.
Scatter Series¶
- class dearpygui_obj.plots.dataseries.ScatterSeries(label: str, data: Iterable[Any], **config: Any)[source]¶
Bases:
dearpygui_obj.wrapper.dataseries.DataSeries[dearpygui_obj.plots.dataseries.XYData]Adds a scatter series to a plot.
- marker: PlotMarker¶
- outline: ColorRGBA¶
- fill: ColorRGBA¶
Shade Series¶
- class dearpygui_obj.plots.dataseries.ShadeSeries(label: str, data: Iterable[Any], **config: Any)[source]¶
Bases:
dearpygui_obj.wrapper.dataseries.DataSeries[dearpygui_obj.plots.dataseries.XYData]Adds a single-sided shade series to a plot.
- color: ColorRGBA¶
- fill: ColorRGBA¶
- class dearpygui_obj.plots.dataseries.ShadeRangeSeries(label: str, data: Iterable[Any], **config: Any)[source]¶
Bases:
dearpygui_obj.wrapper.dataseries.DataSeries[dearpygui_obj.plots.dataseries.ShadeRangeData]Adds a single-sided shade series to a plot.
- color: ColorRGBA¶
- fill: ColorRGBA¶
Stair Series¶
- class dearpygui_obj.plots.dataseries.StairSeries(label: str, data: Iterable[Any], **config: Any)[source]¶
Bases:
dearpygui_obj.wrapper.dataseries.DataSeries[dearpygui_obj.plots.dataseries.XYData]Add a stair series to a plot.
- color: ColorRGBA¶
Stem Series¶
- class dearpygui_obj.plots.dataseries.StemSeries(label: str, data: Iterable[Any], **config: Any)[source]¶
Bases:
dearpygui_obj.wrapper.dataseries.DataSeries[dearpygui_obj.plots.dataseries.XYData]Add a stem series to a plot.
- marker: PlotMarker¶
- outline: ColorRGBA¶
- fill: ColorRGBA¶