[scilab-Users] drawing out of two data files

Sebastian Urban sebastian.urban at kit.edu
Mon Sep 20 15:29:22 CEST 2010


Dear Peng,

you can use the grid property of an axis:

plot(1:4);
myAxis = gca(); myAxis.grid = [1, -1];

The numbers give the grid's color, here the 1 paints a black vertical 
grid, the -1 an invisible horizontal grid.

The grid property (as well as all other graphic properties) is also 
accessible from the gui: Edit -> Figure Properties.

Regards,
Sebastian

On 09/20/2010 03:16 PM, Peng Du wrote:
> Thank you all very much. The solutions look promising.
>
> 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?
>
> Best regards.
>
> On 20 September 2010 13:56, Francis Drossaert <Francis.Drossaert at pgs.com
> <mailto:Francis.Drossaert at pgs.com>> wrote:
>
>     t1 = 0:1/(length(data1)-1):tend;
>
>     t2 = 0:1/(length(data2)-1):tend;
>
>     plot(t1,data1);
>
>     plot(t2,data2);
>
>     where is tend is your time span.
>
>     *From:* Peng Du [mailto:eddy.pdu at gmail.com <mailto:eddy.pdu at gmail.com>]
>     *Sent:* 20 September 2010 13:42
>
>     *To:* users at lists.scilab.org <mailto:users at lists.scilab.org>
>     *Subject:* Re: [scilab-Users] drawing out of two data files
>
>     Thanks for your replies. They are definitely useful but I think it
>     would be better to make my problem clearer:
>
>     Different to the example Antoine provided, my data looks more like
>     data1=[1,5,76,2,7,32,54,6,343,675,454,32,121,5,6,8,]
>     data2=[3,12,43,54,65,76]
>
>     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.
>
>     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.
>
>     So how can I get it done?
>
>     Thanks very much.
>
>     On 20 September 2010 13:08, Francis Drossaert
>     <Francis.Drossaert at pgs.com <mailto:Francis.Drossaert at pgs.com>> wrote:
>
>     Just use plot(x,y) or plot2d(,xy) rather than just plot(y) or
>     plot2d(y). Scilab will plot irregular sampled data correctly.
>
>     For example this will plot a straight line even it irregular sampled:
>
>     x = [0,1,2,3,4,4.5,5,5.5,6];
>
>     y = [1,2,3,4,5,5.5,6,6.5];
>
>     plot(x,y);
>
>     *From:* Peng Du [mailto:eddy.pdu at gmail.com <mailto:eddy.pdu at gmail.com>]
>     *Sent:* 20 September 2010 12:49
>     *To:* users at lists.scilab.org <mailto:users at lists.scilab.org>
>     *Subject:* [scilab-Users] drawing out of two data files
>
>     Hi everyone.
>
>     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.
>
>     Is there any way I can draw them in one graph and have them proper
>     aligned? Thanks a lot.
>
>     Best regards,
>
>     Peng
>
>
>     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.   ­­
>
>

-- 
Karlsruher Institut für Technologie (KIT)
Institut für Stochastik

Sebastian Urban
Wissenschaftlicher Mitarbeiter

Kaiserstraße 89, Allianz-Gebäude (05.20), Zimmer 5A-05
76133 Karlsruhe
Telefon: 0721 608-6967
Fax: 0721 608-6066
E-Mail: sebastian.urban at kit.edu
http://www.math.kit.edu/stoch/~urban/

KIT -- Universität des Landes Baden-Württemberg und nationales 
Forschungszentrum in der Helmholtz-Gemeinschaft



More information about the users mailing list