8000 example usage of legend's loc and bbox_to_anchor · Hazel-Bruce/matplotlib-cpp@739d8bd · GitHub
[go: up one dir, main page]

Skip to content

Commit 739d8bd

Browse files
committed
example usage of legend's loc and bbox_to_anchor
1 parent c5a2b1d commit 739d8bd

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

examples/eigen/loglog.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ int main() {
2929
// Add graph title
3030
plt::title("Sample figure");
3131

32-
// Enable legend.
33-
plt::legend();
32+
// Put the legend in the center of the bottom right quadrant.
33+
// First argument: loc, second: bbox_to_anchor
34+
plt::legend("center", {0.5, 0, 0.5, 0.5});
3435

3536
// show figure
3637
plt::show();

0 commit comments

Comments
 (0)
0