[scilab-Users] drawing out of two data files

Sebastian Urban sebastian.urban at kit.edu
Mon Sep 20 16:36:22 CEST 2010


Sure, just add

myAxis.x_ticks.locations = [1;1.5;2;2.5;3;3.5;4];
myAxis.x_ticks.labels = ["1.0";"1.5";"2.0";"2.5";"3.0";"3.5";"4.0"];

Choose the tick locations and labels as you desire it. Again, that's 
also accessible from the GUI via Edit -> Axes properties.

Maybe you should start with a tutorial on plotting, as these are basic 
tasks. There are lots of these around (just google) or start directly at 
the official website:

http://wiki.scilab.org/Tutorials

Regards, Sebastian

On 09/20/2010 04:12 PM, Peng Du wrote:
> Dear Sebastian,
>
> Thanks for the reply.
>
> 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?
>
> 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?
>
> Best,
>
> Peng
>
>
> 2010/9/20 Sebastian Urban <sebastian.urban at kit.edu
> <mailto:sebastian.urban at kit.edu>>
>
>     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>
>         <mailto: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> <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>
>         <mailto: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>
>         <mailto: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> <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>
>         <mailto: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 <mailto:sebastian.urban at kit.edu>
>     http://www.math.kit.edu/stoch/~urban/
>     <http://www.math.kit.edu/stoch/%7Eurban/>
>
>     KIT -- Universität des Landes Baden-Württemberg und nationales
>     Forschungszentrum in der Helmholtz-Gemeinschaft
>
>

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