changeset 32114:0cedac4984ae stable

Reset all axes properties except Units, Position with "cla ('reset')" * graphics.cc (axes::properties::set_defaults): Add code to reset "alphamap", "alphascale", "colormap", "colorscale", "fontsizemode", "xlimitmethod", "ylimitmethod", "zlimitmethod". * axis.m: Update BIST test to pass given correct behavior of cla().
author Rik <rik@octave.org>
date Sun, 11 Jun 2023 21:30:23 -0700
parents abf64c84fe66
children 40686c90cec3 efcfafb7ad16
files libinterp/corefcn/graphics.cc scripts/plot/appearance/axis.m
diffstat 2 files changed, 12 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/graphics.cc	Sun Jun 11 16:09:45 2023 -0700
+++ b/libinterp/corefcn/graphics.cc	Sun Jun 11 21:30:23 2023 -0700
@@ -5471,6 +5471,7 @@
   Matrix tlim (1, 2, 0.0);
   tlim(1) = 1;
   m_alim = tlim;
+  m_clim = tlim;
   m_xlim = tlim;
   m_ylim = tlim;
   m_zlim = tlim;
@@ -5481,6 +5482,9 @@
   m_ylimmode = "auto";
   m_zlimmode = "auto";
 
+  m_alphamap = Matrix ();
+  m_alphascale = "linear";
+
   m_ambientlightcolor = Matrix (1, 3, 1.0);
 
   m_box = "off";
@@ -5492,15 +5496,13 @@
   m_cameraupvectormode = "auto";
   m_cameraviewanglemode = "auto";
 
-  Matrix cl (1, 2, 0.0);
-  cl(1) = 1;
-  m_clim = cl;
-
   m_clippingstyle = "3dbox";
 
   m_color = color_values ("white");
+  m_colormap = Matrix ();
   m_colororder = default_colororder ();
   m_colororderindex = 1.0;
+  m_colorscale = "linear";
 
   // Note: dataspectratio (not mode) will be set through update_aspectratios
   m_dataaspectratiomode = "auto";
@@ -5508,8 +5510,9 @@
   m_fontangle = "normal";
   m_fontname = OCTAVE_DEFAULT_FONTNAME;
   m_fontsize = 10;
+  m_fontsizemode = "auto";
+  m_fontsmoothing = "on";
   m_fontunits = "points";
-  m_fontsmoothing = "on";
   m_fontweight = "normal";
 
   m_gridalpha = 0.15;
@@ -5561,6 +5564,7 @@
   m_xcolormode = "auto";
   m_xdir = "normal";
   m_xgrid = "off";
+  m_xlimitmethod = "tickaligned";
   m_xminorgrid = "off";
   m_xminortick = "off";
   m_xscale = "linear";
@@ -5576,6 +5580,7 @@
   m_ycolormode = "auto";
   m_ydir = "normal";
   m_ygrid = "off";
+  m_ylimitmethod = "tickaligned";
   m_yminorgrid = "off";
   m_yminortick = "off";
   m_yscale = "linear";
@@ -5589,6 +5594,7 @@
   m_zcolormode = "auto";
   m_zdir = "normal";
   m_zgrid = "off";
+  m_zlimitmethod = "tickaligned";
   m_zminorgrid = "off";
   m_zminortick = "off";
   m_zscale = "linear";
--- a/scripts/plot/appearance/axis.m	Sun Jun 11 16:09:45 2023 -0700
+++ b/scripts/plot/appearance/axis.m	Sun Jun 11 21:30:23 2023 -0700
@@ -638,6 +638,7 @@
 %!   plot (1:10)
 %!   axis tight;
 %!   assert (axis (), [1 10 1 10]);
+%!   hold on;
 %!   plot (1:11)
 %!   assert (axis (), [1 11 1 11]);
 %! unwind_protect_cleanup