BPlotWidget

BPlotWidget — Widget showing a single plot surrounded by axes.

Functions

Properties

gdouble max-frame-rate Read / Write / Construct
gboolean show-toolbar Read / Write / Construct

Types and Values

Object Hierarchy

    GObject
    ╰── GInitiallyUnowned
        ╰── GtkWidget
            ╰── GtkContainer
                ╰── GtkGrid
                    ╰── BPlotWidget

Implemented Interfaces

BPlotWidget implements AtkImplementorIface, GtkBuildable and GtkOrientable.

Description

This is a widget that shows a single plot surrounded by axes. Currently, this the plot can be either an XY (scatter) plot or a density plot. The widget also includes a toolbar with controls for zooming and translating (panning) the region shown.

BPlotWidget also includes a mechanism for throttling the rate of updates in response to changes in the data being plotted. This is done using the "max-frame-rate" property.

Functions

b_plot_widget_new_scatter ()

BPlotWidget *
b_plot_widget_new_scatter (BScatterSeries *series);

Create a BPlotWidget with a BScatterLineView.

Parameters

series

a series to add to the plot, or NULL.

[nullable]

Returns

the new plot


b_plot_widget_add_view ()

void
b_plot_widget_add_view (BPlotWidget *obj,
                        BElementViewCartesian *view);

Add a main view to a plot

Parameters

obj

a BPlotWidget

 

view

a BElementViewCartesian, such as a scatter view or density view

 

b_plot_widget_new_density ()

BPlotWidget *
b_plot_widget_new_density ();

Create a BPlotWidget with a BDensityView.

Returns

the new plot


b_plot_widget_get_main_view ()

BElementViewCartesian *
b_plot_widget_get_main_view (BPlotWidget *plot);

Get the main view from the plot widget.

Parameters

plot

a BPlotWidget

 

Returns

the view.

[transfer none]


b_plot_widget_get_axis_view ()

BAxisView *
b_plot_widget_get_axis_view (BPlotWidget *plot,
                             BCompass c);

Get one of the four axis views from the plot widget.

Parameters

plot

a BPlotWidget

 

c

a compass direction

 

Returns

the axis view for direction c .

[transfer none]


b_plot_widget_set_x_label ()

void
b_plot_widget_set_x_label (BPlotWidget *plot,
                           const gchar *label);

Set an axis label for the X (horizontal) axis.

Parameters

plot

a BPlotWidget

 

label

a label

 

b_plot_widget_set_y_label ()

void
b_plot_widget_set_y_label (BPlotWidget *plot,
                           const gchar *label);

Set an axis label for the Y (vertical) axis.

Parameters

plot

a BPlotWidget

 

label

a label

 

b_plot_freeze_all ()

void
b_plot_freeze_all (GtkContainer *c);

Freeze all BElementView children of c .

Parameters

c

a container with BElementViews

 

b_plot_thaw_all ()

void
b_plot_thaw_all (GtkContainer *c);

Thaw all BElementView children of c .

Parameters

c

a container with BElementViews

 

b_plot_save ()

gboolean
b_plot_save (GtkContainer *c,
             gchar *path,
             GError *error);

Save an image of the plot to a file. The format is determined by the file extension: PDF if the basename ends in ".pdf", SVG if it ends in ".svg", and PNG if the basename ends in ".png" or if there is no extension. Only BElementViews are drawn, and the size of the image is just large enough to fit the BElementViews (which may be smaller than c 's allocated size).

Parameters

c

a container with BElementViews

 

path

a file path

 

error

a GError, not currently used

 

Returns

TRUE if save was successful


b_plot_toolbar_new ()

GtkToolbar *
b_plot_toolbar_new (GtkContainer *c);

Create a new toolbar for a plot or collection of plots. The items in the toolbar will operate on all BElementViews that are children of c .

Parameters

c

a container with BElementViews

 

Returns

The new GtkToolbar.

[transfer full]

Types and Values

BPlotWidget

typedef struct _BPlotWidget BPlotWidget;

Property Details

The “max-frame-rate” property

  “max-frame-rate”           gdouble

Maximum frame rate in 1/s; used to throttle refresh speed.

Flags: Read / Write / Construct

Allowed values: [-1,100]

Default value: 0


The “show-toolbar” property

  “show-toolbar”             gboolean

Whether the toolbar should be shown.

Flags: Read / Write / Construct

Default value: TRUE