Dear Sebastian,<br><br>Thanks for the reply.<br><br>The grid appears to always divide the graph into 10 sections regardless of the value in the plot command. Is there any way to change it?<br><br>Also it would be ideal if the vertical lines are only drawn at the value points of the curve of data1 or date2, rather than at the pre-defined intervals. Do you think it is possible?<br>
<br>Best,<br><br>Peng<br><br><br><div class="gmail_quote">2010/9/20 Sebastian Urban <span dir="ltr"><<a href="mailto:sebastian.urban@kit.edu">sebastian.urban@kit.edu</a>></span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Dear Peng,<br>
<br>
you can use the grid property of an axis:<br>
<br>
plot(1:4);<br>
myAxis = gca(); myAxis.grid = [1, -1];<br>
<br>
The numbers give the grid's color, here the 1 paints a black vertical grid, the -1 an invisible horizontal grid.<br>
<br>
The grid property (as well as all other graphic properties) is also accessible from the gui: Edit -> Figure Properties.<br>
<br>
Regards,<br>
Sebastian<div class="im"><br>
<br>
On 09/20/2010 03:16 PM, Peng Du wrote:<br>
</div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="im">
Thank you all very much. The solutions look promising.<br>
<br>
Another thing is how can I draw a vertical line at some specific point<br>
of data1 or data2, in order to correlate the values of both curve?<br>
<br>
Best regards.<br>
<br>
On 20 September 2010 13:56, Francis Drossaert <<a href="mailto:Francis.Drossaert@pgs.com" target="_blank">Francis.Drossaert@pgs.com</a><br></div><div class="im">
<mailto:<a href="mailto:Francis.Drossaert@pgs.com" target="_blank">Francis.Drossaert@pgs.com</a>>> wrote:<br>
<br>
t1 = 0:1/(length(data1)-1):tend;<br>
<br>
t2 = 0:1/(length(data2)-1):tend;<br>
<br>
plot(t1,data1);<br>
<br>
plot(t2,data2);<br>
<br>
where is tend is your time span.<br>
<br></div>
*From:* Peng Du [mailto:<a href="mailto:eddy.pdu@gmail.com" target="_blank">eddy.pdu@gmail.com</a> <mailto:<a href="mailto:eddy.pdu@gmail.com" target="_blank">eddy.pdu@gmail.com</a>>]<div class="im"><br>
*Sent:* 20 September 2010 13:42<br>
<br></div>
*To:* <a href="mailto:users@lists.scilab.org" target="_blank">users@lists.scilab.org</a> <mailto:<a href="mailto:users@lists.scilab.org" target="_blank">users@lists.scilab.org</a>><div class="im"><br>
*Subject:* Re: [scilab-Users] drawing out of two data files<br>
<br>
Thanks for your replies. They are definitely useful but I think it<br>
would be better to make my problem clearer:<br>
<br>
Different to the example Antoine provided, my data looks more like<br>
data1=[1,5,76,2,7,32,54,6,343,675,454,32,121,5,6,8,]<br>
data2=[3,12,43,54,65,76]<br>
<br>
They are the data collected from an experiment and unlikely to have<br>
any mathematical relationship. The first and last value happen at<br>
the same moment ("1" in data1 and "3" in data2 happens<br>
simultaneously). The difference in the sizes of data1 and data2 is<br>
due to the different sampling rate when collecting data.<br>
<br>
What I'd like to do is something like "plot(t,data1); plot(t,data2)"<br>
where t denotes the timespan. So that in the graph the "1" in data1<br>
and "3" in data2 are aligned to the identical x-axis position (time)<br>
whilst "8" in data1 and "75" in data2 are also aligned. And<br>
everything else in between should be averagely distributed.<br>
<br>
So how can I get it done?<br>
<br>
Thanks very much.<br>
<br>
On 20 September 2010 13:08, Francis Drossaert<br></div><div class="im">
<<a href="mailto:Francis.Drossaert@pgs.com" target="_blank">Francis.Drossaert@pgs.com</a> <mailto:<a href="mailto:Francis.Drossaert@pgs.com" target="_blank">Francis.Drossaert@pgs.com</a>>> wrote:<br>
<br>
Just use plot(x,y) or plot2d(,xy) rather than just plot(y) or<br>
plot2d(y). Scilab will plot irregular sampled data correctly.<br>
<br>
For example this will plot a straight line even it irregular sampled:<br>
<br>
x = [0,1,2,3,4,4.5,5,5.5,6];<br>
<br>
y = [1,2,3,4,5,5.5,6,6.5];<br>
<br>
plot(x,y);<br>
<br></div>
*From:* Peng Du [mailto:<a href="mailto:eddy.pdu@gmail.com" target="_blank">eddy.pdu@gmail.com</a> <mailto:<a href="mailto:eddy.pdu@gmail.com" target="_blank">eddy.pdu@gmail.com</a>>]<div class="im"><br>
*Sent:* 20 September 2010 12:49<br></div>
*To:* <a href="mailto:users@lists.scilab.org" target="_blank">users@lists.scilab.org</a> <mailto:<a href="mailto:users@lists.scilab.org" target="_blank">users@lists.scilab.org</a>><div class="im"><br>
*Subject:* [scilab-Users] drawing out of two data files<br>
<br>
Hi everyone.<br>
<br>
I have two data files containing information of the event with the<br>
same timespan but in different sampling rate, i.e. they have<br>
different sizes but the first and last line denote the identical moment.<br>
<br>
Is there any way I can draw them in one graph and have them proper<br>
aligned? Thanks a lot.<br>
<br>
Best regards,<br>
<br>
Peng<br>
<br>
<br>
This e-mail, including any attachments and response string, may<br>
contain proprietary information which is confidential and may be<br>
legally privileged. It is for the intended recipient only. If you<br>
are not the intended recipient or transmission error has misdirected<br>
this e-mail, please notify the author by return e-mail and delete<br>
this message and any attachment immediately. If you are not the<br>
intended recipient you must not use, disclose, distribute, forward,<br>
copy, print or rely on this e-mail in any way except as permitted by<br>
the author. <br>
<br>
<br>
</div></blockquote>
<br>
-- <br>
Karlsruher Institut für Technologie (KIT)<br>
Institut für Stochastik<br>
<br>
Sebastian Urban<br>
Wissenschaftlicher Mitarbeiter<br>
<br>
Kaiserstraße 89, Allianz-Gebäude (05.20), Zimmer 5A-05<br>
76133 Karlsruhe<br>
Telefon: 0721 608-6967<br>
Fax: 0721 608-6066<br>
E-Mail: <a href="mailto:sebastian.urban@kit.edu" target="_blank">sebastian.urban@kit.edu</a><br>
<a href="http://www.math.kit.edu/stoch/%7Eurban/" target="_blank">http://www.math.kit.edu/stoch/~urban/</a><br>
<br>
KIT -- Universität des Landes Baden-Württemberg und nationales Forschungszentrum in der Helmholtz-Gemeinschaft<br>
</blockquote></div><br>