RSS

(root)/ocaml-gnuplot/trunk : 52 : gnuplot_arr_ba.ml

« back to all changes in this revision

Viewing changes to gnuplot_arr_ba.ml

Christophe Troestler
2009-03-27 22:57:03
Revision ID: christophe.troestler@umons.ac.be-20090327225703-4ev0ptkhmq2yp475
New possibility of using RGB colors.  Added ";" at various places
following some bug reports (not reproducible by me).

Show diffs side-by-side

added added

removed removed

37
37
 
38
38
let x g ?(tag=system_tag) ?(style=Lines) ?(label="") ?(n0=LOWER)
39
39
  ?(ofsx=LOWER) ?(incx=1) (xvec:VEC) =
40
 
  if g.closed then failwith "Gnuplot.ARRAY.x";
41
 
  if ofsx < LOWER || ofsx > UPPER(xvec) || incx < 1 then
42
 
    invalid_arg "Gnuplot.x";
 
40
  if g.closed then failwith "Gnuplot.ARRAY.x: handle closed";
 
41
  if ofsx < LOWER || ofsx > UPPER(xvec) then
 
42
    invalid_arg "Gnuplot.x: ofsx invalid";
 
43
  if incx < 1 then invalid_arg "Gnuplot.x: incx < 1";
43
44
  let rec loop i n out =
44
45
    if i <= UPPER(xvec) then begin
45
46
      out (string_of_int n ^ " " ^ data_of_float(GET(xvec,i)) ^ "\n");
52
53
let xy g ?(tag=system_tag) ?(style=Lines) ?(label="")
53
54
  ?(ofsx=LOWER) ?(incx=1) (xvec:VEC)
54
55
  ?(ofsy=LOWER) ?(incy=1) (yvec:VEC) =
55
 
  if g.closed then failwith "Gnuplot.ARRAY.xy";
 
56
  if g.closed then failwith "Gnuplot.ARRAY.xy: handle closed";
56
57
  if ofsx < LOWER || ofsx > UPPER(xvec) || incx < 1
57
58
    || ofsy < LOWER || ofsy > UPPER(yvec) || incy < 1 then
58
 
    invalid_arg "Gnuplot.xy";
 
59
    invalid_arg "Gnuplot.xy: ofsx, incx, ofxy, or incy invalid";
59
60
  let rec loop i j out =
60
61
    if i <= UPPER(xvec) && j <= UPPER(yvec) then begin
61
62
      out (data_of_float(GET(xvec,i)) ^ " " ^

Loggerhead 1.17 is a web-based interface for Bazaar branches