<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/260342</link>
    <title>MATLAB Central Newsreader - contour plot with dashed linespec</title>
    <description>Feed for thread: contour plot with dashed linespec</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Tue, 08 Sep 2009 21:34:04 -0400</pubDate>
      <title>contour plot with dashed linespec</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/260342#678842</link>
      <author>Paul Ullrich</author>
      <description>Hi all,&lt;br&gt;
&lt;br&gt;
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:&lt;br&gt;
&lt;br&gt;
contour(Lon, Lat, Ubig, 'LevelList', 1e-5*[1:2:15], 'LineColor', 'black', 'ShowText', 'off');&lt;br&gt;
hold on;&lt;br&gt;
contour(Lon, Lat, Ubig, '--', 'LevelList', 1e-5*[-15:2:-1], 'LineColor', 'black', 'ShowText', 'off');&lt;br&gt;
hold off;&lt;br&gt;
&lt;br&gt;
However, using these commands the negative contour lines actually appear solid in my plots:&lt;br&gt;
&lt;br&gt;
&lt;a href=&quot;http://www-personal.umich.edu/~paullric/BadPlot.png&quot;&gt;http://www-personal.umich.edu/~paullric/BadPlot.png&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
I can use : as a linespec instead, in which case I get&lt;br&gt;
&lt;br&gt;
&lt;a href=&quot;http://www-personal.umich.edu/~paullric/DotPlot.png&quot;&gt;http://www-personal.umich.edu/~paullric/DotPlot.png&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
which at least lets me identify the negative regions, but is harder to read.  Is there any way I can fix this?</description>
    </item>
    <item>
      <pubDate>Tue, 08 Sep 2009 23:45:22 -0400</pubDate>
      <title>Re: contour plot with dashed linespec</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/260342#678866</link>
      <author>Brendan</author>
      <description>On Sep 8, 6:34&#160;pm, &quot;Paul Ullrich&quot; &amp;lt;ayca...@gmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; Hi all,&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; 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. &#160;I have been using the following command to do so:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; contour(Lon, Lat, Ubig, 'LevelList', 1e-5*[1:2:15], 'LineColor', 'black', 'ShowText', 'off');&lt;br&gt;
&amp;gt; hold on;&lt;br&gt;
&amp;gt; contour(Lon, Lat, Ubig, '--', 'LevelList', 1e-5*[-15:2:-1], 'LineColor', 'black', 'ShowText', 'off');&lt;br&gt;
&amp;gt; hold off;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; However, using these commands the negative contour lines actually appear solid in my plots:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &lt;a href=&quot;http://www-personal.umich.edu/~paullric/BadPlot.png&quot;&gt;http://www-personal.umich.edu/~paullric/BadPlot.png&lt;/a&gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; I can use : as a linespec instead, in which case I get&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &lt;a href=&quot;http://www-personal.umich.edu/~paullric/DotPlot.png&quot;&gt;http://www-personal.umich.edu/~paullric/DotPlot.png&lt;/a&gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; which at least lets me identify the negative regions, but is harder to read. &#160;Is there any way I can fix this?&lt;br&gt;
&lt;br&gt;
Since you are not using colours, I presume you have the need to print&lt;br&gt;
on a non-colour printer. Try using a different renderer for your&lt;br&gt;
figures.&lt;br&gt;
set(gcf, 'Renderer', 'painters')&lt;br&gt;
set(gcf, 'Renderer', 'zbuffer')&lt;br&gt;
set(gcf, 'Renderer', 'opengl')&lt;br&gt;
Trying a different renderer can effect how dashed line patterns&lt;br&gt;
appear. Try using zbuffer and then print -dpng -r300 myfig.png&lt;br&gt;
Using painters with a postscript file can make dots appear very small&lt;br&gt;
(iirc on windows at least).&lt;br&gt;
&lt;br&gt;
Back in the day, being able to set customised dash line patterns was&lt;br&gt;
one of the (very) few advantages of NCAR graphics. Wish Matlab could&lt;br&gt;
do the same.</description>
    </item>
    <item>
      <pubDate>Wed, 09 Sep 2009 02:26:10 -0400</pubDate>
      <title>Re: contour plot with dashed linespec</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/260342#678886</link>
      <author>Paul Ullrich</author>
      <description>Brendan &amp;lt;brendandetracey@yahoo.com&amp;gt; wrote in message &amp;lt;b2ecbdf8-190b-4abd-a9d4-5a08a20f6e21@o21g2000vbl.googlegroups.com&amp;gt;...&lt;br&gt;
&amp;gt; On Sep 8, 6:34?pm, &quot;Paul Ullrich&quot; &amp;lt;ayca...@gmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; &amp;gt; Hi all,&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; 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:&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; contour(Lon, Lat, Ubig, 'LevelList', 1e-5*[1:2:15], 'LineColor', 'black', 'ShowText', 'off');&lt;br&gt;
&amp;gt; &amp;gt; hold on;&lt;br&gt;
&amp;gt; &amp;gt; contour(Lon, Lat, Ubig, '--', 'LevelList', 1e-5*[-15:2:-1], 'LineColor', 'black', 'ShowText', 'off');&lt;br&gt;
&amp;gt; &amp;gt; hold off;&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; However, using these commands the negative contour lines actually appear solid in my plots:&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &lt;a href=&quot;http://www-personal.umich.edu/~paullric/BadPlot.png&quot;&gt;http://www-personal.umich.edu/~paullric/BadPlot.png&lt;/a&gt;&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; I can use : as a linespec instead, in which case I get&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &lt;a href=&quot;http://www-personal.umich.edu/~paullric/DotPlot.png&quot;&gt;http://www-personal.umich.edu/~paullric/DotPlot.png&lt;/a&gt;&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; which at least lets me identify the negative regions, but is harder to read. ?Is there any way I can fix this?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Since you are not using colours, I presume you have the need to print&lt;br&gt;
&amp;gt; on a non-colour printer. Try using a different renderer for your&lt;br&gt;
&amp;gt; figures.&lt;br&gt;
&amp;gt; set(gcf, 'Renderer', 'painters')&lt;br&gt;
&amp;gt; set(gcf, 'Renderer', 'zbuffer')&lt;br&gt;
&amp;gt; set(gcf, 'Renderer', 'opengl')&lt;br&gt;
&amp;gt; Trying a different renderer can effect how dashed line patterns&lt;br&gt;
&amp;gt; appear. Try using zbuffer and then print -dpng -r300 myfig.png&lt;br&gt;
&amp;gt; Using painters with a postscript file can make dots appear very small&lt;br&gt;
&amp;gt; (iirc on windows at least).&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Back in the day, being able to set customised dash line patterns was&lt;br&gt;
&amp;gt; one of the (very) few advantages of NCAR graphics. Wish Matlab could&lt;br&gt;
&amp;gt; do the same.&lt;br&gt;
&lt;br&gt;
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?</description>
    </item>
    <item>
      <pubDate>Wed, 09 Sep 2009 12:37:19 -0400</pubDate>
      <title>Re: contour plot with dashed linespec</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/260342#678997</link>
      <author>Brendan</author>
      <description>On Sep 8, 11:26&#160;pm, &quot;Paul Ullrich&quot; &amp;lt;ayca...@gmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; Brendan &amp;lt;brendandetra...@yahoo.com&amp;gt; wrote in message &amp;lt;b2ecbdf8-190b-4abd-a9d4-5a08a20f6...@o21g2000vbl.googlegroups.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; On Sep 8, 6:34?pm, &quot;Paul Ullrich&quot; &amp;lt;ayca...@gmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Hi all,&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; 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:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; contour(Lon, Lat, Ubig, 'LevelList', 1e-5*[1:2:15], 'LineColor', 'black', 'ShowText', 'off');&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; hold on;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; contour(Lon, Lat, Ubig, '--', 'LevelList', 1e-5*[-15:2:-1], 'LineColor', 'black', 'ShowText', 'off');&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; hold off;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; However, using these commands the negative contour lines actually appear solid in my plots:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;&lt;a href=&quot;http://www-personal.umich.edu/~paullric/BadPlot.png&quot;&gt;http://www-personal.umich.edu/~paullric/BadPlot.png&lt;/a&gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; I can use : as a linespec instead, in which case I get&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;&lt;a href=&quot;http://www-personal.umich.edu/~paullric/DotPlot.png&quot;&gt;http://www-personal.umich.edu/~paullric/DotPlot.png&lt;/a&gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; which at least lets me identify the negative regions, but is harder to read. ?Is there any way I can fix this?&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; Since you are not using colours, I presume you have the need to print&lt;br&gt;
&amp;gt; &amp;gt; on a non-colour printer. Try using a different renderer for your&lt;br&gt;
&amp;gt; &amp;gt; figures.&lt;br&gt;
&amp;gt; &amp;gt; set(gcf, 'Renderer', 'painters')&lt;br&gt;
&amp;gt; &amp;gt; set(gcf, 'Renderer', 'zbuffer')&lt;br&gt;
&amp;gt; &amp;gt; set(gcf, 'Renderer', 'opengl')&lt;br&gt;
&amp;gt; &amp;gt; Trying a different renderer can effect how dashed line patterns&lt;br&gt;
&amp;gt; &amp;gt; appear. Try using zbuffer and then print -dpng -r300 myfig.png&lt;br&gt;
&amp;gt; &amp;gt; Using painters with a postscript file can make dots appear very small&lt;br&gt;
&amp;gt; &amp;gt; (iirc on windows at least).&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; Back in the day, being able to set customised dash line patterns was&lt;br&gt;
&amp;gt; &amp;gt; one of the (very) few advantages of NCAR graphics. Wish Matlab could&lt;br&gt;
&amp;gt; &amp;gt; do the same.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Thanks for the suggestion. &#160;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). &#160;Thoughts?- Hide quoted text -&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; - Show quoted text -&lt;br&gt;
&lt;br&gt;
You are pretty much stuck with bad dots when exporting to a vector&lt;br&gt;
format like postscript, eps, pdf etc. Your only solution is to export&lt;br&gt;
to a bitmap format, as I stated above. You could also try one of the&lt;br&gt;
other two dashed line patterns. If you are not opposed to gray scale,&lt;br&gt;
then you could first use contourf with a two colour colourmap. Sample:&lt;br&gt;
z = peaks(100);&lt;br&gt;
colormap([0.9 0.9 0.9 ; 1 1 1])&lt;br&gt;
contourf(z,'LineStyle','none');&lt;br&gt;
caxis([-10 10])&lt;br&gt;
hold on&lt;br&gt;
contour(z,[0:8],'k');&lt;br&gt;
[c,h] = contour(z,[-8:0]);&lt;br&gt;
set(h,'LineStyle',':','LineColor','k')&lt;br&gt;
contour(z,[0 0],'k','LineWidth',2);&lt;br&gt;
hold off&lt;br&gt;
&lt;br&gt;
With this, for the negative lines you might not even want a dashed&lt;br&gt;
line style, or you might set them to white. You have to play around to&lt;br&gt;
find what looks best. Try making the dashed lines thicker, or use&lt;br&gt;
heavier lines to denote positive values.</description>
    </item>
  </channel>
</rss>

