[Scilab-users] Fwd: plotxxyyy

Jens Simon Strom j.s.strom at hslmg.de
Thu Oct 6 18:20:28 CEST 2016


Hallo Frieder,
You ask  many questions in one post.

1: You just divide the (numerical)  time interval into an adequate 
number of points (which can be neatly accommodated) with linspace or ':' 
and plot the corresponding time text colums via a for-loop. There is no 
need that 'text times' coincide with measured data. They only should be 
placed at the correct locations.

3:You may not be familiar with how to get quick help from Scilab: Just 
highlight the command plot2d or style here and go to the help pages.

4: Highlight newaxes,  foreground

5: I would postpone integrating a checkbox until everything else is to 
your satisfaction. The rest of #5 is perhaps answered by #1.

General remarks

  *   Do not ask many questions simultaneously. Attack them one by one.
    You make it easier for yourself and the helpers.
  * Accompany your questions by short examples which omit irrelevant
    'ornaments'. The code you really write with the variables you really
    use is less appropriate in most cases.
  * Begin to polish the results (color, line types, fonts, fontsize,
    etc.) only as the last step in your work. At the beginning accept
    what Scilab delivers to you.
  * Work the help pages.

My painful experience is that the polishing job often consumes more time 
(and nerves) than the technical problem itself. Scilab is far from 
intuitive in that respect.

Kind regards, Jens
----------------------------------------------

  Am 06.10.2016 15:06, schrieb Frieder Nikolaisen:
> Hello,
>
> to Jens: ich habe Fortschritte gemacht, bin dennoch nicht zum Ergebnis 
> gekommen.
>
> I will write about the problem, in English:
>
> 1. Attached are two plots. The 16 line plot shows the Dates. But even 
> with just 16 lines, it's not easy to read, as there are to many Dates 
> ploted. How can I reduce the number?
> 2. In the plot with 1695 lines, there are no numbers anymore. I used 
> the same code with the same data type, having the 16 first line in 
> common.
> 3. Which paramter does change the color of plot and date?
> 4. I have these blue line on the x axis, how can I turn it off?
> 5. I would like to implement a checkbox, where the user can choose 
> between date and line number. How to print the line number? There are 
> more seconds as lines, so with just chaning the string, it does not fit.
>
> Thank you very much for the prevous help.
>
>
> The not running Code:
>
>     my_handle = scf(100000);
>     clf(my_handle);
>
>     // Preparing data
>     x=((-A(:,1)+A(A_size(:,1))))*24*3600 //offset, time measured in 
> seconds, FN
> //    x  = A(:,1);            //Serial Date Number    geändert durch FN
>     y2 = A(:,y_2);            //              geändert durch FN
>     y3 = A(:,y_3)             //        geändert durch FN
>
>
>     drawlater()
>     // demo_viewCode("plotyyy.dem.sce");
>
>     // Axis y1
>     y1=A(:,y_1);              //              geändert durch FN
>     plot2d(x,y1)
>     xtitle([gettext(string(kT(y_1)) +  string(kT(y_2)) + 
> string(kT(y_3)));" "],..
>     gettext("Serial Date Numbers"),gettext(string(kT(y_1)))); // 
> geändert durch FN
>
>     // Axis y2
>     c=color("blue");
>     na=newaxes();
>     na.foreground=c;
>     na.font_color=c;
>     plot2d(x,y2,style=c)
>     ylabel(string(kT(y_2)),"color",[0 0 1]) // geändert durch FN
>     na.children(1).children(1).thickness=2;
>     na.filled="off";
>     na.axes_visible(1)="off";
> //    na.axes_reverse(2)="on";
>     na.y_location="middle";
>
>     // Axis y3
>     c=color("red");
>     na=newaxes();
>     na.foreground=c;                        // Axis and ticks color
>     na.font_color=c;                        // Labels's color
>     plot2d(x,y3,style=c);
>     ylabel(string(kT(y_3)),"color",[1 0 0]) // geändert durch FN
>     na.filled="off";                        // Transparent background, 
> letting the first plot appearing
>     na.axes_visible(1)="off";               // Masking the x axis 
> (useless overlay)
>     na.y_location="right";                  // Y axis on the right side
>     na.children(1).children(1).thickness=2; // Curve thickness
>
>     //Secound x axis, by Frieder Nikolaisen supported by Jens Simon 
> Strom via Scilab Mailinglist
>
>     drawnow()
>
> dn=A(:,1)
> A_size=size(A)
> fake=zeros(A_size(1,1),1)
> disp(A_size)
> dv=datevec(A(:,1))
> //dv(:,1)=dv(:,1)-2000//two digits only
>     x=((-A(:,1)+A(A_size(:,1))))*24*3600;//offset,time measured in 
> seconds
> plot(x,fake) // with date as YY.MM.DD.HH.MM.SS
>     na.filled="off";                        // Transparent background, 
> letting the first plot appearing
>     na.axes_visible(1)="off";               // Masking the x axis 
> (useless overlay)
>     na.y_location="right";                  // Y axis on the right side
>     na.children(1).children(1).thickness=0; // Curve thickness
> for k=1:A_size(1,1)  //Beschriftung
> xstring(x(k),x(1),string(round(dv(k,:))'))
> end
>
>
>     // DEMO END
> // mclose(plotyyy)
>
> // endfunction
>
> // demo_plotyyy();
> // clear demo_plotyyy;
>
> // Code von Samuel GOUGEON endet
>
> set(handles.Anzeige, 'string','Ausgangsdiagramm erstellt')
>
> endfunction
>
> Best regards
> Frieder
>
>
>
>
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20161006/8be25f8b/attachment.htm>


More information about the users mailing list