Accueil     À propos     Téléchargement     Ressources     Contactez-nous

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

2D graphing and charting
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
 Date: 2007-11-10 (13:22) From: Vu Ngoc San Subject: Re: [Caml-list] 2D graphing and charting
Le Thursday 08 November 2007 04:53:37 Jon Harrop, vous avez écrit :
> I've been using Mathematica to render the graphs on our site, like the ray
> tracer language comparison:
>
>   http://www.ffconsultancy.com/languages/ray_tracer/results.html
>
> What free OCaml software might I use to do the same thing?

I'd love to say: just write the following code, which produces the file
http://perso.univ-rennes1.fr/san.vu-ngoc/images/oplot.eps

But I can't, since I don't have any time to release "oplot" seriously before
at least 6 months. So, sorry for the spam, I just couldn't resist :)

San

open Oplot;;
open Oplotmain;;
open Renderinit;;

let dots () = let rec loop n l = if n = 0 then l else
loop (n-1) ((Random.float 1., Random.float 1.)::l) in
loop 50 [];;

let view = view 0. 0. 1. 1.;;

let a = axis 0. 0.;;

let dots_bla = List.rev_map (fun (x,y) -> (x,y,"blabla")) (dots ());;
let dots_foo = List.rev_map (fun (x,y) -> (x,y,"foofoo")) (dots ());;

let d1 = label_dot_plot ~dot:diamond ~view dots_bla;;
let d2 = label_dot_plot ~dot:diamond ~view dots_foo;;

display ([Color black;view;a;Color red] & d1 & [Color blue] & d2) ~dev:gv;;