## GLE Library: graphutil.gle

List of subroutines:

**graph_line x1 y1 x2 y2****graph_hline y x1 x2****graph_vline x y1 y2****invxg x****invyg y****graph_textbox xp yp label$ dx dy add****graph_text xp yp label$ dx dy****graph_del wd sca****graph_select wd hi hsc vsc xmn xmx ymn ymx****graph_hgrid nb color$****graph_vgrid nb color$****graph_grid nbh nbv color$****graph_origin****graph_zeroaxis style color$****graph_print_inv x y****dmaxx ds$****dmaxy ds$****dminx ds$****dminy ds$****dmeany ds$****darea ds$****dmeany_x d$ x****derry_up_x d$ x****derry_down_x d$ x****bar_draw_error_interval bar xval yval error****bar_draw_error_intervals data$ err$ bar**

```
```

! Function to draw a line on a graph

! x1, y2 = start point

! x2, y2 = end point

! Function to draw a horizontal line on a graph

! y = y-point of line

! x1, x2 = range of line

! Function to draw a vertical line on a graph

! x = x-point of line

! y1, y2 = range of line

! Function returning the offset of the drawing area of a graph

! wd = width of the graph

! sca = hscale parameter of the graph

! Initialize graph variables and functions such as xg() and yg()

! wd = width of graph

! hi = height of graph

! hsc = hscale parameter of graph

! vsc = vscale parameter of graph

! xmn, xmx = minimum and maximum xaxis value

! ymn, ymx = minimum and maximum yaxis value

! Function to draw an horizontal equidistant grid on a graph

! (use 'under graph_hgrid 5 "red"' in your graph block)

! nb = number of lines in grid

! color$ = color for grid lines

! Function to draw a vertical equidistant grid on a graph

! (use 'under graph_vgrid 5 "red"' in your graph block)

! nb = number of lines in grid

! color$ = color for grid lines

! Function to draw an equidistant grid on a graph

! (use 'under graph_grid 5 "red"' in your graph block)

! nb = number of lines in grid

! color$ = color for grid lines

! Go to the origin of a graph selected with selectgraph

! Function to compute the maximum x-value of a dataset

! Function to compute the maximum y-value of a dataset

! Function to compute the minimum x-value of a dataset

! Function to compute the minimum y-value of a dataset

! Function to compute the mean y-value of a dataset

! Function to compute the area between a dataset and the x-axis

! compute average y-value for given x-value x for dataset d$

! compute maximum upward deviation from the mean y-value

! compute maximum downward deviation from the mean y-value

! Function to draw an error interval on a bar dataset with multiple bars

! Function to draw error intervals on a bar dataset with multiple bars

! E.g.,

!

! begin graph

! data "mydata.csv"

! bar d1,d3 fill grey50,grey20

! end graph

!

! bar_draw_error_intervals "d1" "d2" 1

! bar_draw_error_intervals "d3" "d4" 2