Mon 25 Apr 2016 04:43:22 PM UTC, comment #10:
Thanks Rik.
|
Mon 25 Apr 2016 03:11:38 PM UTC, comment #9:
I found another instance where a double-click in FLTK would trigger an autoscale. I fixed that too and checked all three changes in under Pantxo's name (since he did the original work) on the stable branch (http://hg.savannah.gnu.org/hgweb/octave/rev/9191c24fb329). This will be part of the next bug fix release (4.0.3) or more likely Octave will move to 4.2.0.
|
Sun 24 Apr 2016 06:54:27 PM UTC, comment #8:
Thanks Rik for pointing me to fltk. I attached a new patch.
(file #36990)
|
Sun 24 Apr 2016 06:03:35 PM UTC, comment #7:
@Pantxo: The patch works fine for Qt. Could you also update the selection routine in _init_fltk_.cc? We don't want this to work for some toolkits and fail for others.
The relevant routine is in _init_fltk_.cc.
|
Sun 24 Apr 2016 08:04:24 AM UTC, comment #6:
I attached a patch implementing the snippet from comment #5.
(file #36984)
|
Sat 23 Apr 2016 11:59:22 PM UTC, comment #5:
Autoscaling is not the only problem. What if you try "plot (1:10)" after clicking the legend, you probably don't want the next plot to be drawn there.
I think we should only prevent the selection from changing a legend/colorbar into the currentaxes. This happens in canvasMousePressEvent, something like:
|
Sat 23 Apr 2016 05:03:47 PM UTC, comment #4:
Confirmed. I agree with Pantxo's analysis as well.
I'm not sure whether the easiest solution would be to prevent a legend axes object from ever getting selected, or whether we need to disable autoscaling when the axes object is a legend.
For the second choice, the code is in libgui/graphics/Canvas.cc.
After getting the currentaxes into the variable ah, we could check that it doesn't have the legend property before continuing.
|
Sat 23 Apr 2016 09:24:02 AM UTC, comment #3:
I can confirm this with Qt toolkit.
I think the whole problem lies in autoscaling legend objects. The object selection mechanism is not well behaved here: when clicking on a legend, the currentobject property of the figure should be changed to reflect the fact that the legend has been selected (this works well), but a legend should never become the currentaxes.
|
Sat 23 Apr 2016 12:06:46 AM UTC, comment #2:
Before print to pdf, please click the legend and click "Autoscale", you will see the difference.
Let's make it more clear with the following code:
plot(a,b,'o-.')
legend('test')
The line style (dotted dash line) is not shown clearly with original plot. After selecting the legend and "Autoscale", the line and marker are shown correctly.
It also depends on the figure size, and font size. When the figure size is large and font size is small, this problem is not very obvious. But you still can see the difference when after clicking "Autoscale".
|
Fri 22 Apr 2016 11:19:19 PM UTC, comment #1:
This works for me. I used the following code with 4.0.2 on Kubuntu 15.10
Also, what does
return? It should be qt.
(file #36983)
|
Fri 22 Apr 2016 10:48:32 PM UTC, original submission:
The legend texts always cover the legend lines.
a=(1:0.4:10)
b=(1:23)
plot(a,b)
legend('test')
This code generates test1.pdf.
After I click the legend and then click the "Autoscale" button in Figure 1. I got test2.pdf.
It seems the staring position of the text need to be adjusted and the size of legend box needs to be adjusted accordingly.
I tested 4.02 under windows 7, and 4.0.0 under ubuntu.
|