Mon 28 Aug 2017 06:34:14 PM UTC, comment #6:
Posted to the mailing list, not the tracker:
I confirm that with the change from 4.2.0 to 4.2.1 drawnow no longer
"fixes" the problem. To be sure we are all on the same page, the OP was to
point out that in this case, when a rescale occurs because of a forced
change in ytickmode, the ylimits in gca are not updated. I think they
ought to be, or at least there needs to be a way (as in 4.2.0 with drawnow)
to force refreshing values in gca, otherwise locating text after the
rescale is unreliable. Unfortunately I do not have easy access to matlab,
or I would be able to report how the same script works there.
I would very much like to help this effort (and octave in general). Please
let me know how I can support you.
This may be a good place to thank developers for all the additions to
4.2.1, notable rhe new availability of opengl through ssh tunneling. Way
to go!
|
Tue 07 Mar 2017 03:52:44 PM UTC, comment #5:
I am not sure why inserting "drawnow" helped in that specific RC. It no longer changes anything for me, too. Sorry that I gave wrong information. I was under the impression that "drawnow" would trigger an update of all graphics properties.
I also tried in Windows and got the same result as the OP.
The example in comment #0 works if either "ytick" or "ytickmode" is set before the last call of "plot". So maybe both should update the axis limits when changed. I can provide a changeset if this is the case.
Do we really want that the axes limits change in that case? Or is that the bug?
I had to slightly modify your script so that it could run in Matlab:
I get the same results when I execute the script line by line.
|
Sun 05 Mar 2017 09:12:12 PM UTC, comment #4:
Drawnow has no effect for me and I am pretty sure that it should not be necessary here, I don't know that an axes object has to be rendered (that is what drawnow forces) for its properties to be right (for ui* objects it is another matter).
Further more I see the reported behavior wether I run the code as a script or paste it in the command window. In the latter situation Octave returns after each command and it should be equivalent to calling drawnow.
What I see here is that changing the "ytickmode" property doesn't force limits to be updated. Octave needs another object to be added (here the text object) to have the axes limits recomputed.
What does Matlab do/return executing the script below?
|
Sat 05 Nov 2016 06:11:03 PM UTC, comment #2:
Using drawnow is a good workaround (works for me in 4.2.0-rc3), but I don't understand the logic? Surely any call to set(gca,..) ought to update all gca properties, particularly if that call changes those properties?
An example of how illogical this is is to include a pause statement before the sgca=get(gca) command (but no drawnow). In that case the program works correctly (since pause forced drawnow), and we have a program that behaves differently, depending on whether there is a pause or not!!
Is the current rule that drawnow should be called anytime the current axes properties are modified?
|
Mon 31 Oct 2016 08:01:05 PM UTC, original submission:
The enclosed script plots a straight line twice. Both the script and resulting figure are attached. In the right hand plot, the y-axis tick mode has been set to manual. Since the right and left plots are not the same, I conclude that the y-axis has been rescaled by the set(gca... call. However a subsequent call to gca shows that ylim is the same for both plots. As a result the line "rescale" is placed correctly in only the left hand plot.
Ubuntu 16.04 gl2ps 1.3.8
|