# doc-cache created by Octave 4.0.0
# name: cache
# type: cell
# rows: 3
# columns: 24
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
_g_check


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 171
 isok = _g_check (g)         - Check that g is a gnuplot_object
 
 If nargout == 0, an error is raised if g is not a gnuplot_object.
 Else, isok is set to 0 and returned.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
 isok = _g_check (g)         - Check that g is a gnuplot_object
 
 If nargout ==



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
_g_default_tics


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 241
 ticpos = _g_default_tics (minmax, ntics = 5) - Set tics in interval for plotting

 Tics to place in interval minmax, approximately ntics of them (default 5),
 while ensuring the spacing between tics is 1eL, 2eL or 5eL, for some integer
 L.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
 ticpos = _g_default_tics (minmax, ntics = 5) - Set tics in interval for plottin



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
_g_image_cmd


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 516
 [fmt, extra, i, zrange] = _g_image_cmd (sz, zrange, args, va)

 sz     = [H W] or [H W 3] image size
 zrange = [min, max]       range of greylevel/RGB values
 args     struct w/ current defaults
 va       extra options
       "range" ,  r: replace zrange
       "xrange",  r: Define region in which image is drawn
       "yrange",  r:
       "xyrange", r:
       "colormap" yesno : map greylevels to color
 
 fmt   : Gnuplot plot argument
 extra : Gnuplot pre-plot argument
 i     : Number of arguments used in va.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 62
 [fmt, extra, i, zrange] = _g_image_cmd (sz, zrange, args, va)



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 14
_g_instantiate


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 398
 g = _g_instantiate (g,"VAR", Value,  ...) - Substitute all values in g.cmds.

 For each occurence of "<VAR>" in g.cmds{:}, a value is seeked either on the
 command line (preferentially) or in g.values.(VAR).

 If no value is found, an error occurs. Otherwise, the value is used to
 substitute "<VAR>". Non-string values are converted to strings by sprintf
 ("%g",value).

 See also: g_new, g_set.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 77
 g = _g_instantiate (g,"VAR", Value,  ...) - Substitute all values in g.cmds.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 10
_g_istoken


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 102
 Check that first chararcters of str match that of token and that the first
 non-matching char is ":"



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
 Check that first chararcters of str match that of token and that the first
 non



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 6
_g_map


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
 y = _g_map (the_map, x)



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
 y = _g_map (the_map, x)




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
_g_parse_oct_fmt


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 521
 [isFmt, fmtContents, labelFmt] = _g_parse_oct_fmt (FMT, plotn, wantLabel)

 Take a string FMT, e.g. "-5;Foobar;", in octave's plot (x,y,FMT) format and
 tries to translate it into fmtContents, a gnuplot string like 

     "with lines linetype 5 title 'Foobar'".

 isFmt is 1 if FMT makes sense in octave's plot syntax, 0 otherwise.

 If the wantLabel is true, or if the "format" part of FMT ("-5", in the
 example above) contains a "#", then labelFmt will hold a gnuplot string that
 plots a label with each data point.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 74
 [isFmt, fmtContents, labelFmt] = _g_parse_oct_fmt (FMT, plotn, wantLabel)



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
_g_save_data


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 167
 ndecimals = max (1,                                          \
		   ceil (    abs(log10 (max (abs (data(:)))))  \
			 + 4*abs(log10 (min (std (data))))     \
			 ));



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
 ndecimals = max (1,                                          \
		   ceil (    a



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
_g_stringify


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 86
 Use double quotes rather than simple quote, so that newlines are recognized
 as such



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
 Use double quotes rather than simple quote, so that newlines are recognized
 as



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7
_g_tics


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 246
 gnuplot_tic_setting_command = _g_tics (values, labels, ...)
 options:
 "x", "y", "z", "x2", "y2", "cb" axis on which tics go
 "tpl"        default 'tpl = "set %stics (%s)";'
 "fmt"        default '%3.2f' 
 "major"      default 1:length (values)



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
 gnuplot_tic_setting_command = _g_tics (values, labels, ...)
 options:
 "x", "y"



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
boxplot_data


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 99
 s = boxplot_data (x)

 s.quantiles : quantiles [0.05, 0.25, 0.5, 0.75, 0.95] of x
 s.outliers  : 



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 21
 s = boxplot_data (x)



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7
csplice


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 139
 c = csplice (c,p,l,c2) - Splice a cell (p starts at 0)

 TODO: Make p start at 1, check code that uses csplice
 Author <etienne@tyzx.com>



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 55
 c = csplice (c,p,l,c2) - Splice a cell (p starts at 0)



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 5
g_cmd


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 617
 g = g_cmd (g, <command or gnuplot_object or option>,...)

 Adds plotting commands to g. Each command is either a string that will be
 passed to gnuplot, or a "gnuplot_object" whose commands will be executed
 (in the right directory). gnuplot_objects are instantiated (see
 _g_instantiate) before being insterted in the command list.

 OPTIONS:
 "-at", <num>  : Insert subsequent sequence of commands (until next "-at"
                 option, or end of commands) after position <num>, rather
                 than end of g's command list. Use <num> = 0 to insert at
                 beginning.

 see also: g_new ...



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 57
 g = g_cmd (g, <command or gnuplot_object or option>,...)



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
g_config


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 476
 VALUE = g_config (NAME, [, NEW_VALUE]) - Get/set settings of g_XYZ functions

 NAME can be one of

    "gnuplot_version"  : Gnuplot version, e.g. [MAJOR, MINOR, PATCHLEVEL] 
                         This parameter cannot be set.
    "gnuplot_program"  : Gnuplot program that is called in g_plot()
                         Default is "gnuplot"
    "eps_viewer" and "png_viewer" : Programs called to view eps or png plots.
                         Defaults are "gv" and "eog".



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 77
 VALUE = g_config (NAME, [, NEW_VALUE]) - Get/set settings of g_XYZ functions



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 6
g_data


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 836
 g = g_data (g, <options>, <filename>, <matrices>, ... )

 ARGUMENTS: 
 <filename>, <mat1>,... : Write <mat1>,... (they should all have same width)
                      in a file named <string>. Matrices are separated by an
                      empty line (so that gnuplot chops lines up), unless the
                      "-join" option is used.

 OPTIONS:
 "-step", <num>       : Write a blank line every <num> lines in the next
                        written file (so that gnuplot chops lines up)

 "-stops",[pos1, pos2,...] : Put a blank line after the pos1'th row, pos2'th
                     row etc.  

 "-join",             : Do not put an empty line between the various matrices
                        of the next file. 

 "-label", yesno      :

 "-uint8",            : Save data as uint8 (e.g. to plot as image later).




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 54
 g = g_data (g, <options>, <filename>, <matrices>, ...



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
g_delete


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 557
 g = g_delete (g)             - Delete a gnuplot_object and its directory
     g_delete ()                Delete all gnuplot_object directories 
     g_delete ("all")           Delete all gnuplot_object directories 
     g_delete ("siblings")      Delete all gnuplot_object directories created
                                by this octave process

 TODO: A mechanism to make sure no directories are forgotten (disk
       leaks, as in "memory leaks") and that no dir gets deleted spuriously
       (that side is ok now. Just do g_delete() now and then).




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
 g = g_delete (g)             - Delete a gnuplot_object and its directory
     g



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 6
g_demo


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 102
 g_demo()                     - Show a few plots created by g_XYZ

 See also: g_new, demo g_ez, etc..



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 65
 g_demo()                     - Show a few plots created by g_XYZ



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 4
g_ez


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1640
 g = g_ez (command, args,...) - Single-command plotting function 

 This function allows to do basic plots with a single function call, i.e.
 like octave's plot() commant.

 If no output argument is required, the plot is shown and all data created
 for this plot is deleted. Otherwise use, g_plot(g) to plot g.

 Commands:
 ---------
 "plot", <PLOT_DATA>, where the plotted data can be 2D points or images
        2D data can be specified by a two-column matrix of 2D points,
        optionnally followed by a cell array of label strings
     
 "plot", x, y, fmt,... : Reads arguments like in octave's plot (x,y,fmt,...)
            fmt can be an octave-like formatting, e.g. "-;My Key;", see
            _g_parse_oct_fmt(). 
            or "img", which may be followed by "range", "xrange", "yrange",
            "colormap" options. See _g_image_cmd().
 "geometry",[w,h]      : Set gnuplot window geometry
 "FILE.(eps|fig)"      : Plot to FILE.eps or FILE.fig file.
 "xrange", [min,max]   : Set horizontal range
 "yrange", [min,max]   : Set vertical range
 "xlabel", str         : Set x label
 "ylabel", str         : Set y label
 "title",  str         : Set title
 "cmd",    str         : Insert command str.
 "grid",               : Same as "cmd","set grid"
 "xgrid",
 "ygrid"               : Same as "cmd","set grid x"
 "xtics", arg          : If arg is a non-empty string, then this adds the 
                         command ["set xtics " arg]. If arg is empty, same as
                         "unset xtics". 
 "ytics", arg          : Same as "cmd","set ytics " arg
 "color",   yesno
 "display", yesno

 TODO: "hist", "mesh" etc ...



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 65
 g = g_ez (command, args,...) - Single-command plotting function 



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
g_locate


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 243
 g = g_locate (g, [posx, posy, width, height]) - Set the origin and size of g

 This function replaces all "set scale W,H" by  "set scale width*W,height*H"
 and "set origin X,Y" by "set origin posx+height*X,posy+widthY".

 See also: g_new,...



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 77
 g = g_locate (g, [posx, posy, width, height]) - Set the origin and size of g



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 5
g_new


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1119
 g = g_new ( ...)            - Create a new gnuplot_object and its directory

 The g_XYZ() functions allow Octave to create plots with Gnuplot. They
 are little more than an Octave front-end to Gnuplot, but allow to do
 anything Gnuplot can do directly from Octave. In addition, there are some
 commodity functions (g_cmd() with struct arg, g_locate()) that allow to nest
 one figure in another.

 g_new() creates a temporary directory in which data and commands will be
 stored in a gnuplot-readable format.

 g_new accepts key, value pairs of arguments, which will be passed to g_set.

 Typical usage:

 g = g_new  (<my options, e.g. on how to display>)
 g = g_data (g, "myChosenDataFileName", data, ...)
 g = g_cmd  (g, <gnuplot commands, e.g.>,\
                "plot 'myChosenDataFileName' with lines",...);
 g_plot     (g,<options on how to plot, e.g. to file>);


 DEMO: Run g_demo(), or see http://gnuplot.sourceforge.net/demo_4.1 on how to
       do nice plots.
 
 SEE ALSO: g_ez, g_delete, g_data, g_cmd, g_plot, g_set, g_locate.

 TODO: an OO style of function call (see failed attempt at end of g_new code)



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 76
 g = g_new ( ...)            - Create a new gnuplot_object and its directory



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 6
g_plot


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 884
 g = g_plot (g,...)            - Plot a gnuplot_object

 If g.values has a field "geometry" of the form, [width, heigth]  or
 "<width>x<height>, it will be used to set the geometry, in pixels of the
 gnuplot window.

 

 OPTIONS:
 "geometry",geometry 

 "-wait" : Gnuplot does not exit immediately, which allows to manipulate the
           plot with the mouse.

 Any string ending in '.eps' causes postscript output. The plot is output to
           that file, and the file is viewed using ggv.

 "-display", yesno : View eps file or not (senseless unless an eps was saved)

 "-color",  yesno : In color or monochrome (for eps and fig)

 All optional arguments other than the options above will be passed to
 _g_instantiate before plotting.

 TODO: Have a better choice of postscript viewers (e.g. gv ...)
       Do the same for .pdf, .fig and .png arguments. 

 See also: g_new,...



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 54
 g = g_plot (g,...)            - Plot a gnuplot_object



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 5
g_set


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 364
 g = g_set (g, key, value, ...)      - Set values.(key) = value

 Used values:
 "title",    string         : Title of the plot. Used (only; TODO; should be
                              used always) if this plot is later inserted in
                              another plot.

 "geometry", "WxH" or [W,H] : Geometry of plot, used by g_plot.

 See also: g_new,...



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 63
 g = g_set (g, key, value, ...)      - Set values.(key) = value



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 6
isuint


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
 yesno = isuint (x)



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
 yesno = isuint (x)




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7
myimage


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 2400
 im2 = myimage (im,...) - Make im viewable by normalizing greylevels and more

 Scales the values of im so that they range in [0,255]. The smallest element
 of im (or range(1), if the "range" option is used) is mapped to zero, and the
 largest (or range(2)) is mapped to 255.

 If both dimensions are less than 180, 

 If the save option is not used, and nargout is 0, then im2 will be displayed,
 rather than returned. NaN and Inf pixels become black or, if the image is
 saved as a .png or .gif, transparent.
 
 OPTIONS:
 --------
 "range", [min,max]   : Graylevel range to be mapped to 0:255. 
                                              Default:[min(im(:)),max(im(:))]
 "qrange", [minq,maxq]: Map quantiles between minq and maxq to 0 and 255.
 "minsz", [Rows,Cols] : Minimum dims of im2. im will be scale by an integral
                        factor so that at least one of its dimensions matches
                        minsz.                Default: [180 180]
 "scl",   scl         : Scale image size up (scl>1) or down (scl<1)
 "invert"             : Invert image (black becomes white and vice versa).

 "is_col"             : Color image, consecutive rows being R, G and B.
 "colormap",          : Convert greylevel image to a 'rainbow' colormap

 "show_range"         : Place a graylevel scale below image.
 "scale_sz",sz        : Width of graylevel scale. Implies show_range.

 "text", [x,y], str   : Annotate image with str, at position x,y, with size sz
 "text", [x,y,sz],str     
 "line", [x,y,x,y,R,G,B,W] or
 "line", [x,y,x,y,R,G,B]   or
 "line", [x,y,x,y,C,W]     or
 "line", [x,y,x,y,C]       or
 "line", [x,y,x,y]  

 "save",    filename  : Save im2 in filename.
 "display", yesno     : Display im2 or not. Default: False iff save requested
                        or nargout!=0. 

 EXAMPLES: type "demo myimage" to run the examples below
 ---------
 myimage (randn(3,3),                    "show_range")
 myimage (rand(9,3),                     "is_col")
 myimage (randn(32,32),                  "minsz",[32,50])
 myimage (ones(64,1)*linspace(0,1,256),  "colormap")
 myimage (linspace(0,3,256)'*ones(1,64), "range",[3 1])
 myimage (zeros(200,200), "text",[10,20],">> 1 + pi\nans = 4.1416\n>>")

 im = kron (ones(4), kron (eye(2),ones(10)));
 im += ones (80,1)*linspace(0,1/2,80);
 myimage (im,"text",[11,5],"Hello","text", [10,30,30],"world")

 FIXME: scl < 1 seems to be buggy



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 77
 im2 = myimage (im,...) - Make im viewable by normalizing greylevels and more





