Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Plotting
Date: Sun, 7 Sep 2008 13:19:01 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 37
Message-ID: <ga0kc5$t7g$1@fred.mathworks.com>
Reply-To: <HIDDEN>
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 1220793541 29936 172.30.248.35 (7 Sep 2008 13:19:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 7 Sep 2008 13:19:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1179041
Xref: news.mathworks.com comp.soft-sys.matlab:489024



Hi,


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?

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 "plus" point are Data2.  

Any suggestions?

Thanks in advance for your help!

My Code:

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];
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];


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];
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];


scatter(x1,y1,30,'k+'); 
hold on 
scatter(x2,y2,30,'ks');
hold on


x = 0.9:1:10;
y3=(-1.0756*x)+12.4321; %Rac
y4=(0.5562*x)+29.1053; %Owl
plot (x,y3,'k','LineWidth',5);
hold on
plot(x,y4,'k','LineWidth',10);

axis( [0.9, 10, 1, 50] )
xlabel( 'Minute passed' );
ylabel( 'Rate' );