[Scilab-users] {EXT} Re: finding reasonable axis markers for plotting a random data set

christophk christoph.knappe at gmail.com
Mon Nov 14 15:12:02 CET 2016


Btw, Christophe - your solution does not give the option to specify the
desired number axismarkers which I express using the function input variable
"steps". 

I have now compressed the code from my example further according to your
good suggestions and attach it as a file in case anyone likes to try it. 

create_steps.sci
<http://mailinglists.scilab.org/file/n4034978/create_steps.sci>  

I guess there is no other easy way to do what I wanted. However, if anyone
likes to hint me on how to do one of the following things with my example
plot code I'd be very happy: 

function create_plot(x,y,colors,axlabels,title)
    colors = colors(1:size(x,2));  
   
plot2d(x,y,colors,leg="L1 at L2@L3",nax=[2,10,2,10],rect=[floor(min(x)),floor(min(y)),ceil(max(x)),ceil(max(y))]);
    set(gca(),"grid",[1 1]);
    xtitle(title);
    xlabel(axlabels(1));
    ylabel(axlabels(2));
    //mtlb_axis([min(x), max(x), min(y)-0.1*(max(y)-min(y)),
max(y)+0.1*(max(y)-min(y))]);
endfunction

title1 = "plot title";
colors1 = 1:20;
axlabels1 = ['x-axis [a.u.]';'y-axis [a.u.]'];
x1 =
[linspace(-2*%pi,2*%pi,201)',%nan*ones(201,1),linspace(-2*%pi,2*%pi,201)'];
y1 = [cos(x1(:,1)),%nan*ones(201,1),5.5*sin(x1(:,3))];
create_plot(x1,y1,colors1,axlabels1,title1)

1. I wonder whether I could move the legend around in the graph and omit
certain legends where only NaN values are presented.
2. I want to resize axis labels and change to a more bold line thickness for
the graphs
3. is there a list of character makers that I could use for indicating
points in the plots e.g. "plot(x,y,'-o')"
Not sure how it works in plot2.

Should I use plot instead of plot2 - I don't quite know which one is best
for my purpose, they look similar only to the point of different syntax.




--
View this message in context: http://mailinglists.scilab.org/finding-reasonable-axis-markers-for-plotting-a-random-data-set-tp4034957p4034978.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com.



More information about the users mailing list