changeset 28170:5e49ba5bdcc1

Keep Z-limits around 0 for 2-D graphics (bug #58015). * graphics.cc (axes::update_axis_limits): Graphics objects without Z limits (2-D objects) keep Z-axis limits at 0.
author Markus Mützel <markus.muetzel@gmx.de>
date Sun, 22 Mar 2020 19:23:03 +0100
parents d5dfbd5c80d6
children a23da76e0693
files libinterp/corefcn/graphics.cc
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/graphics.cc	Sun Mar 22 17:58:36 2020 +0100
+++ b/libinterp/corefcn/graphics.cc	Sun Mar 22 19:23:03 2020 +0100
@@ -8732,6 +8732,11 @@
           xproperties.set_has3Dkids ((max_val - min_val) >
                                      std::numeric_limits<double>::epsilon ());
 
+          // FIXME: How to correctly handle (positive or negative) log scale?
+          if ((! octave::math::isfinite (min_val)
+               || ! octave::math::isfinite (max_val))
+              && ! xproperties.zscale_is ("log"))
+            min_val = max_val = 0.;
 
           limits = xproperties.get_axis_limits (min_val, max_val,
                                                 min_pos, max_neg,