From: Alan W. I. <ir...@be...> - 2008-01-10 17:53:15
|
On 2008-01-10 12:28+0100 Antonio, Fabio Di Narzo wrote: > Hi all. > I'm trying to use plplot for drawing png images. How can I specify the > image size (width and height)? Is there some common method for other > file/screen devices? > > I currently use the following skeleton code for my drawings: > plsdev("png"); > plsfnam("tmp.png"); > plinit(); > ... > plend(); Your primary question has already been answered by Werner, but I also want to encourage you to use command-line options rather than hard coding devices, filenames, and geometries. Thus, I would advise replacing the plsdev and plsfnam commands above with (void) plparseopts(&argc, argv, PL_PARSE_FULL); Then run your application like this: ./myplplot_application -dev png -o tmp.png -geometry 800x600 If you want to see the equivalent PostScript results, then use ./myplplot_application -dev psc -o tmp.ps To find all command-line options available to you use ./myplplot_application -h Alan __________________________ Alan W. Irwin Astronomical research affiliation with Department of Physics and Astronomy, University of Victoria (astrowww.phys.uvic.ca). Programming affiliations with the FreeEOS equation-of-state implementation for stellar interiors (freeeos.sf.net); PLplot scientific plotting software package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project (lbproject.sf.net). __________________________ Linux-powered Science __________________________ |