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 of data1 or data2, in order to correlate the values of both curve?<br><br>Best regards.<br>

<br><div class="gmail_quote">On 20 September 2010 13:56, Francis Drossaert <span dir="ltr"><<a href="mailto:Francis.Drossaert@pgs.com">Francis.Drossaert@pgs.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">










<div link="blue" vlink="purple" lang="EN-GB">

<div>

<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">t1 = 0:1/(length(data1)-1):tend;</span></p>

<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">t2 = 0:1/(length(data2)-1):tend;</span></p>

<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>

<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">plot(t1,data1);</span></p>

<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">plot(t2,data2);</span></p>

<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>

<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">where is tend is your time span. </span></p>

<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>

<div style="border-width: 1pt medium medium; border-style: solid none none; border-color: rgb(181, 196, 223) -moz-use-text-color -moz-use-text-color; padding: 3pt 0cm 0cm;">

<p class="MsoNormal"><b><span style="font-size: 10pt;" lang="EN-US">From:</span></b><span style="font-size: 10pt;" lang="EN-US"> Peng Du [mailto:<a href="mailto:eddy.pdu@gmail.com" target="_blank">eddy.pdu@gmail.com</a>] <br>


<b>Sent:</b> 20 September 2010 13:42<div class="im"><br>
<b>To:</b> <a href="mailto:users@lists.scilab.org" target="_blank">users@lists.scilab.org</a><br>
</div><b>Subject:</b> Re: [scilab-Users] drawing out of two data files</span></p>

</div><div><div></div><div class="h5">

<p class="MsoNormal"> </p>

<p class="MsoNormal" style="margin-bottom: 12pt;">Thanks for your replies. They
are definitely useful but I think it 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 any
mathematical relationship. The first and last value happen at the same moment
("1" in data1 and "3" in data2 happens simultaneously). The
difference in the sizes of data1 and data2 is 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)"
where t denotes the timespan. So that in the graph the "1" in data1
and "3" in data2 are aligned to the identical x-axis position (time)
whilst "8" in data1 and "75" in data2 are also aligned. And
everything else in between should be averagely distributed.<br>
<br>
So how can I get it done?<br>
<br>
Thanks very much.</p>

<div>

<p class="MsoNormal">On 20 September 2010 13:08, Francis Drossaert <<a href="mailto:Francis.Drossaert@pgs.com" target="_blank">Francis.Drossaert@pgs.com</a>>
wrote:</p>

<div>

<div>

<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">Just use plot(x,y) or plot2d(,xy) rather
than just plot(y) or plot2d(y). Scilab will plot irregular sampled data
correctly.</span></p>

<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>

<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">For example this will plot a straight
line even it irregular sampled:</span></p>

<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">x = [0,1,2,3,4,4.5,5,5.5,6];</span></p>

<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">y = [1,2,3,4,5,5.5,6,6.5];</span></p>

<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">plot(x,y);</span></p>

<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>

<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>

<div style="border-width: 1pt medium medium; border-style: solid none none; padding: 3pt 0cm 0cm; border-color: -moz-use-text-color;">

<p class="MsoNormal"><b><span style="font-size: 10pt;" lang="EN-US">From:</span></b><span style="font-size: 10pt;" lang="EN-US"> Peng Du [mailto:<a href="mailto:eddy.pdu@gmail.com" target="_blank">eddy.pdu@gmail.com</a>] <br>


<b>Sent:</b> 20 September 2010 12:49<br>
<b>To:</b> <a href="mailto:users@lists.scilab.org" target="_blank">users@lists.scilab.org</a><br>
<b>Subject:</b> [scilab-Users] drawing out of two data files</span></p>

</div>

<div>

<div>

<p class="MsoNormal"> </p>

<p class="MsoNormal">Hi
everyone.<br>
<br>
I have two data files containing information of the event with the same
timespan but in different sampling rate, i.e. they have 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 aligned?
Thanks a lot.<br>
<br>
Best regards,<br>
<br>
Peng</p>

</div>

</div>

</div>

<p class="MsoNormal"><br>
This e-mail, including any attachments and response string, may contain
proprietary information which is confidential and may be legally privileged. It
is for the intended recipient only. If you are not the intended recipient or
transmission error has misdirected this e-mail, please notify the author by
return e-mail and delete this message and any attachment immediately. If you
are not the intended recipient you must not use, disclose, distribute, forward,
copy, print or rely on this e-mail in any way except as permitted by the
author.   ญญ  </p>

</div>

</div>

<p class="MsoNormal"> </p>

</div></div></div>

</div>


</blockquote></div><br>