From: Curtis C. <cu...@hi...> - 2004-11-14 22:17:52
|
Firstly, many thanks for PLplot! I will acknowledge my usage of your program at the end of the research article I am currently working on. In any case, I am having a bit of trouble with a couple of areas of PLplot usage: 1) Does the Freetype font interface work with Python yet? Are there any examples of how to implement this? 2) Image plots using the postscript driver come out with streaks across the image, as can be seen by running example x16c and saving to a postscript driver (either ps or psc). 3) Finally, I'd like to use the pstex driver, but the Latex files it creates don't compile on my version of Latex. Any help would be most appreciated! Cheers, Curtis |
From: Alan W. I. <ir...@be...> - 2004-11-15 01:59:47
|
On 2004-11-14 15:17-0700 Curtis Cooper wrote: > Firstly, many thanks for PLplot! I will acknowledge my usage of your > program at the end of the research article I am currently working on. Thanks for those kind words and also the formal research acknowledgement. > > In any case, I am having a bit of trouble with a couple of areas of PLplot > usage: > > 1) Does the Freetype font interface work with Python yet? Are there any > examples of how to implement this? It works for python just as well as for C. :-) There are several freetype issues that are _not_ dependent on the interface language. (a) Only implemented on gd-related devices (png, jpeg, gif). (b) We currently do not access the complete range of font indices. We are currently limited to the first 200 or so characters. (c) Once we get access to the complete range we need a more human-usable way to specify the characters for special symbols. (b) and (c) both substantially limit the use of symbol fonts. There have been plenty of technical discussions to get (b) and (c) straightened out, and I believe it is only a matter of coding now. If you want to give the freetype approach a spin, read src/plfreetype.c for documentation about the environment variables you have to set, and drivers/gd.c for the driver options you have to set to access ordinary character fonts. I have found, that ordinary character results look quite good with device png, for example. Thus, it looks like this approach has outstanding potential for publication-quality plots with a full-range of scientific symbols, but we are not there yet because of issues (b) and (c). > 2) Image plots using the postscript driver come out with streaks across > the image, as can be seen by running example x16c and saving to a > postscript driver (either ps or psc). What platform and what version of PLplot? I have never seen such problems with example 16 on Linux. > 3) Finally, I'd like to use the pstex driver, but the Latex files it > creates don't compile on my version of Latex. This donated code is considered experimental, and nobody has yet stepped forward to maintain/document it. Alan __________________________ Alan W. Irwin email: ir...@be... phone: 250-727-2902 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 __________________________ |
From: Curtis C. <cu...@hi...> - 2004-11-17 05:23:53
|
> > 2) Image plots using the postscript driver come out with streaks across > > the image, as can be seen by running example x16c and saving to a > > postscript driver (either ps or psc). > > What platform and what version of PLplot? I have never seen such problems > with example 16 on Linux. > This happens in both Debian and Mandrake Linux for the Pentium 4. Using PLplot v. 5.3.1 compiled from the source code tarball on the website. |
From: Alan W. I. <ir...@be...> - 2004-11-17 07:21:40
|
On 2004-11-16 22:23-0700 Curtis Cooper wrote: >>> 2) Image plots using the postscript driver come out with streaks across >>> the image, as can be seen by running example x16c and saving to a >>> postscript driver (either ps or psc). >> >> What platform and what version of PLplot? I have never seen such problems >> with example 16 on Linux. >> > > This happens in both Debian and Mandrake Linux for the Pentium 4. > Using PLplot v. 5.3.1 compiled from the source code tarball on the > website. Several of our Developers (including me) use Debian testing so that distro (and probably Mandrake as well) should be okay for you. However, now I have thought about what you have said some more, I realize my comment above has an important qualifier which I failed to state. Antialiasing must be off in the postscript viewer (e.g., gv) to get good looking plots on the screen. Is that the problem you refer to here? Try turning antialiasing off in the postscript viewer to see whether the problem you are referring to goes away. Alan __________________________ Alan W. Irwin email: ir...@be... phone: 250-727-2902 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 __________________________ |
From: Arjen M. <arj...@wl...> - 2004-11-17 07:47:49
|
"Alan W. Irwin" wrote: > > On 2004-11-16 22:23-0700 Curtis Cooper wrote: > > >>> 2) Image plots using the postscript driver come out with streaks across > >>> the image, as can be seen by running example x16c and saving to a > >>> postscript driver (either ps or psc). > >> > >> What platform and what version of PLplot? I have never seen such problems > >> with example 16 on Linux. > >> > > > > This happens in both Debian and Mandrake Linux for the Pentium 4. > > Using PLplot v. 5.3.1 compiled from the source code tarball on the > > website. > > Several of our Developers (including me) use Debian testing so that distro > (and probably Mandrake as well) should be okay for you. However, now I have > thought about what you have said some more, I realize my comment above has > an important qualifier which I failed to state. Antialiasing must be off in > the postscript viewer (e.g., gv) to get good looking plots on the screen. Is > that the problem you refer to here? Try turning antialiasing off in the > postscript viewer to see whether the problem you are referring to goes away. > > Alan I had an error report the other day from a Windows user who has a very similar problem: on screen the picture looks fine, when saved as a PS file horizontal streaks appear. My first thought (I have not had a chance to analyse this yet) is that it has to do with an integer overflow: the horizontal lines coincide with items drawn on the righthand side of the picture, very near the border. One way to get around it might then be to use a larger margin on the righthand side when drawing via PS. Regards, Arjen |
From: Andrew R. <and...@us...> - 2004-11-17 10:07:42
|
On Tue, Nov 16, 2004 at 11:20:03PM -0800, Alan Irwin wrote: > On 2004-11-16 22:23-0700 Curtis Cooper wrote: > > >>>2) Image plots using the postscript driver come out with streaks across > >>>the image, as can be seen by running example x16c and saving to a > >>>postscript driver (either ps or psc). > >> > >>What platform and what version of PLplot? I have never seen such problems > >>with example 16 on Linux. > >> > > > >This happens in both Debian and Mandrake Linux for the Pentium 4. > >Using PLplot v. 5.3.1 compiled from the source code tarball on the > >website. > > Several of our Developers (including me) use Debian testing so that distro > (and probably Mandrake as well) should be okay for you. However, now I have > thought about what you have said some more, I realize my comment above has > an important qualifier which I failed to state. Antialiasing must be off in > the postscript viewer (e.g., gv) to get good looking plots on the screen. Is > that the problem you refer to here? Try turning antialiasing off in the > postscript viewer to see whether the problem you are referring to goes away. I've observed this as a rendering issue with the viewer rather than a plplot problem. Reloading or refreshing the view (by pressing `a' in gv) usually fixes it for me. I have seen similar problems with plots from gnuplot and fixed them the same way. In my experience antialiasing makes no difference to this issue of lines across the plot. Andrew |
From: Alan W. I. <ir...@be...> - 2004-11-17 16:21:48
|
On 2004-11-17 10:07-0000 Andrew Ross wrote: > On Tue, Nov 16, 2004 at 11:20:03PM -0800, Alan Irwin wrote: >> Antialiasing must be off in >> the postscript viewer (e.g., gv) to get good looking plots on the screen. Is >> that the problem you refer to here? Try turning antialiasing off in the >> postscript viewer to see whether the problem you are referring to goes away. > > I've observed this as a rendering issue with the viewer rather than a > plplot problem. Reloading or refreshing the view (by pressing `a' in gv) > usually fixes it for me. I have seen similar problems with plots from > gnuplot and fixed them the same way. In my experience antialiasing makes > no difference to this issue of lines across the plot. Hmmm... I had never heard of that "a" command before, but here is what the gv man page states: A Toggle antialiasing on and off Sure enough, when I tried it on the example 16 postscript file result, antialiasing (along with the artifacts) toggles on and off. So this really is an antialiased rendering issue with this postscript viewer. Arjen, I suggest you also consider this possibility as the source of the artifacts you have seen on windows postscript viewers. Alan __________________________ Alan W. Irwin email: ir...@be... phone: 250-727-2902 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 __________________________ |
From: Andrew R. <and...@us...> - 2004-11-17 20:54:20
|
On Wed, Nov 17, 2004 at 08:21:44AM -0800, Alan Irwin wrote: > On 2004-11-17 10:07-0000 Andrew Ross wrote: > > >On Tue, Nov 16, 2004 at 11:20:03PM -0800, Alan Irwin wrote: > >>Antialiasing must be off in > >>the postscript viewer (e.g., gv) to get good looking plots on the screen. > >>Is > >>that the problem you refer to here? Try turning antialiasing off in the > >>postscript viewer to see whether the problem you are referring to goes > >>away. > > > >I've observed this as a rendering issue with the viewer rather than a > >plplot problem. Reloading or refreshing the view (by pressing `a' in gv) > >usually fixes it for me. I have seen similar problems with plots from > >gnuplot and fixed them the same way. In my experience antialiasing makes > >no difference to this issue of lines across the plot. > > Hmmm... I had never heard of that "a" command before, but here is what the > gv man page states: > > A Toggle antialiasing on and off > > Sure enough, when I tried it on the example 16 postscript file result, > antialiasing (along with the artifacts) toggles on and off. So this really > is an antialiased rendering issue with this postscript viewer. OK. So I should have read the man page... It's a quick way to fix the problem though since gv seems to default to antialiasing on my system and for a lot of things (but not plplot) that's what I want. Andrew |
From: Curtis C. <cu...@hi...> - 2004-11-17 21:34:29
|
There's still a problem related to this, however, which arises when trying to rasterize the PS file output from PLplot. This is useful when making presentations, posters, etc. For the conference I just returned from, I used CorelDRAW to make the poster because it handily imports EPS files. When I rasterized the whole poster, however, the streaks across the page appeared, just as you see when you look at it in gv with antialiasing turned on. Similarly, when you use ImageMagick's convert program to go from PS to PNG or JPEG, the artifacts are visible. I have made similar image plots in IDL that don't manifest this problem when they are saved as PS files, so I'm pretty sure it has something to do with how the PS driver in PLplot is implemented. Any further suggestions would be much appreciated. Cheers, Curtis |
From: Andrew R. <and...@us...> - 2004-11-17 22:05:54
|
I know this doesn't remove the underlying problem, but you will probably get better results using the plplot png or jpg drivers directly rather than going via eps if you intend to rasterize the plots at some stage. Andrew On Wed, Nov 17, 2004 at 02:34:25PM -0700, Curtis Cooper wrote: > There's still a problem related to this, however, which arises when trying > to rasterize the PS file output from PLplot. This is useful when making > presentations, posters, etc. For the conference I just returned from, I > used CorelDRAW to make the poster because it handily imports EPS files. > When I rasterized the whole poster, however, the streaks across the page > appeared, just as you see when you look at it in gv with antialiasing > turned on. Similarly, when you use ImageMagick's convert program to go > from PS to PNG or JPEG, the artifacts are visible. > > I have made similar image plots in IDL that don't manifest this problem > when they are saved as PS files, so I'm pretty sure it has something to do > with how the PS driver in PLplot is implemented. Any further suggestions > would be much appreciated. > > Cheers, > Curtis > |
From: Alan W. I. <ir...@be...> - 2004-11-18 00:16:52
|
On 2004-11-17 14:34-0700 Curtis Cooper wrote: > There's still a problem related to this, however, which arises when trying > to rasterize the PS file output from PLplot. This is useful when making > presentations, posters, etc. For the conference I just returned from, I > used CorelDRAW to make the poster because it handily imports EPS files. > When I rasterized the whole poster, however, the streaks across the page > appeared, just as you see when you look at it in gv with antialiasing > turned on. Similarly, when you use ImageMagick's convert program to go > from PS to PNG or JPEG, the artifacts are visible. I suggest you turn off anti-aliasing for convert (use the +antialias option to turn off the default anti-aliasing in the convert programme.) > > I have made similar image plots in IDL that don't manifest this problem > when they are saved as PS files, so I'm pretty sure it has something to do > with how the PS driver in PLplot is implemented. Any further suggestions > would be much appreciated. I suspect the post-script anti-aliasing is being implemented using variable transparency. Anyhow, it is clear if you look at high-res, what is happening is part of the background or some other hidden part of the plot is leaking through when anti-aliasing is turned on, and there are no such problems when it is turned off. Bill Paxton (one of our users who is something of a postscript expert) has suggested this really is the fault of the antialiasing code associated with postscript converters or viewers. To work around that problem he suggested the following brute-force change. --- ps.c Sat Sep 11 13:46:51 2004 +++ ps_mod.c Sat Sep 11 13:46:28 2004 @@ -296,7 +296,8 @@ fprintf(OF, "/A {0.5 0 360 arc} def\n"); fprintf(OF, "/S {stroke} def\n"); fprintf(OF, "/Z {stroke newpath} def\n"); - fprintf(OF, "/F {fill} def\n"); + fprintf(OF, "/F {gsave 3 setlinewidth stroke grestore fill} bind def\n"); + /*fprintf(OF, "/F {fill} def\n");*/ fprintf(OF, "/C {setrgbcolor} def\n"); fprintf(OF, "/G {setgray} def\n"); fprintf(OF, "/W {setlinewidth} def\n"); I don't understand postscript, but just from the name of the setlinewidth command he is inserting it looks like he is increasing the line width for fills. Anyhow, this did seem to work to get rid of artifacts in example 16 when antialiasing is turned on, and, Curtis, you may want to give this patch a try for your particular problem. OTOH, this patch severely magnifies the surface contour problem (see example 8, pages 4 and 8 for examples). The surface contours are done on top of their associated filled triangles which is a neat trick to hide those surface contours whenever the associated triangle is hidden. However, the contour associated with a given triangle may have its ends slightly misaligned from the triangle edges, and the result is a semi-broken looking surface contour. (I made one unsuccessful attempt to fix this problem, and it is still on my agenda to have another go at fixing this.) Anyhow, Bill's patch above makes this already bad situation much worse (presumably because the extra line width for fills is overlapping (and therefore hiding) parts of adjacent triangles and their associated surface contours). Personally, I think instead of using the above patch and accepting the bad surface contours as a result, it is just easier to avoid antialiasing corrections for viewers or postscript converters (once you are aware of the issue). Of course without antialiasing the labels on the plot won't look as good on screen, but this is not an issue if you are printing the postscript file for a poster rather than just viewing it on screen. Alan __________________________ Alan W. Irwin email: ir...@be... phone: 250-727-2902 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 __________________________ |
From: Rafael L. <rla...@us...> - 2004-11-18 16:45:08
Attachments:
squares.ps
|
* Curtis Cooper <cu...@hi...> [2004-11-17 14:34]: > I have made similar image plots in IDL that don't manifest this problem > when they are saved as PS files, so I'm pretty sure it has something to do > with how the PS driver in PLplot is implemented. Any further suggestions > would be much appreciated. It would be interesting if you could provide one of those PS files produced with IDL, such that we can see if there some tricky PostScript code that we could implement in the PS driver. At any rate, I can hardly imagine how the situation can be improved. The Plplot function plcont generates a series of colored patches which are translated into filled polylines by the PS driver. Adjacent patches are perfectly juxtaposed, meaning that the coordinates in their common borders coincide. I generated a example PostScript file (attached below) with two red squares in a white background that must look like a rectangle. However, when viewing this simple file with gv and antialising activated, I see a white line between the two squares. -- Rafael |