From: Bruno P. <bru...@cl...> - 2006-09-28 09:47:32
Attachments:
kodama.gif
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type"> </head> <body bgcolor="#ffffff" text="#000000"> Hi all,<br> <br> Is plplot a real equivalent to matlab? of course not, it is better!<br> But, well, am I in front of an issue that may change my mind?<br> NO, it's impossible!! so please, help me!<br> <br> Fast:<br> Is there a plplot equivalent to the matlab function FILL?:<br> FILL Filled 2-D polygons.<br> FILL(X,Y,C) fills the 2-D polygon defined by vectors X and Y<br> with the color specified by C. The vertices of the polygon<br> are specified by pairs of components of X and Y. If necessary,<br> the polygon is closed by connecting the last vertex to the first.<br> <br> Detailled:<br> I'm using PDL plplot interface and i would like to plot an image pixel by pixel<br> (the pixels of this image are rectangular and have different sizes).<br> I've read plplot doc, have a look to x15.pl and x16.pl examples but, well, :-(<br> I have not understood anaything.<br> Anyway, I've found a VERY INEFFICIENT way to do it:<br> $z is my image, (Xpos* and Ypos*) are the limits of each pixels<br> <br> <tt>for ($k=0;$k<$Nbpix;$k++)<br> {<br> $w = ones(2,2)*$z($k);<br> plshades ($w, <br> $XposLeft($k),<br> $XposRight($k),<br> $YposBot($k), <br> $YposUp($k), <br> $shedge, $fill_width,<br> $cont_color, $cont_width, 1, 0, 0, 0);<br> }<br> </tt>Anyway, since $Nbpix is 512*100, the display takes a long time....<br> Perhaps there is a way with \&pltr(1or2) and $cgrid(1or2) as in the examples<br> but i did not understand the impact on the surface....<br> <br> thanks all,<br> <br> best regards,<br> <br> bruno<br> <br> <br> <div class="moz-signature">-- <br> <div align="center"><u>____________________________________________________</u> <br> <font face="Verdana" size="2">Dr. Bruno Picard<br> Dép. Traitement de la Mesure et Segment Sol <br> (Data Analysis and Ground Processing Unit) <br> CLS<br> Dir. Océanographie Spatiale<br> 8-10 rue Hermès, 31520 Ramonville Saint Agne, France<br> <br> Tél: (+33)5.61.39.37.37, Fax: (+33)5.61.39.37.82<br> Mél: <a href="mailto:bru...@cl...">bru...@cl...</a><br> Toile : <a href="http://julie-et-bruno.9online.fr/nono/cadrenono.html" eudora="autourl">http://julie-et-bruno.9online.fr/nono/cadrenono.html</a><br> </font><u>____________________________________________________</u><br> <img src="cid:par...@cl..."><br> </div> </div> </body> </html> |
From: <hba...@ma...> - 2006-09-29 01:35:18
|
On Sep 28, 2006, at 5:47 AM, Bruno Picard wrote: > Fast: > Is there a plplot equivalent to the matlab function FILL?: > FILL Filled 2-D polygons. > FILL(X,Y,C) fills the 2-D polygon defined by vectors X and Y > with the color specified by C. The vertices of the polygon > are specified by pairs of components of X and Y. If necessary, > the polygon is closed by connecting the last vertex to the first. I believe that the function you seek is called plfill. An example using the PDL interface: #!/usr/bin/perl -w use strict; use PDL; use PDL::Graphics::PLplot; plspage(0, 0, 300, 300, 0, 0); plinit(); pladv(0); plvsta(); plwind(0.0, 4.0, 0.0, 4.0); plbox(0.0, 0, 0.0, 0, "bcnst", "bcnstv"); plcol0(2); my $x = pdl(1.0, 1.0, 2.0, 2.5); my $y = pdl(1.0, 2.2, 2.1, 1.0); plfill($x, $y); plend(); The polygon is automatically closed and is drawn with the current color. Also, note that the PDL interface automatically fills in the "n" in plfill(n,x,y). best, -Hazen |
From: Bruno P. <bru...@cl...> - 2006-09-29 07:30:39
Attachments:
kodama.gif
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type"> <title></title> </head> <body bgcolor="#ffffff" text="#000000"> Thanks, Hazen! That's what I was looking for!<br> <br> I've found it in "The PLplot Plotting Library / Programmer's Reference Manual - by MJ LeBrun & G. Furnish"<br> but this manual is C&Fortran oriented and plfill is only descibe with the "n" argument which refers to the vertices to be applied in<br> the polygon.<br> <br> Do anyone know a more PDL oriented reference manual? (the description of the module in cpan is a bit rough...)<br> <br> best,<br> <br> Bruno<br> <br> <a class="moz-txt-link-abbreviated" href="mailto:hba...@ma...">hba...@ma...</a> a écrit : <blockquote cite="mid...@ma..." type="cite"><br> On Sep 28, 2006, at 5:47 AM, Bruno Picard wrote: <br> <br> <blockquote type="cite"> Fast: <br> Is there a plplot equivalent to the matlab function FILL?: <br> FILL Filled 2-D polygons. <br> FILL(X,Y,C) fills the 2-D polygon defined by vectors X and Y <br> with the color specified by C. The vertices of the polygon <br> are specified by pairs of components of X and Y. If necessary, <br> the polygon is closed by connecting the last vertex to the first. <br> </blockquote> <br> I believe that the function you seek is called plfill. <br> <br> An example using the PDL interface: <br> <br> #!/usr/bin/perl -w <br> <br> use strict; <br> use PDL; <br> use PDL::Graphics::PLplot; <br> <br> plspage(0, 0, 300, 300, 0, 0); <br> plinit(); <br> pladv(0); <br> plvsta(); <br> plwind(0.0, 4.0, 0.0, 4.0); <br> plbox(0.0, 0, 0.0, 0, "bcnst", "bcnstv"); <br> <br> plcol0(2); <br> my $x = pdl(1.0, 1.0, 2.0, 2.5); <br> my $y = pdl(1.0, 2.2, 2.1, 1.0); <br> plfill($x, $y); <br> <br> plend(); <br> <br> <br> The polygon is automatically closed and is drawn with the current color. Also, note that the PDL interface automatically fills in the "n" in plfill(n,x,y). <br> <br> best, <br> -Hazen <br> <br> <br> <br> <br> <br> </blockquote> <br> <div class="moz-signature">-- <br> <div align="center"><u>____________________________________________________</u> <br> <font face="Verdana" size="2">Dr. Bruno Picard<br> Dép. Traitement de la Mesure et Segment Sol <br> (Data Analysis and Ground Processing Unit) <br> CLS<br> Dir. Océanographie Spatiale<br> 8-10 rue Hermès, 31520 Ramonville Saint Agne, France<br> <br> Tél: (+33)5.61.39.37.37, Fax: (+33)5.61.39.37.82<br> Mél: <a href="mailto:bru...@cl...">bru...@cl...</a><br> Toile : <a href="http://julie-et-bruno.9online.fr/nono/cadrenono.html" eudora="autourl">http://julie-et-bruno.9online.fr/nono/cadrenono.html</a><br> </font><u>____________________________________________________</u><br> <img src="cid:par...@cl..."><br> </div> </div> </body> </html> |
From: Alan W. I. <ir...@be...> - 2006-09-29 16:58:49
|
> Thanks, Hazen! That's what I was looking for! > I've found it in "The PLplot Plotting Library / Programmer's > Reference Manual - by MJ LeBrun & G. Furnish" > but this manual is C&Fortran oriented and plfill is only descibe with > the "n" argument which refers to the vertices to be applied in > the polygon. > > Do anyone know a more PDL oriented reference manual? (the description > of the module in cpan is a bit rough...) I don't think there is one. I agree our manual (most up-to-date version is at http://plplot.sourceforge.net/docbook-manual/plplot-html-5.6.1/) is currently oriented toward C, fortran 77 (and Tcl/Tk) and needs lots of work in describing all our other computer language interfaces. Currently our best documentation of the Fortran 95, Python, Java, and Perl/PDL interfaces to PLplot is through our set of working examples in the examples sub-directory of our tarball and also available at http://plplot.sourceforge.net/examples/index.html. In general all those mentioned language interfaces are essentially identical to the well-documented C interface except that the redundant array dimensions have been dropped from argument lists (as you can see also from looking at the examples). 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 Yorick front-end to PLplot (yplot.sf.net); the Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project (lbproject.sf.net). __________________________ Linux-powered Science __________________________ |