<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.3.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: Making Pretty Graphs</title>
	<link>http://blogs.mathworks.com/loren/2007/12/11/making-pretty-graphs/</link>
	<description>Loren Shure  works on design of the MATLAB language at &#60;a href="http://www.mathworks.com/"&#62;The MathWorks&#60;/a&#62;. She writes here about once a week on MATLAB programming and related topics. &#60;br&#62;&#60;br&#62;&#60;a href="/images/loren-full.jpg"&#62;&#60;img src="/images/loren.jpg"&#62;&#60;/a&#62;</description>
	<pubDate>Sun, 08 Nov 2009 02:43:11 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.1</generator>
		<item>
		<title>By: Martin Pedersen</title>
		<link>http://blogs.mathworks.com/loren/2007/12/11/making-pretty-graphs/#comment-30602</link>
		<dc:creator>Martin Pedersen</dc:creator>
		<pubDate>Mon, 14 Sep 2009 08:56:13 +0000</pubDate>
		<guid>http://blogs.mathworks.com/loren/2007/12/11/making-pretty-graphs/#comment-30602</guid>
		<description>I have problems generating new tick labels that contains LaTeX code. E.g. this simple example:

&lt;pre&gt;
plot(1:10, 1:10);
set(gca,'XTickLabel','10^4');
&lt;/pre&gt;

It produces 10^4 instead of 10 raised to the power of 5.

I need this when chaning labels on a histogram. There no way in matlab do generate nice histograms of log binned data.

Any suggestions?

Martin</description>
		<content:encoded><![CDATA[<p>I have problems generating new tick labels that contains LaTeX code. E.g. this simple example:</p>
<pre>
plot(1:10, 1:10);
set(gca,'XTickLabel','10^4');
</pre>
<p>It produces 10^4 instead of 10 raised to the power of 5.</p>
<p>I need this when chaning labels on a histogram. There no way in matlab do generate nice histograms of log binned data.</p>
<p>Any suggestions?</p>
<p>Martin</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mat</title>
		<link>http://blogs.mathworks.com/loren/2007/12/11/making-pretty-graphs/#comment-30565</link>
		<dc:creator>Mat</dc:creator>
		<pubDate>Wed, 02 Sep 2009 19:33:12 +0000</pubDate>
		<guid>http://blogs.mathworks.com/loren/2007/12/11/making-pretty-graphs/#comment-30565</guid>
		<description>Jiro, thanks for the great tutorial!

I have one question, though.
I have a problem with the minor and major tick thickness.
When I put my eps graph into my latex code, I can definitely see that the minor and major ticks have a different thickness and are a tiny bit (but noticeably) offset. Like in your last graph the 1000 kg tick for example. You can see that the minor tick is drawn over the major tick, has a different thickness and is a little offset.

Any help would be great

Mat</description>
		<content:encoded><![CDATA[<p>Jiro, thanks for the great tutorial!</p>
<p>I have one question, though.<br />
I have a problem with the minor and major tick thickness.<br />
When I put my eps graph into my latex code, I can definitely see that the minor and major ticks have a different thickness and are a tiny bit (but noticeably) offset. Like in your last graph the 1000 kg tick for example. You can see that the minor tick is drawn over the major tick, has a different thickness and is a little offset.</p>
<p>Any help would be great</p>
<p>Mat</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sean</title>
		<link>http://blogs.mathworks.com/loren/2007/12/11/making-pretty-graphs/#comment-30485</link>
		<dc:creator>Sean</dc:creator>
		<pubDate>Sat, 25 Jul 2009 19:40:32 +0000</pubDate>
		<guid>http://blogs.mathworks.com/loren/2007/12/11/making-pretty-graphs/#comment-30485</guid>
		<description>Great thread Jiro. I do have one suggestion for all the latexers out there though--&lt;i&gt;switch to PDFLatex!!!&lt;/i&gt; It will make your lives many times easier and your documents better looking. MATLAB's pdf generator (at least from the GUI) gives great results that are (best I can tell) 100% compatible with Adobe. This means you can open them directly in Illustrator (which saves as PDF with zero loss and stays vector!) and you can place them into your tex docs with no problem.

I realize that many of you out there may be .eps devotees, but this solution is much more workable than the multiple saves many people describe. Plus, I find that I am able to get the plots much better looking this way, and then if they require subtle editing, I can do it in Illustrator.

I guess the point I'm trying to make is that Latex (pdflatex that is) works great using just .pdf figures, and this is a great option because the .pdf format can store both vector and bitmap information (also, your text stays text this way, instead of rasterizing...), so I think it's the way to go. EPS people will say that .eps does the same thing, but not really, because look how much trouble it is to create a decent looking .eps from MATLAB. Not to mention the fact that .eps files aren't compatible with much at all and very few programs will open them.

So, I'm just saying, save yourself time and effort, get a better quality graphic that many programs can open--it'll still be vector and you can avoid using 1980s technology.</description>
		<content:encoded><![CDATA[<p>Great thread Jiro. I do have one suggestion for all the latexers out there though&#8211;<i>switch to PDFLatex!!!</i> It will make your lives many times easier and your documents better looking. MATLAB&#8217;s pdf generator (at least from the GUI) gives great results that are (best I can tell) 100% compatible with Adobe. This means you can open them directly in Illustrator (which saves as PDF with zero loss and stays vector!) and you can place them into your tex docs with no problem.</p>
<p>I realize that many of you out there may be .eps devotees, but this solution is much more workable than the multiple saves many people describe. Plus, I find that I am able to get the plots much better looking this way, and then if they require subtle editing, I can do it in Illustrator.</p>
<p>I guess the point I&#8217;m trying to make is that Latex (pdflatex that is) works great using just .pdf figures, and this is a great option because the .pdf format can store both vector and bitmap information (also, your text stays text this way, instead of rasterizing&#8230;), so I think it&#8217;s the way to go. EPS people will say that .eps does the same thing, but not really, because look how much trouble it is to create a decent looking .eps from MATLAB. Not to mention the fact that .eps files aren&#8217;t compatible with much at all and very few programs will open them.</p>
<p>So, I&#8217;m just saying, save yourself time and effort, get a better quality graphic that many programs can open&#8211;it&#8217;ll still be vector and you can avoid using 1980s technology.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jiro</title>
		<link>http://blogs.mathworks.com/loren/2007/12/11/making-pretty-graphs/#comment-30469</link>
		<dc:creator>Jiro</dc:creator>
		<pubDate>Tue, 14 Jul 2009 15:43:32 +0000</pubDate>
		<guid>http://blogs.mathworks.com/loren/2007/12/11/making-pretty-graphs/#comment-30469</guid>
		<description>Suresh,

This seems to work on my computer:

&lt;pre&gt;
&lt;code&gt;plot(rand(10,4))
set(gca, 'box', 'off');
set(gca, 'ytick', []);
set(gca, 'ycolor', get(gcf, 'color'));
print -depsc test.eps
&lt;/code&gt;
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Suresh,</p>
<p>This seems to work on my computer:</p>
<pre>
<code>plot(rand(10,4))
set(gca, 'box', 'off');
set(gca, 'ytick', []);
set(gca, 'ycolor', get(gcf, 'color'));
print -depsc test.eps
</code>
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: suresh</title>
		<link>http://blogs.mathworks.com/loren/2007/12/11/making-pretty-graphs/#comment-30465</link>
		<dc:creator>suresh</dc:creator>
		<pubDate>Mon, 13 Jul 2009 13:29:58 +0000</pubDate>
		<guid>http://blogs.mathworks.com/loren/2007/12/11/making-pretty-graphs/#comment-30465</guid>
		<description>I would like to have a XY plot without the Yaxis and Yticks and i want to print the figure to eps file. Even If I put the Yaxis color to background color, in print output Yaxis becomes visible. I searched about this problem. But I couldn't find any solution. If you can help me, that would be greatful.
thank you.</description>
		<content:encoded><![CDATA[<p>I would like to have a XY plot without the Yaxis and Yticks and i want to print the figure to eps file. Even If I put the Yaxis color to background color, in print output Yaxis becomes visible. I searched about this problem. But I couldn&#8217;t find any solution. If you can help me, that would be greatful.<br />
thank you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe P.</title>
		<link>http://blogs.mathworks.com/loren/2007/12/11/making-pretty-graphs/#comment-30448</link>
		<dc:creator>Joe P.</dc:creator>
		<pubDate>Thu, 02 Jul 2009 16:55:51 +0000</pubDate>
		<guid>http://blogs.mathworks.com/loren/2007/12/11/making-pretty-graphs/#comment-30448</guid>
		<description>Paul R. Martin refers to "a chronic problem with cutting-and-pasting MatLab figures using Mac OS X -&#62; Preview -&#62; Adobe illustrator CS".  I am having a problem generating pdf figures to use with pdflatex.  If I export to .pdf directly (on a Mac) the curves look jagged, so I have been exporting to .eps and then using Apple Preview to convert to .pdf.  Recently (since OS 10.5?) the .pdf produced has slightly different fonts than the .eps, for example making them bold where they should not be.  My work-around is to export to .eps, open in Adobe Illustrator, and then save as .pdf.  
Paul - is this the problem you refer to?  If so, can you point me in the right direction of your solution?  Thanks.

Joe</description>
		<content:encoded><![CDATA[<p>Paul R. Martin refers to &#8220;a chronic problem with cutting-and-pasting MatLab figures using Mac OS X -&gt; Preview -&gt; Adobe illustrator CS&#8221;.  I am having a problem generating pdf figures to use with pdflatex.  If I export to .pdf directly (on a Mac) the curves look jagged, so I have been exporting to .eps and then using Apple Preview to convert to .pdf.  Recently (since OS 10.5?) the .pdf produced has slightly different fonts than the .eps, for example making them bold where they should not be.  My work-around is to export to .eps, open in Adobe Illustrator, and then save as .pdf.<br />
Paul - is this the problem you refer to?  If so, can you point me in the right direction of your solution?  Thanks.</p>
<p>Joe</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jiro</title>
		<link>http://blogs.mathworks.com/loren/2007/12/11/making-pretty-graphs/#comment-30347</link>
		<dc:creator>Jiro</dc:creator>
		<pubDate>Tue, 02 Jun 2009 11:43:51 +0000</pubDate>
		<guid>http://blogs.mathworks.com/loren/2007/12/11/making-pretty-graphs/#comment-30347</guid>
		<description>Ben,

You're pretty close. To get different effects in the legend, you should modify the second return value from LEGEND. But you should know which element of the handle array to modify. By doing GET on each of the element of the returned handle array, you'll notice that the array is structured in this way:
&lt;pre&gt;
legend text for line 1
legend text for line 2
...
line style for line 1
marker style for line 1
line style for line 2
marker style for line 2
...
&lt;/pre&gt;

With this in mind, you can change the marker size in the legend this way:

&lt;pre&gt;
&lt;code&gt;plot(rand(10, 4), '.');
[a,b,c,d] = legend('line1', 'line2', 'line3', 'line4');
set(b(6:2:end), 'MarkerSize', 20);
&lt;/code&gt;
&lt;/pre&gt;

Hope this helps.</description>
		<content:encoded><![CDATA[<p>Ben,</p>
<p>You&#8217;re pretty close. To get different effects in the legend, you should modify the second return value from LEGEND. But you should know which element of the handle array to modify. By doing GET on each of the element of the returned handle array, you&#8217;ll notice that the array is structured in this way:</p>
<pre>
legend text for line 1
legend text for line 2
...
line style for line 1
marker style for line 1
line style for line 2
marker style for line 2
...
</pre>
<p>With this in mind, you can change the marker size in the legend this way:</p>
<pre>
<code>plot(rand(10, 4), '.');
[a,b,c,d] = legend('line1', 'line2', 'line3', 'line4');
set(b(6:2:end), 'MarkerSize', 20);
</code>
</pre>
<p>Hope this helps.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben</title>
		<link>http://blogs.mathworks.com/loren/2007/12/11/making-pretty-graphs/#comment-30345</link>
		<dc:creator>Ben</dc:creator>
		<pubDate>Mon, 01 Jun 2009 23:50:41 +0000</pubDate>
		<guid>http://blogs.mathworks.com/loren/2007/12/11/making-pretty-graphs/#comment-30345</guid>
		<description>I have a scatter plot created with plot(x,y,'.') with many data points, so the MarkerSize is quite small.  As a result, it's quite difficult to distinguish the colors in the legend.  Can you help me overcome this?  I've tried to increase the MarkerSize and/or change the Color of the text in the legend, using the handle array which is the second return value from legend, but Matlab seems to ignore all my efforts.  If I instead change the attributes of the third return value, the changes show up in the legend but also in the main plot.

Help, please!  I understand the value of keeping the legend in sync with the plot but surely it should be possible to have a different MarkerSize.</description>
		<content:encoded><![CDATA[<p>I have a scatter plot created with plot(x,y,&#8217;.') with many data points, so the MarkerSize is quite small.  As a result, it&#8217;s quite difficult to distinguish the colors in the legend.  Can you help me overcome this?  I&#8217;ve tried to increase the MarkerSize and/or change the Color of the text in the legend, using the handle array which is the second return value from legend, but Matlab seems to ignore all my efforts.  If I instead change the attributes of the third return value, the changes show up in the legend but also in the main plot.</p>
<p>Help, please!  I understand the value of keeping the legend in sync with the plot but surely it should be possible to have a different MarkerSize.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul R Martin</title>
		<link>http://blogs.mathworks.com/loren/2007/12/11/making-pretty-graphs/#comment-30157</link>
		<dc:creator>Paul R Martin</dc:creator>
		<pubDate>Mon, 30 Mar 2009 05:11:23 +0000</pubDate>
		<guid>http://blogs.mathworks.com/loren/2007/12/11/making-pretty-graphs/#comment-30157</guid>
		<description>Dear Jiro and Loren,

Thank you and other contributors for a fantastic thread. I followed several tips from the thread and got two great results:

1. I fixed a chronic problem with cutting-and-pasting MatLab figures using Mac OS X -&#62; Preview -&#62; Adobe illustrator CS. The problem was MatLab's use of ISO encoding: I'm happy to expand if anyone else wants to know why fonts which look nice in MatLab come out mangled in Illustrator.

2. At last I have pleasantly dashed lines, and round caps on lines and points. Hooray! My eyes really are saying "thank you".

For what it's worth, in my local copy I added the following lines to Jiro's code (the first five lines are his: they set the context):

% Open file and read it in
fid = fopen(varargin{1}, 'r');
str = fread(fid);
str = char(str');
fclose(fid);

%% The following lines fix MatLab's font infelicity and square cap ugliness.

% Use standard (not ISO Latin) encoding
str = strrep(str, 'ISOLatin1Encoding', 'StandardEncoding');

% Set caps to rounded
str = strrep(str, '0 cap', '1 cap');</description>
		<content:encoded><![CDATA[<p>Dear Jiro and Loren,</p>
<p>Thank you and other contributors for a fantastic thread. I followed several tips from the thread and got two great results:</p>
<p>1. I fixed a chronic problem with cutting-and-pasting MatLab figures using Mac OS X -&gt; Preview -&gt; Adobe illustrator CS. The problem was MatLab&#8217;s use of ISO encoding: I&#8217;m happy to expand if anyone else wants to know why fonts which look nice in MatLab come out mangled in Illustrator.</p>
<p>2. At last I have pleasantly dashed lines, and round caps on lines and points. Hooray! My eyes really are saying &#8220;thank you&#8221;.</p>
<p>For what it&#8217;s worth, in my local copy I added the following lines to Jiro&#8217;s code (the first five lines are his: they set the context):</p>
<p>% Open file and read it in<br />
fid = fopen(varargin{1}, &#8216;r&#8217;);<br />
str = fread(fid);<br />
str = char(str&#8217;);<br />
fclose(fid);</p>
<p>%% The following lines fix MatLab&#8217;s font infelicity and square cap ugliness.</p>
<p>% Use standard (not ISO Latin) encoding<br />
str = strrep(str, &#8216;ISOLatin1Encoding&#8217;, &#8216;StandardEncoding&#8217;);</p>
<p>% Set caps to rounded<br />
str = strrep(str, &#8216;0 cap&#8217;, &#8216;1 cap&#8217;);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jiro</title>
		<link>http://blogs.mathworks.com/loren/2007/12/11/making-pretty-graphs/#comment-30156</link>
		<dc:creator>Jiro</dc:creator>
		<pubDate>Sat, 28 Mar 2009 19:09:18 +0000</pubDate>
		<guid>http://blogs.mathworks.com/loren/2007/12/11/making-pretty-graphs/#comment-30156</guid>
		<description>Thanks for your comment, Thomas. I've entered in an enhancement request for it.

In case you haven't checked, there are number of user-contributed functions for doing this:

http://www.mathworks.com/matlabcentral/fileexchange/?term=horizontal+errorbars</description>
		<content:encoded><![CDATA[<p>Thanks for your comment, Thomas. I&#8217;ve entered in an enhancement request for it.</p>
<p>In case you haven&#8217;t checked, there are number of user-contributed functions for doing this:</p>
<p><a href="http://www.mathworks.com/matlabcentral/fileexchange/?term=horizontal+errorbars" rel="nofollow">http://www.mathworks.com/matlabcentral/fileexchange/?term=horizontal+errorbars</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>
