Plots

Plots

Summary

Plot

A rich plot widget.

PlotQueryArea

The position of a selected Plot query area.

PlotAxisConfig

Container for axis configuration properties.

class dearpygui_obj.plots.Plot(**config)[source]

Bases: dearpygui_obj.wrapper.widget.Widget, dearpygui_obj.wrapper.widget.ItemWidgetMx

A 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

label: str

Read or modify the ‘label’ config property.

x_axis_label: str

Read or modify the ‘x_axis_name’ config property.

y_axis_label: str

Read or modify the ‘y_axis_name’ config property.

show_annotations: bool

Read or modify the ‘show_annotations’ config property.

show_drag_lines: bool

Read or modify the ‘show_drag_lines’ config property.

show_drag_points: bool

Read or modify the ‘show_drag_points’ config property.

show_color_scale: bool

Read or modify the ‘show_color_scale’ config property.

scale_min: float

Read or modify the ‘scale_min’ config property.

scale_max: float

Read or modify the ‘scale_max’ config property.

scale_height: int

Read or modify the ‘scale_height’ config property.

equal_aspects: bool

Read or modify the ‘equal_aspects’ config property.

query: bool

Read or modify the ‘query’ config property.

crosshairs: bool

Read or modify the ‘crosshairs’ config property.

no_legend: bool

Read or modify the ‘no_legend’ config property.

no_menus: bool

Read or modify the ‘no_menus’ config property.

no_box_select: bool

Read or modify the ‘no_box_select’ config property.

no_mouse_pos: bool

Read or modify the ‘no_mouse_pos’ config property.

no_highlight: bool

Read or modify the ‘no_highlight’ config property.

no_child: bool

Read or modify the ‘no_child’ config property.

anti_aliased: bool

Read or modify the ‘anti_aliased’ config property.

add_dataseries(series: DataSeries, *, update_bounds: bool = True) None[source]

Add a DataSeries to this plot (or update it).

Updates the data series if it has already been added.

remove_dataseries(series: DataSeries) None[source]

Remove a DataSeries from this plot if it has been added.

clear() None[source]
set_xlimits(limits: Optional[PlotLimits]) None[source]

Set the (min, max) limits for the x-axis, or pass None to use automatic limits.

set_ylimits(limits: Optional[PlotLimits]) None[source]

Set the (min, max) limits for the y-axis, or pass None to use automatic limits.

set_xticks(ticks: Optional[Iterable[TickLabel]]) None[source]

Set the tick labels for the x-axis, or pass None to use automatic ticks.

set_yticks(ticks: Optional[Iterable[TickLabel]]) None[source]

Set the tick labels for the y-axis, or pass None to 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 PlotAnnotation and 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, or None.

get_selected_query_area() Optional[PlotQueryArea][source]

Returns a PlotQueryArea for 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: tuple

The position of a selected Plot query area.

x_min: float

Alias for field number 0

x_max: float

Alias for field number 1

y_min: float

Alias for field number 2

y_max: float

Alias for field number 3

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: object

Container for axis configuration properties.

This class can be used to modify the configuration of a single axis of a Plot.

no_gridlines: bool
no_tick_marks: bool
no_tick_labels: bool
log_scale: bool
invert: bool
lock_min: bool
lock_max: bool
class dearpygui_obj.plots.PlotXAxisConfig(plot: dearpygui_obj.plots.Plot, axis: dearpygui_obj.plots.PlotAxis)[source]

Bases: dearpygui_obj.plots.PlotAxisConfig

Configuration container for plot X-axis.

axis: dearpygui_obj.plots.PlotXAxis
time: bool
class dearpygui_obj.plots.PlotYAxisConfig(plot: dearpygui_obj.plots.Plot, axis: dearpygui_obj.plots.PlotAxis)[source]

Bases: dearpygui_obj.plots.PlotAxisConfig

Configuration 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.PlotYAxisConfig

Configuration container for optional Y-axes.

This class is similar to PlotYAxisConfig. It provides the enabled property 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

PlotAnnotation

Adds a plot annotation.

PlotText

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: object

Adds 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.

delete() None[source]
property is_valid: bool

False if 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]
set_text(text: str) None[source]
set_color(color: Optional[ColorRGBA]) None[source]
set_position(x: float, y: float) None[source]
set_offset(xoffset: float, yoffset: float) None[source]

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: object

Adds 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

DataSeries

Abstract base class for plot data series.

DataSeriesConfig

Descriptor used to get/set non-data config properties for DataSeries objects.

DataSeriesCollection

Collection type that allows set/get of individual data fields of a data series.

AreaSeries

Adds an area series to a plot.

BarSeries

Adds a bar series to a plot.

CandleSeries

Adds a candle series to a plot.

ErrorSeries

Adds an error series to a plot.

HeatSeries

Adds a heat series to a plot.

HLineSeries

Adds an infinite horizontal line series to a plot.

VLineSeries

Adds an infinite vertical line series to a plot.

LineSeries

Adds a line series to a plot.

PieSeries

Adds a pie chart to a plot.

ScatterSeries

Adds a scatter series to a plot.

ShadeSeries

Adds a single-sided shade series to a plot.

ShadeRangeSeries

Adds a single-sided shade series to a plot.

StairSeries

Add a stair series to a plot.

StemSeries

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.

get_config(key: str) Any[source]

Get a config value.

set_config(key: str, value: Any) None[source]

Set a config value.

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 Plot to 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.

__delitem__(index: int) None[source]
__delitem__(index: slice) None
insert(index: int, item: Any) None[source]

S.insert(index, value) – insert value before index

append(item: Any) None[source]

S.append(value) – append value to the end of the sequence

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.

remove(item: Any) None[source]

S.remove(value) – remove first occurrence of value. Raise ValueError if the value is not present.

clear() None remove all items from S[source]
class dearpygui_obj.wrapper.dataseries.DataSeriesConfig(key: Optional[str] = None)[source]

Bases: object

Descriptor used to get/set non-data config properties for DataSeries objects.

getvalue(fvalue: ConvertFunc)[source]
getconfig(fconfig: ConvertFunc)[source]
fvalue(config: Any) Any[source]
fconfig(value: Any) Any[source]
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.

__len__() int[source]
__iter__() Iterable[TValue][source]
__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.

__setitem__(index: int, value: dearpygui_obj.wrapper.dataseries.TValue) None[source]
__setitem__(index: slice, value: Iterable[TValue]) None

Set values for a particular data field using index or slice.

Raises

TypeError – if the slice assignment would change the length of the sequence.

__delitem__(index: Any) NoReturn[source]

Always raises TypeError.

insert(index: int, value: TValue) NoReturn[source]

Always raises TypeError.

XYData

class dearpygui_obj.plots.dataseries.XYData(x: float, y: float)[source]

Bases: tuple

Common 2D data point used by many data series types.

x: float

X-axis data.

y: float

Y-axis data.

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.

x: MutableSequence[float]

Access ‘x’ data as a linear sequence.

y: MutableSequence[float]

Access ‘y’ data as a linear sequence.

color: ColorRGBA
fill: ColorRGBA
weight: float

Descriptor used to get/set non-data config properties for DataSeries objects.

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.

x: MutableSequence[float]

Access ‘x’ data as a linear sequence.

y: MutableSequence[float]

Access ‘y’ data as a linear sequence.

weight: float

Descriptor used to get/set non-data config properties for DataSeries objects.

horizontal: bool

Descriptor used to get/set non-data config properties for DataSeries objects.

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.

date: MutableSequence[float]

Access ‘date’ data as a linear sequence.

opens: MutableSequence[float]

Access ‘opens’ data as a linear sequence.

highs: MutableSequence[float]

Access ‘highs’ data as a linear sequence.

lows: MutableSequence[float]

Access ‘lows’ data as a linear sequence.

closes: MutableSequence[float]

Access ‘closes’ data as a linear sequence.

tooltip: bool

Descriptor used to get/set non-data config properties for DataSeries objects.

bull_color: ColorRGBA
bear_color: ColorRGBA
weight: float

Descriptor used to get/set non-data config properties for DataSeries objects.

class dearpygui_obj.plots.dataseries.CandleSeriesData(date: float, open: float, high: float, low: float, close: float)[source]

Bases: tuple

Data record type for CandleSeries.

date: float

POSIX timestamp

open: float

Alias for field number 1

high: float

Alias for field number 2

low: float

Alias for field number 3

close: float

Alias for field number 4

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.

x: MutableSequence[float]

Access ‘x’ data as a linear sequence.

y: MutableSequence[float]

Access ‘y’ data as a linear sequence.

negative: MutableSequence[float]

Access ‘negative’ data as a linear sequence.

positive: MutableSequence[float]

Access ‘positive’ data as a linear sequence.

horizontal: bool

Descriptor used to get/set non-data config properties for DataSeries objects.

class dearpygui_obj.plots.dataseries.ErrorSeriesData(x: float, y: float, negative: float, positive: float)[source]

Bases: tuple

Data record type for ErrorSeries.

x: float

Alias for field number 0

y: float

Alias for field number 1

negative: float

Alias for field number 2

positive: float

Alias for field number 3

Heat Series

class dearpygui_obj.plots.dataseries.HeatSeries(label: str, values: Iterable[float], rows: int, columns: int, scale_min: float, scale_max: float, **config: Any)[source]

Bases: dearpygui_obj.wrapper.dataseries.DataSeries[tuple]

Adds a heat series to a plot.

values: MutableSequence[float]

Access ‘values’ data as a linear sequence.

rows: int

Descriptor used to get/set non-data config properties for DataSeries objects.

columns: int

Descriptor used to get/set non-data config properties for DataSeries objects.

scale_min: float

Descriptor used to get/set non-data config properties for DataSeries objects.

scale_max: float

Descriptor used to get/set non-data config properties for DataSeries objects.

format: str

Descriptor used to get/set non-data config properties for DataSeries objects.

bounds_min: Tuple[float, float]
bounds_max: Tuple[float, float]

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.

x: MutableSequence[float]

Access ‘x’ data as a linear sequence.

color: ColorRGBA
weight: float

Descriptor used to get/set non-data config properties for DataSeries objects.

class dearpygui_obj.plots.dataseries.VLineSeries(label: str, x: Iterable[float], **config: Any)[source]

Bases: dearpygui_obj.wrapper.dataseries.DataSeries[tuple]

Adds an infinite vertical line series to a plot.

x: MutableSequence[float]

Access ‘x’ data as a linear sequence.

color: ColorRGBA
weight: float

Descriptor used to get/set non-data config properties for DataSeries objects.

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.

x: MutableSequence[float]

Access ‘x’ data as a linear sequence.

y: MutableSequence[float]

Access ‘y’ data as a linear sequence.

color: ColorRGBA
weight: float

Descriptor used to get/set non-data config properties for DataSeries objects.

Pie Series

class dearpygui_obj.plots.dataseries.PieSeriesData(value: float, label: str)[source]

Bases: tuple

Data record type for PieSeries.

value: float

Alias for field number 0

label: str

Alias for field number 1

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.

values: MutableSequence[float]

Access ‘values’ data as a linear sequence.

labels: MutableSequence[str]

Access ‘labels’ data as a linear sequence.

x: float

Descriptor used to get/set non-data config properties for DataSeries objects.

y: float

Descriptor used to get/set non-data config properties for DataSeries objects.

radius: float

Descriptor used to get/set non-data config properties for DataSeries objects.

normalize: bool

Descriptor used to get/set non-data config properties for DataSeries objects.

angle: bool

Descriptor used to get/set non-data config properties for DataSeries objects.

format: str

Descriptor used to get/set non-data config properties for DataSeries objects.

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.

x: MutableSequence[float]

Access ‘x’ data as a linear sequence.

y: MutableSequence[float]

Access ‘y’ data as a linear sequence.

marker: PlotMarker
size: float

Descriptor used to get/set non-data config properties for DataSeries objects.

weight: float

Descriptor used to get/set non-data config properties for DataSeries objects.

outline: ColorRGBA
fill: ColorRGBA
xy_data_format: bool

Descriptor used to get/set non-data config properties for DataSeries objects.

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.

x: MutableSequence[float]

Access ‘x’ data as a linear sequence.

y1: MutableSequence[float]

Access ‘y1’ data as a linear sequence.

color: ColorRGBA
fill: ColorRGBA
weight: float

Descriptor used to get/set non-data config properties for DataSeries objects.

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.

x: MutableSequence[float]

Access ‘x’ data as a linear sequence.

y1: MutableSequence[float]

Access ‘y1’ data as a linear sequence.

y2: MutableSequence[float]

Access ‘y2’ data as a linear sequence.

color: ColorRGBA
fill: ColorRGBA
weight: float

Descriptor used to get/set non-data config properties for DataSeries objects.

class dearpygui_obj.plots.dataseries.ShadeRangeData(x: float, y1: float, y2: float)[source]

Bases: tuple

Data record type for ShadeRangeSeries.

x: float

Alias for field number 0

y1: float

Alias for field number 1

y2: float

Alias for field number 2

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.

x: MutableSequence[float]

Access ‘x’ data as a linear sequence.

y: MutableSequence[float]

Access ‘y’ data as a linear sequence.

color: ColorRGBA
weight: float

Descriptor used to get/set non-data config properties for DataSeries objects.

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.

x: MutableSequence[float]

Access ‘x’ data as a linear sequence.

y: MutableSequence[float]

Access ‘y’ data as a linear sequence.

marker: PlotMarker
size: float

Descriptor used to get/set non-data config properties for DataSeries objects.

weight: float

Descriptor used to get/set non-data config properties for DataSeries objects.

outline: ColorRGBA
fill: ColorRGBA