the diagram is drawn with 3 axis. #1: only for the center axis and the labels --> plot something but make the plot invisible...plot contains only two points #2: only for the frame --> plot something but make the plot invisible #3: for the actual plot
you can zoom, but if you move the plotted graph, the center axis remains at it's position. here the code: x = linspace(-2*%pi,2*%pi,201);y = cos(x); // second plotx2 = linspace(min(x),max(x),2);y2 = linspace(min(y),max(y),2); // first plot// used to set the cross in the center// and place the x-y-label & titleplot2d(x2,y2,2)a1=gca(); // create a single axis for only the frame// enabling to change frame thiknessa2 = newaxes();plot2d(x2, y2); // third plot// containing the actual grapha3 = newaxes();plot2d(x,y,2); // axis locationsa1.x_location = "origin";a1.y_location = "origin";a2.x_location; // doesnt matter because a2 axes are invisiblea2.y_location; // doesnt matter because a2 axes are invisiblea3.x_location = "bottom";a3.y_location = "left"; // ticksa1.auto_ticks = 'off';a2.auto_ticks = 'off';a3.auto_ticks = 'on'; // boxa2.box = "on"; // hide graphsa1.children.visible = "off"; // hide a1 grapha2.children.visible = 'off'; // hide a2 graph // filled axis?a1.filled = "on";a2.filled = "off";a3.filled = "off"; // set axes visibilitya1.axes_visible = ["on","on","off"];a2.axes_visible = ["off","off","off"];a3.axes_visible = ["on","on","off"]; // set gridsa1.grid = [-1,-1]; // do not display grid from 1st plota2.grid = [-1,-1]; // do not display grid from 1st plota3.grid = [1, 1]; // show grid from 3rd plot // setting thicknessesa1.thickness = 2;a2.thickness = 2;a3.thickness = 1; // setting data_bounds;a1.data_bounds = [min(x),min(y);max(x),max(y)];a2.data_bounds = [min(x),min(y);max(x),max(y)];a3.data_bounds = [min(x),min(y);max(x),max(y)]; // setting tight limitsa1.tight_limits = "off";a2.tight_limits = "on";a3.tight_limits = "on"; // set titlea1.title.text = "creating a nice plot using ''newaxes( )'' ";a1.title.font_size = 2;a1.title.position = [- 3.3748634 1.1]; // set labelsa1.x_label.text = "x axis";a1.y_label.text = "y axis"; a1.x_label.position = [-0.5770492 -1.2550725];a1.y_label.position = [-9.084153 -0.0956522]; a1.x_label.font_size = 2;a1.y_label.font_size = 2; // set polyline stylea3.children.children.thickness = 2; 2016-11-19 17:41 GMT+01:00 Samuel Gougeon <[email protected]>: > Le 19/11/2016 17:35, christophk a écrit : > > "So what about this?...see attachment." > > It's beautiful - how did you do this? > > I guess that the (default) axis properties are *heritated* from the axes > ones. > So to get a thicker axis, you must first thicken the axes, and > *afterwards* run drawaxis() > > > _______________________________________________ > users mailing list > [email protected] > http://lists.scilab.org/mailman/listinfo/users > > -- In Kanada is' ka' na' da. Sonst wär' Kanada Jemanda. There we have the salad.
_______________________________________________ users mailing list [email protected] http://lists.scilab.org/mailman/listinfo/users
