| GTK-EXTRA - Reference Manual

| Home

## GtkPlot Structures

Why are these useful?
Because the gtk-sheet functions do not cover everything and sometimes you need to modify
structure elements by yourself.

    struct _GtkPlot
           GtkWidget widget;
           GdkDrawable *drawable;
           GdkPixmap *bg_pixmap;
           gboolean use_pixmap;
           gboolean transparent;
           gdouble magnification;
           gboolean clip_data;
           GdkColor background;
           gboolean grids_on_top;
           gboolean show_x0;
           gboolean show_y0;
           /* location and size in percentage of the widget's size */
           gdouble x, y, width, height;
           gdouble xmin, xmax;
           gdouble ymin, ymax;
           GtkPlotScale xscale, yscale;
           GtkPlotAxis *bottom;
           GtkPlotAxis *top;
           GtkPlotAxis *left;
           GtkPlotAxis *right;
           gfloat bottom_align;
           gfloat top_align;
           gfloat left_align;
           gfloat right_align;
           GtkPlotLine x0_line;
           GtkPlotLine y0_line;
           gdouble legends_x, legends_y; /* position in % */
           gint legends_width, legends_height; /* absolute size */
           GtkPlotBorderStyle legends_border;
           gint legends_line_width;
           gint legends_border_width;
           gint legends_shadow_width;
           gboolean show_legends;
           GtkPlotText legends_attr;
           GtkPlotData *active_data;
           GList *data_sets;
           GList *text;
    struct _GtkPlotAxis
      GtkObject object;
      gboolean is_visible;
      GtkPlotVector origin;
      GtkPlotVector direction;
      GtkPlotText title;
      gboolean title_visible;
      GtkPlotTicks ticks;
      GtkPlotOrientation orientation;

      GtkPlotScale scale;
      GtkPlotLine line;
      GtkPlotLine major_grid;
      GtkPlotLine minor_grid;
      gdouble min;
      gdouble max;
      gint major_mask;
      gint minor_mask;
      gint ticks_length;
      gfloat ticks_width;
      gboolean custom_labels;
      gint labels_offset;
      gchar *labels_prefix;
      gchar *labels_suffix;
      gboolean show_major_grid;
      gboolean show_minor_grid;
      GtkPlotText labels_attr;
      gint label_precision;
      gint label_style;
      gint label_mask;
    struct _GtkPlotText
      gdouble x, y;
      gint angle; /* 0, 90, 180, 270 */
      GdkColor fg;
      GdkColor bg;

      gboolean transparent;

      GtkPlotBorderStyle border;
      gint border_width;
      gint shadow_width;
      gint border_space;
      gchar *font;
      gint height;
      gchar *text;
      GtkJustification justification;
    struct _GtkPlotLine
     GtkPlotLineStyle line_style;
     gfloat line_width;
     GdkColor color;
    struct _GtkPlotSymbol
      GtkPlotSymbolType symbol_type;
      GtkPlotSymbolStyle symbol_style;
      gint size;
      GdkColor color;
      GtkPlotLine border;
    struct _GtkPlotTicks
      gint nmajorticks;             /* Number of major ticks drawn */
      gint nminorticks;             /* Number of minor ticks drawn */
      gdouble step;		   /* major ticks step */
      gint nminor;		   /* number of minor ticks between major ticks */
      gint *major;             /* major ticks points */
      gint *minor;             /* minor ticks points */
      gdouble *major_values;          /* major ticks values */
      gdouble *minor_values;          /* minor ticks values */
      gboolean set_limits;
      gdouble begin, end;
    struct _GtkPlotVector
      gdouble x, y, z;
    struct _GtkPlotMarker
      GtkPlotData *data;
      gint point;

##

## Signals

##
GtkPlot Signals
The "add_data" signal

    gboolean (* add_data) (GtkPlot *plot, GtkPlotData *data);

`plot` |
`data` |

###
The "update" signal

    void (* update) (GtkPlot *plot, gboolean new_range);

`plot` |
`new_range` |

###
The "changed" signal

    void (* changed) (GtkPlot *plot);

`plot` |

###
The "moved" signal

    gboolean (* moved) (GtkPlot *plot,
                        gdouble x, gdouble y);

`plot` |
x,y |

###
The "resized" signal

    gboolean (* resized) (GtkPlot *plot,
                          gdouble width, gdouble height);

`plot` |
width,height |

###
The "plot_paint" signal

    void (* plot_paint) (GtkWidget *plot);

`plot` |

###
The "draw_legends" signal

    void (* draw_legends) (GtkWidget *plot);

`plot` |

###
The "get_pixel" signal

    void (* get_pixel) (GtkWidget *plot,
                        gdouble x, gdouble y,
                        gdouble *px, gdouble *py);

`plot` |
x,y |
*px,*py |

### The "get_point" signal

    void (* get_point) (GtkWidget *plot,
                        gint px, gint py,
                        gdouble *x, gdouble *y);

`plot` |
*x,*y |
px,py |

##
GtkPlotData Signals

###
The "add_to_plot" signal

    gboolean (* add_to_plot) (GtkPlotData *data, GtkPlot *plot);

`plot` |
data |

###
The "update" signal

    void (* update) (GtkPlotData *data, gboolean new_range);

`plot` |
new_range |

###
The "draw_data" signal

    void (* draw_data) (GtkPlotData *data);

`data` |

###
The "draw_symbol" signal

    void (* draw_symbol) (GtkPlotData *data,
                          gdouble x,
                          gdouble y,
                          gdouble z,
                          gdouble a,
                          gdouble dx,
                          gdouble dy,
                          gdouble dz,
                          gdouble da);

`data` |
x,y,x |
dx,dy,dz |
a |
da |

###
The "draw_legend" signal

    void (* draw_legend) (GtkPlotData *data, gint x, gint y);

`data` |
x,y |

### The "get_legend_size" signal

    void (* get_legend_size) (GtkPlotData *data,
                              gint *width, gint *height);

`data` |
*width,*height |

GtkPlotAxis Signals

###
The "tick_label" signal

    gboolean (* tick_label) (GtkPlotAxis *axis,
                             gdouble *tick,
                             gchar *label);

`axis` |
tick |
label |

  ##

| Home |  |