<html><body bgcolor="#FFFFFF"><div>If you have different sample rates then build a new time variable for each  </div><div><br></div><div>example:</div><div><br></div><div>t1=[0 60 120 180...]</div><div>t2=[0 5 10 15 20...]</div><div><br></div><div>Regards,</div><div>Petar Knezevich</div><div><br>On 2010-09-20, at 17:41, Peng Du <<a href="mailto:eddy.pdu@gmail.com">eddy.pdu@gmail.com</a>> wrote:<br><br></div><div></div><blockquote type="cite"><div>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.<br><br><div class="gmail_quote">On 20 September 2010 13:08, Francis Drossaert <span dir="ltr"><<a href="mailto:Francis.Drossaert@pgs.com"><a href="mailto:Francis.Drossaert@pgs.com">Francis.Drossaert@pgs.com</a></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);">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; 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"><a href="mailto:eddy.pdu@gmail.com">eddy.pdu@gmail.com</a></a>] <br>


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

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

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

<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.
  ­­  </div>


</blockquote></div><br>
</div></blockquote></body></html>