comparison scripts/plot/subplot.m @ 8208:f6ca8ff51818

[mq]: graphics-backend
author John W. Eaton <jwe@octave.org>
date Fri, 10 Oct 2008 11:07:53 -0400
parents c066714ee5d5
children c6e9ff62c64a
comparison
equal deleted inserted replaced
8207:60b4c75287a1 8208:f6ca8ff51818
124 ## with their corresponding axes). 124 ## with their corresponding axes).
125 if (! ishandle (child)) 125 if (! ishandle (child))
126 continue; 126 continue;
127 endif 127 endif
128 if (strcmp (get (child, "type"), "axes")) 128 if (strcmp (get (child, "type"), "axes"))
129 ## Skip legend objects. 129 ## Skip legend and colorbar objects.
130 if (strcmp (get (child, "tag"), "legend")) 130 if (strcmp (get (child, "tag"), "legend") ||
131 strcmp (get (child, "tag"), "colorbar"))
131 continue; 132 continue;
132 endif 133 endif
133 objpos = get (child, "outerposition"); 134 objpos = get (child, "outerposition");
134 if (objpos == pos) 135 if (objpos == pos)
135 ## If the new axes are in exactly the same position as an 136 ## If the new axes are in exactly the same position as an
136 ## existing axes object, use the existing axes. 137 ## existing axes object, use the existing axes.
137 found = true; 138 found = true;
138 tmp = child; 139 tmp = child;
139 break;
140 else 140 else
141 ## If the new axes overlap an old axes object, delete the old 141 ## If the new axes overlap an old axes object, delete the old
142 ## axes. 142 ## axes.
143 objx0 = objpos(1); 143 objx0 = objpos(1);
144 objx1 = objx0 + objpos(3); 144 objx1 = objx0 + objpos(3);
152 endfor 152 endfor
153 153
154 if (found) 154 if (found)
155 set (cf, "currentaxes", tmp); 155 set (cf, "currentaxes", tmp);
156 else 156 else
157 tmp = axes ("outerposition", pos); 157 border = [0.130, 0.110, 0.225, 0.185] .* [xsize, ysize, xsize, ysize];
158 pos2 = [pos(1:2) + border(1:2), pos(3:4) - border(1:2) - border(3:4)];
159 tmp = axes ("outerposition", pos, "position", pos2);
158 endif 160 endif
159 161
160 if (nargout > 0) 162 if (nargout > 0)
161 h = tmp; 163 h = tmp;
162 endif 164 endif