Path: news.mathworks.com!not-for-mail
From: "Paul Ullrich" <aycarus@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: contour plot with dashed linespec
Date: Wed, 9 Sep 2009 02:26:10 +0000 (UTC)
Organization: University of Michigan
Lines: 37
Message-ID: <h873o2$pls$1@fred.mathworks.com>
References: <h86ikc$cmq$1@fred.mathworks.com> <b2ecbdf8-190b-4abd-a9d4-5a08a20f6e21@o21g2000vbl.googlegroups.com>
Reply-To: "Paul Ullrich" <aycarus@gmail.com>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1252463170 26300 172.30.248.35 (9 Sep 2009 02:26:10 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 9 Sep 2009 02:26:10 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1972219
Xref: news.mathworks.com comp.soft-sys.matlab:569128


Brendan <brendandetracey@yahoo.com> wrote in message <b2ecbdf8-190b-4abd-a9d4-5a08a20f6e21@o21g2000vbl.googlegroups.com>...
> On Sep 8, 6:34?pm, "Paul Ullrich" <ayca...@gmail.com> wrote:
> > Hi all,
> >
> > I've recently been plotting fluid flows using MATLAB's contour command and wanted to separately identify contour lines of positive and negative using solid and dashed linespec, respectively. ?I have been using the following command to do so:
> >
> > contour(Lon, Lat, Ubig, 'LevelList', 1e-5*[1:2:15], 'LineColor', 'black', 'ShowText', 'off');
> > hold on;
> > contour(Lon, Lat, Ubig, '--', 'LevelList', 1e-5*[-15:2:-1], 'LineColor', 'black', 'ShowText', 'off');
> > hold off;
> >
> > However, using these commands the negative contour lines actually appear solid in my plots:
> >
> > http://www-personal.umich.edu/~paullric/BadPlot.png
> >
> > I can use : as a linespec instead, in which case I get
> >
> > http://www-personal.umich.edu/~paullric/DotPlot.png
> >
> > which at least lets me identify the negative regions, but is harder to read. ?Is there any way I can fix this?
> 
> Since you are not using colours, I presume you have the need to print
> on a non-colour printer. Try using a different renderer for your
> figures.
> set(gcf, 'Renderer', 'painters')
> set(gcf, 'Renderer', 'zbuffer')
> set(gcf, 'Renderer', 'opengl')
> Trying a different renderer can effect how dashed line patterns
> appear. Try using zbuffer and then print -dpng -r300 myfig.png
> Using painters with a postscript file can make dots appear very small
> (iirc on windows at least).
> 
> Back in the day, being able to set customised dash line patterns was
> one of the (very) few advantages of NCAR graphics. Wish Matlab could
> do the same.

Thanks for the suggestion.  The dashed lines look perfect using either zbuffer or opengl, but if I try to export the resulting image to a eps file or pdf file the lines are not smooth (unlike with the painters renderer).  Thoughts?