Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move captions around? #20

Open
ArtemGr opened this issue Mar 8, 2017 · 4 comments
Open

Move captions around? #20

ArtemGr opened this issue Mar 8, 2017 · 4 comments

Comments

@ArtemGr
Copy link
Contributor

ArtemGr commented Mar 8, 2017

I wonder if it's possible to move the captions around?

In gnuplot that would be "set key left top".
cf. http://stackoverflow.com/questions/12208054/gnuplot-legend-overlaps-graph

@SiegeLord
Copy link
Owner

The set_legend method has a whole bunch of options. You can specify the location of the legend using the first two arguments, e.g.:

.set_legend(Graph(0.5),
            Graph(-0.2),
            &[Horizontal, Placement(AlignCenter, AlignTop), Title("Legend Title")],
            &[TextAlign(AlignRight)]);

@ArtemGr
Copy link
Contributor Author

ArtemGr commented Mar 10, 2017

Thanks for the hint.

The legend is not quite the caption, though.

  1. The captions are automatically aligned by the gnuplot, which is much more convenient than trying to move the legend "by hand".
  2. The captions show the sample of the line they're related to.
  3. They share the color of the line.
  4. There is a separate caption for every line. Whereas there is only one legend.
    I've just tried
    .set_legend (Graph (0.5), Graph (-0.2), &[Horizontal, Placement (AlignCenter, AlignTop), Title ("Legend Title")], &[TextAlign (AlignRight)])
    .set_legend (Graph (0.8), Graph (-0.4), &[Horizontal, Placement (AlignCenter, AlignTop), Title ("Legend Title 2")], &[TextAlign (AlignRight)])

and only the second legend is displayed.
5) Not to mention that one might need both the captions and the legend.

In other words, duh.

@ArtemGr
Copy link
Contributor Author

ArtemGr commented Mar 10, 2017

Anyway, I'm going to use the gnuplot directly, so NP.

@SiegeLord
Copy link
Owner

Interesting, I've never heard of this feature before. Maybe it can be added one day. You can actually dump the generated gnuplot commands from this library and edit in the bits you're interested in, in principle.

@SiegeLord SiegeLord reopened this Mar 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants