From: Ethan A M. <me...@uw...> - 2021-02-24 21:09:51
|
On Wednesday, 24 February 2021 10:49:52 PST Dima Kogan wrote: > Hi. > > I'd like a plot with the legend sitting outside the plot, above the > top-right. Like this: > > window > --------------------------------- > | | > | | > | | > | legend | > | ------------------------- | > | | | | > | | | | > | | plot | | > | | | | > | | | | > | ------------------------- | > | | > | | > | | > --------------------------------- I personally have never understood the keywords associated with key placement. The one combination I do know how to use, I remember by thinking of it as "place the bottom/top left/right corner of the key at position x,y" You can use any coordinate for the x,y position so it works to place the key inside or outside of the plot. In your case would be something like set key bottom right at graph 1.0, 1.0 I.e, place the bottom right corner of the key just above the top right corner of the plot. Ethan > > > If we set a square aspect ratio, then the plot doesn't fill the window, > and there's a lot of empty space. This isn't a problem in itself (and > gnuplot doesn't control the window size, so it can't "fix" it), but it > looks like the legend attaches itself to the corner of the window > instead of the corner of the plot, which looks very strange: there's a > huge gap between the plot and the legend. I get this: > > > window > --------------------------------- > | legend| > | | > | | > | | > | ------------------------- | > | | | | > | | | | > | | plot | | > | | | | > | | | | > | ------------------------- | > | | > | | > | | > --------------------------------- > > I'm hesitant to call this a "bug", but this feels wrong. Am I just > giving it incorrect commands? Demo script: > > set key outside above right > set size ratio -1 > plot x/10 > > > Thanks |