xstring affects in unpredictable way the "reframe content" when multiple figures are present
Reported by Bernard Bunner
zoomed-out image.png (6.88 KB, image/png)
result of "reframe to contents" causing erroneous zoom-out in figure 1
BUG DESCRIPTION:
----------------
I create 2 figures. In figure 1, I display a text message using xstring. When I do a "reframe to content" in that figure, it changes the bounds of that figure in an unpredictable manner. The code below will show how to reproduce this.
The problem only happens if figure 2 has y quantities that are larger than figure 1. It only happens if figure 2 is created after figure 1. It obviously only happens if figure 2 is present. It does not happen if xstring is missing.
It seems as if there is some leakage of information from figure 2 back to figure 1 that affects how the SW calculates data_bounds in figure 1, but only if xstring is present
ERROR LOG:
----------
none. wrong behavior in graphics
HOW TO REPRODUCE THE BUG:
-------------------------
Test the sample code below. Then do "reframe content" on figure 1.
clear;
x1=[0:0.01:10];
y1=sin(x1);
x2=[0:0.1:100];
y2=1000*cos(x2);
scf(1);clf(1);
plot2d(x1,y1);
plot2d([3 3],[-2 2]);
xstring(16,5,"text more stuff");
e=gce();
e.text_box_mode="centered";
replot();
a=gca();
scf(2);clf(2);
plot2d(x2,y2);
OTHER INFORMATION:
------------------