From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id KAA31124; Mon, 22 Sep 2003 10:38:37 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id KAA22775 for ; Mon, 22 Sep 2003 10:38:36 +0200 (MET DST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h8M8cZH06964; Mon, 22 Sep 2003 10:38:35 +0200 (MET DST) Received: from inria.fr (bourg.inria.fr [128.93.11.100]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id KAA20550; Mon, 22 Sep 2003 10:38:35 +0200 (MET DST) Message-ID: <3F6EB4ED.9090107@inria.fr> Date: Mon, 22 Sep 2003 10:38:05 +0200 From: Basile Starynkevitch User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030908 Debian/1.4-4 X-Accept-Language: en MIME-Version: 1.0 To: PL CC: caml-list@inria.fr Subject: Re: [Caml-list] how can I print graphics on my local printer under Linux? References: <3F6AB7CB.6020505@abc.se> <1063969848.27470.42.camel@pelican> <20030919144920.GC4205@redhat.com> <1064085899.2679.58.camel@pelican> <3F6CB865.8030902@socialtools.net> <1064145147.11705.46.camel@pelican> <001d01c38051$4afb37f0$f6d83251@rosim> <20030921161556.GA451@swordfish> <002701c380e1$0a429b00$56d83251@rosim> In-Reply-To: <002701c380e1$0a429b00$56d83251@rosim> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Loop: caml-list@inria.fr X-Spam: no; 0.00; basile:01 basile:01 caml-list:01 camlimages:01 advi:01 camlimages:01 gnuplot:01 -and:99 debugger:01 datatypes:01 simplistic:01 stdlib:01 fprintf:01 fprintf:01 val:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk PL wrote: > > I am doing graphics with Caml. These graphs are drawn in a new window on my > screen, > opened by Caml. I would like to have these graphs printed on my local > printer. May I suggest using the camlimages library (also used in advi)? See http://pauillac.inria.fr/camlimages/ for more. Another option would be (on unix or linux systems) to open a pipe to some software like gnuplot, latex, lout, troff, etc etc.... The Graphics library is portable, but (IMHO) not very rich (because of the portability issue). > I have troubles understanding the #install_printer intruction of Caml. This question is (I suppose) unrelated to the previous one. The #install_printer directive (only available with the interactive toplevel -and perhaps in the debugger) tell the toplevel how to print your datatypes (usually abstract ones). Here is a simplistic example (where @. is a pretty printing indication, see the Format module documentation of the stdlib # type color_t = Blue | Red;; type color_t = Blue | Red # let color_printer ff col = match col with Blue -> Format.fprintf ff "Blue_Color@." | Red -> Format.fprintf ff "Red_Color@." ;; val color_printer : Format.formatter -> color_t -> unit = # #install_printer color_printer;; # Blue;; - : color_t = Blue_Color Hope above will help you -- Basile STARYNKEVITCH -- basile dot starynkevitch at inria dot fr Project cristal.inria.fr - phone +33 1 3963 5197 - mobile 6 8501 2359 home email: basile at starynkevitch dot net all opinions are only mine ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners