Le 28/03/2023 à 14:17, Lester Anderson a écrit :

I am revisiting the Collatz plots

still very nice :-)

and wondered how one can (a) randomise the polyline colours and (b) colour the 
polyline segments from first to last segment given a range of start-to-end 

For b), xsegs() does it. As an example you may try

n = 100;
x = linspace(0,10, n);
y = x + sin(x);
// polyline => set of segments
xs = [x(1,1:$-1) ; x(1,2:$)];
ys = [y(1,1:$-1) ; y(1,2:$)];

gcf().color_map = jetcolormap(n);
plot(x,y); delete(gce()) // to get the axes frame
xsegs(xs, ys, 1:n-1)

gce().thickness = 4;


Best regards

This email and any attachments are intended solely for the use of the 
individual or entity to whom it is addressed and may be confidential and/or 

If you are not one of the named recipients or have received this email in error,

(i) you should not read, disclose, or copy it,

(ii) please notify sender of your receipt by reply email and delete this email 
and all attachments,

(iii) Dassault Systèmes does not accept or assume any liability or 
responsibility for any use of or reliance on this email.

Please be informed that your personal data are processed according to our data 
privacy policy as described on our website. Should you have any questions 
related to personal data protection, please contact 3DS Data Protection Officer 

users mailing list - users@lists.scilab.org
Click here to unsubscribe: <mailto:users-unsubscr...@lists.scilab.org>

Reply via email to