|
From: | David Bateman |
Subject: | Re: Matlab compatible legends for FLTK/Gnuplot backends? |
Date: | Mon, 06 Sep 2010 18:20:45 +0200 |
User-agent: | Mozilla-Thunderbird 2.0.0.22 (X11/20090706) |
Ben Abbott wrote:
I'm sizing the legend relative to the axis "position" property in all cases, so that things like "southoutside" might be able to align the edges of the key with the plot (though it doesn't yet). The legend itself is placed relative to the "outerposition" of the axis if the legend is "outside" of the plot. Note that I was setting the legend "position" and "outerposition" are being set to the same value in the legend axis as there are no axis labels, title, ticks etc to include. Looking at the way position and outerposition are autoupdating between themselves, this is probably not the right thing to do.On Sep 5, 2010, at 11:02 PM, David Bateman wrote:I'm not seeing this with gnuplot 4.2.6. Though I do with gnuplot 4.4.0. If you add set (gca(), "activepositionproperty", "outerposition") after the call to legend in gnuplot 4.4.0, I get the same behavior as for gnuplot 4.2.6 where the legend is compressed and badly placed. I'd say it looks like an issue in __go_draw_* code for the parsing of the position and outerposition parameters for use with gnuplot rather than in the legend code. D.I ran some tests changing the activepositionproperty for both axes and for each version of gnuplot (see my attached plots). If you change the snippet below .... ## FIXME A hack for gnuplot. God knows why this is needed if (strcmp (get (fig, "__backend__"), "gnuplot")) set (ca(1), "activepositionproperty", "position"); endif ... to ... set (hlegend, "activepositionproperty", "position");The legend looks correct. This is also the value that Matlab assigns to activepositionproperty for the legend.However, that doesn't address the problem seen when running gnuplot 4.4, setting the gca's activeposition to "position" and the legend's activepositon to "outerposition". I'll take a look at that. Ben
However, with gnuplot plot(1,10); set (gca(), "activiepositionproperty", "position") doesn't give the same plot size as plot(1,10); set (gca(), "activiepositionproperty", "outerposition") which if I'm reading http://www.mathworks.com/help/techdoc/creating_plots/f1-32495.htmlcorrectly is not the right thing to happen. The fltk backend seems to get this right..
D.
[Prev in Thread] | Current Thread | [Next in Thread] |