type Gtk_Plot_Record is new Gtk.Widget.Gtk_Widget_Record with private;
type Gtk_Plot_Axis_Record is new Glib.Object.GObject_Record with private;
type Gtk_Plot is access all Gtk_Plot_Record'Class;
type Gtk_Plot_Axis is access all Gtk_Plot_Axis_Record'Class;
type Gtk_Plot_Text is new Gdk.C_Proxy;
type Gtk_Plot_Symbol is new Gdk.C_Proxy;
type Gtk_Plot_Tick is new Gdk.C_Proxy;
type Gtk_Plot_Ticks is new Gdk.C_Proxy;
type Plot_Vector is record X, Y, Z : Gdouble; end record;
type Plot_Border_Style is (Border_None, -- No border is drawn Border_Line, -- A simple line on each side Border_Shadow -- The right and bottom lines are -- thicker );
type Plot_Error is (Error_Div_Zero, Error_Log_Neg);
type Plot_Axis_Pos is (Axis_Left, Axis_Right, Axis_Top, Axis_Bottom);
type Plot_Orientation is (Axis_X, Axis_Y, Axis_Z);
type Plot_Ticks_Pos is new Integer;
type Plot3D_Function is access function (Plot : System.Address; Set : Gtk_Plot_Data; X : Gdouble; Y : Gdouble; Error : access Gboolean) return Gdouble;
Label_None : constant Plot_Label_Pos;
Label_In : constant Plot_Label_Pos;
Label_Out : constant Plot_Label_Pos;
Ticks_None : constant Plot_Ticks_Pos;
Ticks_In : constant Plot_Ticks_Pos;
Ticks_Out : constant Plot_Ticks_Pos;
procedure Gtk_New
| ( | Plot | : out Gtk_Plot; |
| Drawable | : Gdk.Drawable.Gdk_Drawable := Gdk.Drawable.Null_Drawable); |
procedure Gtk_New
| ( | Plot | : out Gtk_Plot; |
| Width | : Gdouble; | |
| Height | : Gdouble; | |
| Drawable | : Gdk.Drawable.Gdk_Drawable := Gdk.Drawable.Null_Drawable); |
procedure Initialize
| ( | Plot | : access Gtk_Plot_Record'Class; |
| Drawable | : Gdk.Drawable.Gdk_Drawable); |
procedure Initialize
| ( | Plot | : access Gtk_Plot_Record'Class; |
| Drawable | : Gdk.Drawable.Gdk_Drawable; | |
| Width | : Gdouble; | |
| Height | : Gdouble); |
function Get_Type return Gtk.Gtk_Type;
procedure Set_Drawable
| ( | Plot | : access Gtk_Plot_Record; |
| Drawable | : Gdk.Drawable.Gdk_Drawable); |
function Get_Drawable
| ( | Plot | : access Gtk_Plot_Record) return Gdk.Drawable.Gdk_Drawable; |
procedure Set_Background
| ( | Plot | : access Gtk_Plot_Record; |
| Background | : Gdk.Color.Gdk_Color); |
procedure Set_Background_Pixmap
| ( | Plot | : access Gtk_Plot_Record; |
| Pixmap | : Gdk.Pixmap.Gdk_Pixmap); |
procedure Set_Transparent
| ( | Plot | : access Gtk_Plot_Record; |
| Transparent | : Boolean); |
function Is_Transparent
| ( | Plot | : access Gtk_Plot_Record) return Boolean; |
procedure Paint
| ( | Plot | : access Gtk_Plot_Record); |
procedure Refresh
| ( | Plot | : access Gtk_Plot_Record; |
| Area | : Gdk.Rectangle.Gdk_Rectangle); |
procedure Get_Position
| ( | Plot | : access Gtk_Plot_Record; |
| X | : out Gdouble; | |
| Y | : out Gdouble); |
procedure Get_Size
| ( | Plot | : access Gtk_Plot_Record; |
| Width | : out Gdouble; | |
| Height | : out Gdouble); |
function Get_Internal_Allocation
| ( | Plot | : access Gtk_Plot_Record) return Gtk.Widget.Gtk_Allocation; |
procedure Set_Magnification
| ( | Plot | : access Gtk_Plot_Record; |
| Magnification | : Gdouble); |
procedure Move
| ( | Plot | : access Gtk_Plot_Record; |
| X | : Gdouble; | |
| Y | : Gdouble); |
procedure Resize
| ( | Plot | : access Gtk_Plot_Record; |
| Width | : Gdouble; | |
| Height | : Gdouble); |
procedure Move_Resize
| ( | Plot | : access Gtk_Plot_Record; |
| X | : Gdouble; | |
| Y | : Gdouble; | |
| Width | : Gdouble; | |
| Height | : Gdouble); |
procedure Get_Pixel
| ( | Plot | : access Gtk_Plot_Record; |
| Xx | : Gdouble; | |
| Yy | : Gdouble; | |
| X | : out Gdouble; | |
| Y | : out Gdouble); |
procedure Clip_Data
| ( | Plot | : access Gtk_Plot_Record; |
| Clip | : Boolean); |
procedure Get_Point
| ( | Plot | : access Gtk_Plot_Record; |
| X | : Gint; | |
| Y | : Gint; | |
| Xx | : out Gdouble; | |
| Yy | : out Gdouble); |
procedure Set_Xrange
| ( | Plot | : access Gtk_Plot_Record; |
| Xmin | : Gdouble := 0.0; | |
| Xmax | : Gdouble := 1.0); |
procedure Set_Yrange
| ( | Plot | : access Gtk_Plot_Record; |
| Ymin | : Gdouble := 0.0; | |
| Ymax | : Gdouble := 1.0); |
procedure Set_Range
| ( | Plot | : access Gtk_Plot_Record; |
| Xmin | : Gdouble := 0.0; | |
| Xmax | : Gdouble := 1.0; | |
| Ymin | : Gdouble := 0.0; | |
| Ymax | : Gdouble := 1.0); |
procedure Autoscale
| ( | Plot | : access Gtk_Plot_Record); |
procedure Get_Xrange
| ( | Plot | : access Gtk_Plot_Record; |
| Xmin | : out Gdouble; | |
| Xmax | : out Gdouble); |
procedure Get_Yrange
| ( | Plot | : access Gtk_Plot_Record; |
| Ymin | : out Gdouble; | |
| Ymax | : out Gdouble); |
procedure Set_Xscale
| ( | Plot | : access Gtk_Plot_Record; |
| Scale_Type | : Plot_Scale); |
procedure Set_Yscale
| ( | Plot | : access Gtk_Plot_Record; |
| Scale_Type | : Plot_Scale); |
function Get_Xscale
| ( | Plot | : access Gtk_Plot_Record) return Plot_Scale; |
function Get_Yscale
| ( | Plot | : access Gtk_Plot_Record) return Plot_Scale; |
procedure Reflect_X
| ( | Plot | : access Gtk_Plot_Record; |
| Reflect | : Boolean); |
function Is_X_Reflected
| ( | Plot | : access Gtk_Plot_Record) return Boolean; |
procedure Reflect_Y
| ( | Plot | : access Gtk_Plot_Record; |
| Reflect | : Boolean); |
function Is_Y_Reflected
| ( | Plot | : access Gtk_Plot_Record) return Boolean; |
function Put_Text
| ( | Plot | : access Gtk_Plot_Record; |
| X | : Gdouble; | |
| Y | : Gdouble; | |
| Font | : String := ""; | |
| Font_Height | : Gint := 10; | |
| Angle | : Plot_Angle; | |
| Foreground | : Gdk.Color.Gdk_Color := Gdk.Color.Null_Color; | |
| Background | : Gdk.Color.Gdk_Color := Gdk.Color.Null_Color; | |
| Transparent | : Boolean := False; | |
| Justification | : Gtk.Enums.Gtk_Justification := Gtk.Enums.Justify_Center; | |
| Text | : String := "") return Gtk_Plot_Text; |
procedure Remove_Text
| ( | Plot | : access Gtk_Plot_Record; |
| Text | : Gtk_Plot_Text); |
procedure Text_Get_Area
| ( | Text | : Gtk_Plot_Text; |
| Angle | : Plot_Angle; | |
| Just | : Gtk.Enums.Gtk_Justification; | |
| Font_Name | : String; | |
| Font_Size | : Gint; | |
| X | : out Gint; | |
| Y | : out Gint; | |
| Width | : out Gint; | |
| Height | : out Gint); |
procedure Text_Get_Size
| ( | Text | : Gtk_Plot_Text; |
| Angle | : Plot_Angle; | |
| Font_Name | : String; | |
| Font_Size | : Gint; | |
| Width | : out Gint; | |
| Height | : out Gint; | |
| Ascent | : out Gint; | |
| Descent | : out Gint); |
procedure Text_Set_Attributes
| ( | Text | : Gtk_Plot_Text; |
| Font | : String; | |
| Height | : Gint; | |
| Angle | : Plot_Angle; | |
| Fg | : Gdk.Color.Gdk_Color; | |
| Bg | : Gdk.Color.Gdk_Color; | |
| Transparent | : Boolean := False; | |
| Justification | : Gtk.Enums.Gtk_Justification := Gtk.Enums.Justify_Center; | |
| Str | : String := ""); |
procedure Text_Set_Border
| ( | Text | : Gtk_Plot_Text; |
| Border | : Plot_Border_Style; | |
| Border_Space | : Gint; | |
| Border_Width | : Gint; | |
| Shadow_Width | : Gint); |
procedure Draw_Line
| ( | Plot | : access Gtk_Plot_Record; |
| Line | : Gtk_Plot_Line; | |
| X1, Y1, X2, Y2 | : Gdouble); |
procedure Set_Line_Attributes
| ( | Plot | : access Gtk_Plot_Record; |
| Line | : Gtk_Plot_Line); |
procedure Set_Ticks
| ( | Plot | : access Gtk_Plot_Record; |
| Orientation | : Plot_Orientation; | |
| Major_Step | : Gdouble; | |
| Num_Minor | : Gint); |
procedure Set_Major_Ticks
| ( | Plot | : access Gtk_Plot_Record; |
| Orientation | : Plot_Orientation; | |
| Major_Step | : Gdouble); |
procedure Set_Minor_Ticks
| ( | Plot | : access Gtk_Plot_Record; |
| Orientation | : Plot_Orientation; | |
| Num_Minor | : Gint); |
procedure Set_Ticks_Limits
| ( | Plot | : access Gtk_Plot_Record; |
| Orientation | : Plot_Orientation; | |
| Ticks_Begin | : Gdouble; | |
| Ticks_End | : Gdouble); |
procedure Unset_Ticks_Limits
| ( | Plot | : access Gtk_Plot_Record; |
| Orientation | : Plot_Orientation); |
procedure Set_Break
| ( | Plot | : access Gtk_Plot_Record; |
| Orient | : Plot_Orientation; | |
| Min, Max | : Gdouble; | |
| Step_After | : Gdouble; | |
| Nminor_After | : Gint; | |
| Scale_After | : Plot_Scale; | |
| Pos | : Gdouble); |
procedure Gtk_New
| ( | Axis | : out Gtk_Plot_Axis; |
| Orientation | : Plot_Orientation); |
procedure Initialize
| ( | Axis | : access Gtk_Plot_Axis_Record'Class; |
| Orientation | : Plot_Orientation); |
function Axis_Get_Type return Gtk_Type;
function Get_Axis
| ( | Plot | : access Gtk_Plot_Record; |
| Axis | : Plot_Axis_Pos) return Gtk_Plot_Axis; |
function Gradient
| ( | Data | : access Gtk_Plot_Data_Record'Class) return Gtk_Plot_Axis; |
procedure Axis_Set_Visible
| ( | Axis | : access Gtk_Plot_Axis_Record; |
| Visible | : Boolean); |
function Axis_Visible
| ( | Axis | : access Gtk_Plot_Axis_Record) return Boolean; |
procedure Axis_Set_Title
| ( | Axis | : access Gtk_Plot_Axis_Record; |
| Title | : String); |
procedure Axis_Show_Title
| ( | Axis | : access Gtk_Plot_Axis_Record); |
procedure Axis_Hide_Title
| ( | Axis | : access Gtk_Plot_Axis_Record); |
procedure Axis_Move_Title
| ( | Axis | : access Gtk_Plot_Axis_Record; |
| Angle | : Plot_Angle; | |
| X | : Gdouble; | |
| Y | : Gdouble); |
procedure Axis_Justify_Title
| ( | Axis | : access Gtk_Plot_Axis_Record; |
| Justification | : Gtk.Enums.Gtk_Justification); |
procedure Axis_Set_Attributes
| ( | Axis | : access Gtk_Plot_Axis_Record; |
| Width | : Gfloat; | |
| Color | : Gdk.Color.Gdk_Color); |
procedure Axis_Get_Attributes
| ( | Axis | : access Gtk_Plot_Axis_Record; |
| Width | : out Gfloat; | |
| Color | : out Gdk.Color.Gdk_Color); |
procedure Axis_Set_Ticks
| ( | Axis | : access Gtk_Plot_Axis_Record; |
| Major_Step | : Gdouble; | |
| Num_Minor | : Gint); |
procedure Axis_Set_Major_Ticks
| ( | Axis | : access Gtk_Plot_Axis_Record; |
| Major_Step | : Gdouble); |
procedure Axis_Set_Minor_Ticks
| ( | Axis | : access Gtk_Plot_Axis_Record; |
| Num_Minor | : Gint); |
procedure Axis_Set_Ticks_Length
| ( | Axis | : access Gtk_Plot_Axis_Record; |
| Length | : Gint); |
procedure Axis_Set_Ticks_Width
| ( | Axis | : access Gtk_Plot_Axis_Record; |
| Width | : Gfloat); |
procedure Axis_Show_Ticks
| ( | Axis | : access Gtk_Plot_Axis_Record; |
| Major_Mask | : Plot_Ticks_Pos; | |
| Minor_Mask | : Plot_Ticks_Pos); |
procedure Axis_Set_Ticks_Limits
| ( | Axis | : access Gtk_Plot_Axis_Record; |
| Ticks_Begin | : Gdouble; | |
| Ticks_End | : Gdouble); |
procedure Axis_Unset_Ticks_Limits
| ( | Axis | : access Gtk_Plot_Axis_Record); |
procedure Axis_Set_Break
| ( | Axis | : access Gtk_Plot_Axis_Record; |
| Min, Max | : Gdouble; | |
| Step_After | : Gdouble; | |
| Nminor_After | : Gint; | |
| Scale_After | : Plot_Scale; | |
| Pos | : Gdouble); |
procedure Axis_Show_Labels
| ( | Axis | : access Gtk_Plot_Axis_Record; |
| Labels_Mask | : Plot_Label_Pos); |
procedure Axis_Title_Set_Attributes
| ( | Axis | : access Gtk_Plot_Axis_Record; |
| Font | : String; | |
| Height | : Gint; | |
| Angle | : Plot_Angle; | |
| Foreground | : Gdk.Color.Gdk_Color; | |
| Background | : Gdk.Color.Gdk_Color; | |
| Transparent | : Boolean; | |
| Justification | : Gtk.Enums.Gtk_Justification); |
procedure Axis_Set_Labels_Attributes
| ( | Axis | : access Gtk_Plot_Axis_Record; |
| Font | : String; | |
| Height | : Gint; | |
| Angle | : Plot_Angle; | |
| Foreground | : Gdk.Color.Gdk_Color; | |
| Background | : Gdk.Color.Gdk_Color; | |
| Transparent | : Boolean; | |
| Justification | : Gtk.Enums.Gtk_Justification); |
procedure Axis_Set_Labels_Offset
| ( | Axis | : access Gtk_Plot_Axis_Record; |
| Offset | : Gint); |
function Axis_Get_Labels_Offset
| ( | Axis | : access Gtk_Plot_Axis_Record) return Gint; |
procedure Axis_Set_Labels_Style
| ( | Axis | : access Gtk_Plot_Axis_Record; |
| Style | : Plot_Label_Style; | |
| Precision | : Gint); |
procedure Axis_Use_Custom_Tick_Labels
| ( | Axis | : access Gtk_Plot_Axis_Record; |
| Custom | : Boolean := True); |
procedure Axis_Set_Labels_Suffix
| ( | Axis | : access Gtk_Plot_Axis_Record; |
| Text | : String); |
procedure Axis_Set_Labels_Prefix
| ( | Axis | : access Gtk_Plot_Axis_Record; |
| Text | : String); |
function Axis_Get_Labels_Suffix
| ( | Axis | : access Gtk_Plot_Axis_Record) return String; |
function Axis_Get_Labels_Prefix
| ( | Axis | : access Gtk_Plot_Axis_Record) return String; |
procedure Axis_Ticks_Recalc
| ( | Axis | : access Gtk_Plot_Axis_Record); |
function Axis_Ticks_Transform
| ( | Axis | : access Gtk_Plot_Axis_Record; |
| Y | : Gdouble) return Gdouble; |
function Axis_Ticks_Inverse
| ( | Axis | : access Gtk_Plot_Axis_Record; |
| X | : Gdouble) return Gdouble; |
procedure Axis_Parse_Label
| ( | Axis | : access Gtk_Plot_Axis_Record; |
| Val | : Gdouble; | |
| Precision | : Gint; | |
| Style | : Gint; | |
| Label | : String); |
procedure X0_Set_Visible
| ( | Plot | : access Gtk_Plot_Record; |
| Visible | : Boolean); |
function X0_Visible
| ( | Plot | : access Gtk_Plot_Record) return Boolean; |
procedure Y0_Set_Visible
| ( | Plot | : access Gtk_Plot_Record; |
| Visible | : Boolean); |
function Y0_Visible
| ( | Plot | : access Gtk_Plot_Record) return Boolean; |
procedure X0line_Set_Attributes
| ( | Plot | : access Gtk_Plot_Record; |
| Style | : Plot_Line_Style; | |
| Width | : Gfloat; | |
| Color | : Gdk.Color.Gdk_Color); |
procedure Y0line_Set_Attributes
| ( | Plot | : access Gtk_Plot_Record; |
| Style | : Plot_Line_Style; | |
| Width | : Gfloat; | |
| Color | : Gdk.Color.Gdk_Color); |
procedure Grids_Set_On_Top
| ( | Plot | : access Gtk_Plot_Record; |
| On_Top | : Boolean); |
function Grids_On_Top
| ( | Plot | : access Gtk_Plot_Record) return Boolean; |
procedure Grids_Set_Visible
| ( | Plot | : access Gtk_Plot_Record; |
| Vmajor | : Boolean; | |
| Vminor | : Boolean; | |
| Hmajor | : Boolean; | |
| Hminor | : Boolean); |
procedure Grids_Visible
| ( | Plot | : access Gtk_Plot_Record; |
| Vmajor | : out Boolean; | |
| Vminor | : out Boolean; | |
| Hmajor | : out Boolean; | |
| Hminor | : out Boolean); |
procedure Major_Hgrid_Set_Attributes
| ( | Plot | : access Gtk_Plot_Record; |
| Style | : Plot_Line_Style; | |
| Width | : Gfloat; | |
| Color | : Gdk.Color.Gdk_Color); |
procedure Major_Vgrid_Set_Attributes
| ( | Plot | : access Gtk_Plot_Record; |
| Style | : Plot_Line_Style; | |
| Width | : Gfloat; | |
| Color | : Gdk.Color.Gdk_Color); |
procedure Minor_Hgrid_Set_Attributes
| ( | Plot | : access Gtk_Plot_Record; |
| Style | : Plot_Line_Style; | |
| Width | : Gfloat; | |
| Color | : Gdk.Color.Gdk_Color); |
procedure Minor_Vgrid_Set_Attributes
| ( | Plot | : access Gtk_Plot_Record; |
| Style | : Plot_Line_Style; | |
| Width | : Gfloat; | |
| Color | : Gdk.Color.Gdk_Color); |
procedure Show_Legends
| ( | Plot | : access Gtk_Plot_Record); |
procedure Hide_Legends
| ( | Plot | : access Gtk_Plot_Record); |
procedure Set_Legends_Border
| ( | Plot | : access Gtk_Plot_Record; |
| Border | : Plot_Border_Style; | |
| Shadow_Width | : Gint); |
procedure Legends_Move
| ( | Plot | : access Gtk_Plot_Record; |
| X | : Gdouble; | |
| Y | : Gdouble); |
procedure Legends_Get_Position
| ( | Plot | : access Gtk_Plot_Record; |
| X | : out Gdouble; | |
| Y | : out Gdouble); |
function Legends_Get_Allocation
| ( | Plot | : access Gtk_Plot_Record) return Gtk.Widget.Gtk_Allocation; |
procedure Legends_Set_Attributes
| ( | Plot | : access Gtk_Plot_Record; |
| Ps_Font | : String; | |
| Height | : Gint; | |
| Foreground | : Gdk.Color.Gdk_Color; | |
| Background | : Gdk.Color.Gdk_Color); |
generic with function Func
| ( | Plot | : access Gtk_Plot_Record'Class; |
| Set | : Gtk_Plot_Data; | |
| X | : Gdouble; | |
| Error | : access Boolean) return Gdouble; | |
| function Generic_Plot_Function (Plot | : System.Address; | |
| Set | : Gtk_Plot_Data; | |
| X | : Gdouble; | |
| Error | : access Gboolean) return Gdouble; |
generic with function Func
| ( | Plot | : access Gtk_Plot_Record'Class; |
| Set | : Gtk_Plot_Data; | |
| X | : Gdouble; | |
| Y | : Gdouble; | |
| Error | : access Boolean) return Gdouble; | |
| function Generic_Plot3D_Function (Plot | : System.Address; | |
| Set | : Gtk_Plot_Data; | |
| X | : Gdouble; | |
| Y | : Gdouble; | |
| Error | : access Gboolean) return Gdouble; |
procedure Add_Data
| ( | Plot | : access Gtk_Plot_Record; |
| Data | : access Gtk_Plot_Data_Record'Class); |
function Remove_Data
| ( | Plot | : access Gtk_Plot_Record; |
| Data | : access Gtk_Plot_Data_Record'Class) return Boolean; |
function Add_Function
| ( | Plot | : access Gtk_Plot_Record; |
| Func | : Plot_Function) return Gtk_Plot_Data; |
This package implements a high-level, general purpose plotting widget.
You can display any set of data (set of points, curve defined by a parametric function, ...). This widget can automatically display them as a curve, along with labelled axis, axis tic marks, legends,...
This is the base class, that provides 2D graphics. Some children provide polar-coordinates and 3D graphics in addition.
It fully supports the drag-and-drop protocol for all of its children, which means that the user can interactively move them in the Gtk_Plot area.
A Gtk_Plot is closely associated with a Gdk_Drawable, on which all the drawings are done. It can be done anywhere within that drawable, its "position" is indicated by a tuple (X, Y), which are two values between 0.0 and 1.0 (from left to right, or from top to bottom).
Its size is also given as a ratio other the drawable's size.
Most points in the plot have also this relative coordinates systems, which makes it really easy to handle resizing of a plot window.
See the package Gtk.Extra.Plot_Ps for a way to easily print a Gtk_Plot to a postscript file.
In this package, font parameters are sometimes required. Here is the list of possible fonts used by Gtk.Extra: - "Times-Roman", - "Times-Italic", - "Times-Bold", - "Times-BoldItalic", - "AvantGarde-Book", - "AvantGarde-BookOblique", - "AvantGarde-Demi", - "AvantGarde-DemiOblique", - "Bookman-Light", - "Bookman-LightItalic", - "Bookman-Demi", - "Bookman-DemiItalic", - "Courier", - "Courier-Oblique", - "Courier-Bold", - "Courier-BoldOblique", - "Helvetica", - "Helvetica-Oblique", - "Helvetica-Bold", - "Helvetica-BoldOblique", - "Helvetica-Narrow", - "Helvetica-Narrow-Oblique", - "Helvetica-Narrow-Bold", - "Helvetica-Narrow-BoldOblique", - "NewCenturySchoolbook-Roman", - "NewCenturySchoolbook-Italic", - "NewCenturySchoolbook-Bold", - "NewCenturySchoolbook-BoldItalic", - "Palatino-Roman", - "Palatino-Italic", - "Palatino-Bold", - "Palatino-BoldItalic", - "Symbol", - "ZapfChancery-MediumItalic", - "ZapfDingbats",
Binding from C File version gtkextra 2.1.1
<testgtk>create_plot.adb</testgtk>