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

christophk christoph.knappe at gmail.com
Mon Nov 14 12:05:48 CET 2016


Hey Christophe,

thank you for taking your time to respond to my post. Your feedback is
really valuable for me.
Of course I should have thought on the log10 -function, I don't know why it
hasn't occurred to me. :)

So this is the code I am testing with and that made me want to create more
reasonable axis markers - I want to have a certain control over the plot
limits as I might autocreate a lot of similar plots and want to force the
same axis limits to all for comparability. In this example, I am not
satisfied with the odd axis ticks see attached example. Zero should alway be
a tick if it is within the axis intervals. 
There are a few other things that I am wondering on how to do later:
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.

Perhaps I should 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.

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)

Odd_axis_labels.pdf
<http://mailinglists.scilab.org/file/n4034974/Odd_axis_labels.pdf>  



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



More information about the users mailing list