<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/235654</link>
    <title>MATLAB Central Newsreader - Plotting</title>
    <description>Feed for thread: Plotting</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>Sun, 07 Sep 2008 13:19:01 -0400</pubDate>
      <title>Plotting</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/235654#599116</link>
      <author>Jessica </author>
      <description>Hi,&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
I am trying to create a high-quality graph. Below I have included the code that I am currently using. I have two problems with this code. First, the two lines that the programs draws are not perfectly straight-- they look jagged. Is there a way to make them look straight?&lt;br&gt;
&lt;br&gt;
And second, I would like to create a legend that includes both the type of line and the data point. For example, the legend would read that a thick line and a square point are Data1 while a thin line and &quot;plus&quot; point are Data2.  &lt;br&gt;
&lt;br&gt;
Any suggestions?&lt;br&gt;
&lt;br&gt;
Thanks in advance for your help!&lt;br&gt;
&lt;br&gt;
My Code:&lt;br&gt;
&lt;br&gt;
x1=[1	1	1	1	1	1	1	1	1	1	1	1	1	1	1	1	1	1	3	3	3	3	3	3	3	3	3	3	3	3	3	3	3	3	3	3	5	5	5	5	5	5	5	5	5	5	5	5	5	5	5	5	5	5	7	7	7	7	7	7	7	7	7	7	7	7	7	7	7	7	7	7	9	9	9	9	9	9	9	9	9	9	9	9	9	9	9	9	9	9];&lt;br&gt;
y1=[16.41	32.675	39.455	3.127	40.592	45.003	14.29597827	45.101	2.635	7.954	10.946	17.786	8.164	7.444	11.254	5.248	31.457	39.38	21.944	57.534	41.893	59.09	14.205	43.024	58.483	56.04	0	10.965	17.617	16.281	58.885	33.357	19.021	0	59.488	51.584	41.564	59.786	41.155	60	16.879	29.83	59.495	48.599	0	10.671	18.169	11.141	54.518	35.943	22.59	0	60	54.95	52.286	58.424	43.095	60	16.138	26.869	59.685	47.433	0	27.514	13.633	8.229	50.609	35.557	13.963	0	55.365	54.153	48.967	51.128	15.259	60	18.884	5.292	58.256	49.92	0	42.145	13.321	30.52	49.576	34.803	10.372	0	48.046	55.844];&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
x2=[1	1	1	1	1	1	1	1	1	1	1	1	1	1	1	1	3	3	3	3	3	3	3	3	3	3	3	3	3	3	3	3	5	5	5	5	5	5	5	5	5	5	5	5	5	5	5	5	7	7	7	7	7	7	7	7	7	7	7	7	7	7	7	7	9	9	9	9	9	9	9	9	9	9	9	9	9	9	9	9];&lt;br&gt;
y2=[11.558	8.589	24.195	4.911	9.559	4.957	3.779	21.144	5.232	5.587	8.944	11.748	9.657	7.422	11.198	6.376	6.557	8.084	30	0	7.669	3.86	2.355	51.975	0	1.509	8.704	23.997	9.936	1.58	0	0	0	4.294	27.685	0	2.359	0	4.278	39.953	0	0	36.974	21.975	0	0	0	0	0	0	28.045	0	7.586	0	1.322	25.683	0	0	8.981	0	0	0	0	0	0	0	22.369	0	0	0	4.813	12.283	0	0	1.34	0	0	0	0	0];&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
scatter(x1,y1,30,'k+'); &lt;br&gt;
hold on &lt;br&gt;
scatter(x2,y2,30,'ks');&lt;br&gt;
hold on&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
x = 0.9:1:10;&lt;br&gt;
y3=(-1.0756*x)+12.4321; %Rac&lt;br&gt;
y4=(0.5562*x)+29.1053; %Owl&lt;br&gt;
plot (x,y3,'k','LineWidth',5);&lt;br&gt;
hold on&lt;br&gt;
plot(x,y4,'k','LineWidth',10);&lt;br&gt;
&lt;br&gt;
axis( [0.9, 10, 1, 50] )&lt;br&gt;
xlabel( 'Minute passed' );&lt;br&gt;
ylabel( 'Rate' );</description>
    </item>
    <item>
      <pubDate>Sun, 07 Sep 2008 15:33:02 -0400</pubDate>
      <title>Re: Plotting</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/235654#599129</link>
      <author>Husam Aldahiyat</author>
      <description>To make it not jagged try the myaa function at File Exchange. &lt;br&gt;
&lt;br&gt;
&lt;a href=&quot;http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=20979&amp;objectType=file&quot;&gt;http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=20979&amp;objectType=file&lt;/a&gt;</description>
    </item>
    <item>
      <pubDate>Sun, 07 Sep 2008 20:57:02 -0400</pubDate>
      <title>Re: Plotting</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/235654#599152</link>
      <author>Jessica </author>
      <description>Thanks for that tip. That function did help make the lines smoother but the scatter plot points now look rather faint. Also, it doesn't seem possible to save the myaa graph as a high-quality image? Any further suggestions?&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&quot;Husam Aldahiyat&quot; &amp;lt;numandina@gmail.com&amp;gt; wrote in message &amp;lt;ga0s7e$p07$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; To make it not jagged try the myaa function at File Exchange. &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;a href=&quot;http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=20979&amp;objectType=file&quot;&gt;http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=20979&amp;objectType=file&lt;/a&gt;</description>
    </item>
    <item>
      <pubDate>Mon, 08 Sep 2008 02:36:02 -0400</pubDate>
      <title>Re: Plotting</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/235654#599183</link>
      <author>Husam Aldahiyat</author>
      <description>I think you will need a program to do that outside MATLAB.&lt;br&gt;
&lt;br&gt;
As for the legend question, in case you haven't figured it out yet, here is the answer:&lt;br&gt;
&lt;br&gt;
legend works like this:&lt;br&gt;
&lt;br&gt;
legend([handle1,handle2,handle3],'text1','text2','text3')&lt;br&gt;
&lt;br&gt;
So you will need to obtain the handles of the graphic objects you wish to include in the legend.&lt;br&gt;
&lt;br&gt;
One way to do this is by using findobj, like this:&lt;br&gt;
&lt;br&gt;
h1=findobj('marker','*')&lt;br&gt;
h2=finobj('type','line','color','b')&lt;br&gt;
etc...</description>
    </item>
    <item>
      <pubDate>Mon, 08 Sep 2008 09:37:02 -0400</pubDate>
      <title>Re: Plotting</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/235654#599224</link>
      <author>Gavrilo Bozovic</author>
      <description>You are plotting straight lines --&amp;gt; you'll be best using the &quot;line&quot; function, with only the start and end points of the line. It will all be nice and smooth.&lt;br&gt;
&lt;br&gt;
Then just a side comment: if you want to plot several curves in one set of axes, you just have to type &quot;hold on&quot; once.&lt;br&gt;
&lt;br&gt;
for instance:&lt;br&gt;
&lt;br&gt;
figure,&lt;br&gt;
grid on&lt;br&gt;
hold on&lt;br&gt;
plot(...)&lt;br&gt;
plot(...)&lt;br&gt;
plot(...)&lt;br&gt;
&lt;br&gt;
will do, and so you won't add unncessary lines to your code.</description>
    </item>
    <item>
      <pubDate>Tue, 09 Sep 2008 15:21:03 -0400</pubDate>
      <title>Re: Plotting</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/235654#599480</link>
      <author>Jessica </author>
      <description>thanks for the tip!&lt;br&gt;
&lt;br&gt;
&quot;Gavrilo Bozovic&quot; &amp;lt;gavrilo.bozovic@helbling.ch&amp;gt; wrote in message &amp;lt;ga2rnu$6eh$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; You are plotting straight lines --&amp;gt; you'll be best using the &quot;line&quot; function, with only the start and end points of the line. It will all be nice and smooth.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Then just a side comment: if you want to plot several curves in one set of axes, you just have to type &quot;hold on&quot; once.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; for instance:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; figure,&lt;br&gt;
&amp;gt; grid on&lt;br&gt;
&amp;gt; hold on&lt;br&gt;
&amp;gt; plot(...)&lt;br&gt;
&amp;gt; plot(...)&lt;br&gt;
&amp;gt; plot(...)&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; will do, and so you won't add unncessary lines to your code.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; </description>
    </item>
  </channel>
</rss>

