Mercurial > octave-nkf
comparison scripts/plot/draw/plotyy.m @ 19746:52cd69e79784
Fix legend function interaction with plotyy (bug #44246).
* plotyy.m: Use addproperty correctly to add property, then set value.
* newplot.m: Add special exception case when doing "replace" on an existing
axis which is a plotyy axis. Instead of re-using existing axis and doing
a "reset", delete the axis entirely and create a new one.
author | Rik <rik@octave.org> |
---|---|
date | Sat, 14 Feb 2015 07:12:22 -0800 |
parents | 4197fc428c7d |
children |
comparison
equal
deleted
inserted
replaced
19745:b59aabc08e63 | 19746:52cd69e79784 |
---|---|
174 addlistener (ax(1), "nextplot", {@update_nextplot, ax(2)}); | 174 addlistener (ax(1), "nextplot", {@update_nextplot, ax(2)}); |
175 addlistener (ax(2), "nextplot", {@update_nextplot, ax(1)}); | 175 addlistener (ax(2), "nextplot", {@update_nextplot, ax(1)}); |
176 | 176 |
177 ## Store the axes handles for the sister axes. | 177 ## Store the axes handles for the sister axes. |
178 if (ishandle (ax(1)) && ! isprop (ax(1), "__plotyy_axes__")) | 178 if (ishandle (ax(1)) && ! isprop (ax(1), "__plotyy_axes__")) |
179 addproperty ("__plotyy_axes__", ax(1), "data", ax); | 179 addproperty ("__plotyy_axes__", ax(1), "data"); |
180 set (ax(1), "__plotyy_axes__", ax); | |
180 elseif (ishandle (ax(1))) | 181 elseif (ishandle (ax(1))) |
181 set (ax(1), "__plotyy_axes__", ax); | 182 set (ax(1), "__plotyy_axes__", ax); |
182 else | 183 else |
183 error ("plotyy.m: This shouldn't happen. File a bug report."); | 184 error ("plotyy.m: This shouldn't happen. File a bug report."); |
184 endif | 185 endif |
185 if (ishandle (ax(2)) && ! isprop (ax(2), "__plotyy_axes__")) | 186 if (ishandle (ax(2)) && ! isprop (ax(2), "__plotyy_axes__")) |
186 addproperty ("__plotyy_axes__", ax(2), "data", ax); | 187 addproperty ("__plotyy_axes__", ax(2), "data"); |
188 set (ax(2), "__plotyy_axes__", ax); | |
187 elseif (ishandle (ax(2))) | 189 elseif (ishandle (ax(2))) |
188 set (ax(2), "__plotyy_axes__", ax); | 190 set (ax(2), "__plotyy_axes__", ax); |
189 else | 191 else |
190 error ("plotyy.m: This shouldn't happen. File a bug report."); | 192 error ("plotyy.m: This shouldn't happen. File a bug report."); |
191 endif | 193 endif |