Mike Sutton wrote:
> The key is not properly placed for splot maps. The simple test case below
> shows that the key ends up obscuring the plot instead of being outside of the
> plot. This problem is present in 4.2RC4 and the CVS head.
>
> set key outside right box
> set key title "FOODSLKF"
> set view map
> splot x,cos(x),sin(x)
> set key left
> replot
> set key outside bottom
> replot
>
> I modified the key.dem demo. I added 'set view map' and changed plot to splot
> to see how all the options plotted. All the automatic key placements seem to
> be misplaced except for maybe outside bottom center.
Yes, there's no guarantees on the key placement for splot. We may have made a conscious decision to hold off on fixing that. There was a little bit of agreement that we should unify the key placement and color box placement for the two modes to avoid do twice the work with twice the number of bugs. (Volunteer Mike?) Something about screen border, plot border (i.e., region where the plot can appear, be it 2D or 3D).
The 2D key layout is pretty well organized (key placement in 3D isn't good, color box in both modes is marginal), so that would be the place to start in my opinion. Then attempt to move the plot layout items from graph3d.c to graphics.c (or is it plot3d.c to plot2d.c?... note somehow we drop the 2d/3d name convention because they key and color box layout should be mode independent).
There is the issue of 3D zoom which complicates matters a bit. However, Ethan was surmising a "clip()" function the other day. Maybe this would be a place for using such a function. It would ensure that 3D zoomed plot elements don't extend into the margins, interfering with keys, color boxes etc.
Also, note we've talked about the capability of multiple keys too.
Dan
|