Re: [Scilab-users] Fwd: Re: Fwd: plotxxyyy

2016-10-15 Thread Samuel Gougeon

Le 13/10/2016 14:05, Frieder Nikolaisen a écrit :


Dear community,

thank you for you support. I get now wonderful plots.

There is still a feature missing: Plot two has not x grid. *How to add 
a grid without a axis?* (I tried a bit with newaxis... no success)


Aaaarr.. I have forgotten this bug, reported at 
http://bugzilla.scilab.org/13564
An additional evidence that the grid visibility must become independent 
from the axis visibility.


BR
Samuel

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Fwd: Re: Fwd: plotxxyyy

2016-10-13 Thread Jens Simon Strom

Hi FRieder,
The plots look really beautiful. Congratulation!

Normally you should always have an axis. To produce a grid without 
'grid' ('cax.grid=[1 1]', see 'axes_properties', 'grid' in the help 
pages) you can use


x=0:10;  y=-5:5;
[X,Y]=ndgrid(x,y);
xdel();
plot(X,Y)
plot(X',Y')

Kind regards
Jens

.---
Am 13.10.2016 14:05, schrieb Frieder Nikolaisen:


Dear community,

thank you for you support. I get now wonderful plots.

There is still a feature missing: Plot two has not x grid. *How to add 
a grid without a axis?* (I tried a bit with newaxis... no success)


subplot(3,  1,  2)
co  =  color("blue");  
plot2d(x1,  y2,  co);

b  =  gca();
b.font_color  =  co;  
b.foreground  =  co;

*b.axes_visible(1) = "off"; xgrid(co, 1, 10)*
  
  
  
This code works well now:

subplot(3,  1,  3)
co=color("red");
plot2d(x1,  y3,  co);  
xgrid(co,  1,  10)
c  =  gca();  
c.font_color  =  co;  
c.foreground  =  co;  
c.data_bounds  =  [min(x1),min(y3);  max(x1),max(y3)+(max(y3)-min(y3))*0.45]

//c.axes_visible(1) ="off";
ylabel(string(kT(y_3)),"color",co)
xlabel('Sekunden')

x=  (A(:,1)  -  A(1,1))  *  24  *  3600;
//Input parameters for plotting the measurement numbers with optional gaps and 
stacking to avoid overlapping
nstack=5;//maximum number of stacked measurement numbers
hstack=0.3;//height of measurement number stack (relative to window height)
ybase=max(y3)*1;  //base ordinate for measurement numbers
yspan=max(y3)-min(y3);
plot(x1(M),y3(M),  'ko')  // fügt schwarze dots hinzu
for  m=1:length(M)  //Beschriftung
 xstring(x1(M(m)),ybase+(modulo(M(m),nstack))*hstack*yspan/nstack,string(M(m)))
set(handles.Anzeige,  'string',  'Diagrammbeschriftung'  +  string(k)  +  '  von'  +  string(A_size(1,1)))

end
  
  
If I have a few hours nothingelse to do, I will try to solve the prolbem withDenis sparse function. With out using a for loop, it will be faster.

Best regards
Frieder
  
PS: I wanted to send two plots, but they are 111kB. I plead for a higher limit.
  


On 2016-10-12 20:15, Jens Simon Strom wrote:

Hallo Frieder,
If you insert
  plot(x(M),y(M),'go') after//Writing measurement numbers


you get circle marks at the selected points to ease their correlation to 
the measurement number.

Kind regards
Jens
---


Am 12.10.2016 18:16, schrieb Jens Simon Strom:

Hallo Frieder,
You can independently combine stack and skip of the
measurement numbers by the code below.

//Plotting measurement numbers with optional gaps and optional stacking 
to avoid overlapping
//Generating dummy measurement data x,y and plotting them
dx=0.5:50;// increment of x
x=cumsum(dx);
y=sind(x);
yspan=max(y)-min(y);
nM=length(x);//number of measurements
xdel();
plot(x,y,'r')
plot(x,y,'b+')

//Input parameters for plotting the measurement numbers with optional 
gaps and stacking to avoid overlapping
nstack=6;//maximum number of stacked measurement numbers
hstack=0.1;//height of measurement number stack (relative to span). 
hstack=0: no stacking independent of nstack
ybase=-1;  //base ordinate for measurement numbers
step=2;// step=1: no gap, step=2: every second measurement number, etc.

//Writing measurement numbers
M=1:step:nM;//opted measurement numbers
   for  m=1:length(M)   
   xstring(x(M(m)),ybase+(modulo(M(m),nstack))*hstack*yspan/nstack,string(M(m)))

end


"How can I move the lettering above the plot (or at least to the bottom, 
next to the x-axis)?"By data_bounds (see axes_properties in the help pages) you can 
enlarge the y-axis beyond the y data span at will.The y-level of the lettering is 
controlled by the input variable 'ybase' (see code above).


Kind regards
Jens

-

Am 12.10.2016 14:01, schrieb Frieder Nikolaisen:

Hello everybody,

I did solve the Problem with showing only 10 line numbers,
by using IF.

printer=1

for  k=1:A_size(1,1)  //Beschriftung
 *if k>A_size(1,1)*(printer/10) then*  
 printer  =  printer  +  1
 xstring(x(k),y3(1),string(k))
 // xstring(x,y,str,[angle,[box]])
 end  
set(handles.Anzeige,  'string',  'Diagrammbeschriftung'  +  string(k)  +  '  von'  +  string(A_size(1,1)))

end

  


The line numbering is connected to the y-axis. How can I move the 
lattering aboth the plot (or at least the bottom, next to the x-axis)? 
(attached plot: subplot_with_line_number_2_tenth.gif)


[Scilab-users] Fwd: Re: Fwd: plotxxyyy

2016-10-13 Thread Frieder Nikolaisen
 

Dear community, 

thank you for you support. I get now wonderful
plots. 

There is still a feature missing: Plot two has not x grid. HOW
TO ADD A GRID WITHOUT A AXIS? (I tried a bit with newaxis... no success)


subplot(3, 1, 2)
co = color("blue"); 
plot2d(x1, y2, co);
b =
gca();
b.font_color = co; 
b.foreground = co;
B.AXES_VISIBLE(1) = "OFF";
XGRID(CO, 1, 10)

This code works well now: 

subplot(3, 1,
3)
co=color("red");
plot2d(x1, y3, co); 
xgrid(co, 1, 10)
c = gca();

c.font_color = co; 
c.foreground = co; 
c.data_bounds =
[min(x1),min(y3);
max(x1),max(y3)+(max(y3)-min(y3))*0.45]
//c.axes_visible(1) = "off";

ylabel(string(kT(y_3)),"color",co)
xlabel('Sekunden')

x= (A(:,1) -
A(1,1)) * 24 * 3600;
//Input parameters for plotting the measurement
numbers with optional gaps and stacking to avoid overlapping

nstack=5;//maximum number of stacked measurement
numbers
hstack=0.3;//height of measurement number stack (relative to
window height)
ybase=max(y3)*1; //base ordinate for measurement
numbers
yspan=max(y3)-min(y3);
plot(x1(M),y3(M), 'ko') // fügt schwarze
dots hinzu
for m=1:length(M) //Beschriftung

xstring(x1(M(m)),ybase+(modulo(M(m),nstack))*hstack*yspan/nstack,string(M(m)))

set(handles.Anzeige, 'string', 'Diagrammbeschriftung ' + string(k) + '
von ' + string(A_size(1,1)))
end

If I have a few hours nothingelse to
do, I will try to solve the prolbem with Denis sparse function. With out
using a for loop, it will be faster. 

Best regards 
Frieder 

PS: I
wanted to send two plots, but they are 111kB. I plead for a higher
limit. 

On 2016-10-12 20:15, Jens Simon Strom wrote: 

> Hallo
Frieder,
> If you insert 
> plot(x(M),y(M),'go') after //Writing
measurement numbers
> 
> you get circle marks at the selected points to
ease their correlation to the measurement number.
> 
> Kind regards
>
Jens
> ---
> 
>
Am 12.10.2016 18:16, schrieb Jens Simon Strom: 
> 
>> Hallo Frieder,
>>
You can independently combine stack and skip of the measurement numbers
by the code below. 
>> 
>> //Plotting measurement numbers with optional
gaps and optional stacking to avoid overlapping
>> //Generating dummy
measurement data x,y and plotting them
>> dx=0.5:50;// increment of x
>>
x=cumsum(dx);
>> y=sind(x);
>> yspan=max(y)-min(y);
>>
nM=length(x);//number of measurements
>> xdel();
>> plot(x,y,'r')
>>
plot(x,y,'b+')
>> 
>> //Input parameters for plotting the measurement
numbers with optional gaps and stacking to avoid overlapping 
>>
nstack=6;//maximum number of stacked measurement numbers
>>
hstack=0.1;//height of measurement number stack (relative to span).
hstack=0: no stacking independent of nstack 
>> ybase=-1; //base
ordinate for measurement numbers
>> step=2;// step=1: no gap, step=2:
every second measurement number, etc.
>> 
>> //Writing measurement
numbers
>> M=1:step:nM;//opted measurement numbers
>> for m=1:length(M)

>>
xstring(x(M(m)),ybase+(modulo(M(m),nstack))*hstack*yspan/nstack,string(M(m)))
>>
end
>> 
>> "How can I move the lettering above the plot (or at least to
the bottom, next to the x-axis)?" By data_bounds (see axes_properties in
the help pages) you can enlarge the y-axis beyond the y data span at
will. The y-level of the lettering is controlled by the input variable
'ybase' (see code above). 
>> 
>> Kind regards
>> Jens
>>
-
>>

>> Am 12.10.2016 14:01, schrieb Frieder Nikolaisen: 
>> 
>>> Hello
everybody, 
>>> 
>>> I did solve the Problem with showing only 10 line
numbers, by using IF. 
>>> 
>>> printer=1
>>> 
>>> for k=1:A_size(1,1)
//Beschriftung
>>> IF K>A_SIZE(1,1)*(PRINTER/10) THEN 
>>> printer =
printer + 1
>>> xstring(x(k),y3(1),string(k)) 
>>> //
xstring(x,y,str,[angle,[box]])
>>> end 
>>> set(handles.Anzeige,
'string', 'Diagrammbeschriftung ' + string(k) + ' von ' +
string(A_size(1,1)))
>>> end
>>> 
>>> The line numbering is connected to
the y-axis. How can I move the lattering aboth the plot (or at least the
bottom, next to the x-axis)? (attached plot:
subplot_with_line_number_2_tenth.gif)
>>> 
>>> About Jens help: 
>>>

>>> I attached three plots: the stacks Picture are with the Code of
Jens. Stacking is really nice, but I do not need every line number. With
921 data Points, it is already unreadable again. But thanks for your
ideas, the Code is great for learningn anyway. 
>>> 
>>> Cheers
>>> 
>>>
Frieder 
>>> 
>>> On 2016-10-12 11:48, Jens Simon Strom wrote: 
>>>

 Hello Frieder,
 Your plots look better now. You can avoid
overlapping of measurement numbers by sawtooth stacking them. See
example code below.
 
 xdel();
 //Generating dummy
measurements x,y
 dx=0.5:50;
 x=cumsum(dx);
 y=sind(x);

nM=length(x);//number of measurements
 plot(x,y,'r')

plot(x,y,'b+')
 //Plotting the measurement numbers in stacks to
avoid overlapping 
 nstack=6;//number of stacked