Axis in plot3
John W. Eaton
jwe at bevo.che.wisc.edu
Thu Nov 6 11:17:16 CST 2008
On 5-Nov-2008, Søren Hauberg wrote:
| Hi All,
| With 3.1.51+ I'm having some problems with the default axis of plot3.
| Try the following
|
| X = [0, 0, 0, 0, NA, 4, 4, 4, 4];
| Y = [0, 2, 2, 0, NA, 0, 2, 2, 0];
| Z = [0, 0, 1, 1, NA, 0, 0, 1, 1];
| plot3 (X, Y, Z, 'r')
|
| The result should be the two sides of a 3d cube. However, the default
| axis is so tight that the cube isn't visible. To make the cube visible I
| have to run
|
| axis ([-1, 5, -1, 3, -1, 2])
|
| I only ran into this issue because I was trying to come up with a simple
| example of 'axis equal' not working with 3D plots, but I guess I'll have
| to come up with another example :-)
The function that you want to debug is
axes::properies::get_axis_limits in src/graphics.cc. For this case,
the code that is executed is
double tick_sep = calc_tick_sep (min_val , max_val);
min_val = tick_sep * std::floor (min_val / tick_sep);
max_val = tick_sep * ceil (max_val / tick_sep);
and tick_sep is computed to be 1. So then min_val and max_val are set
to the min and max values of the data, and the lines you are plotting
end up being the same as the box drawn for the axes, so you don't see
them.
jwe
More information about the Bug-octave
mailing list