forked from Cryoris/matplotlib-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlegend.cpp
More file actions
34 lines (32 loc) · 708 Bytes
/
Copy pathlegend.cpp
File metadata and controls
34 lines (32 loc) · 708 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include <vector>
#include "../matplotlibcpp.h"
namespace plt = matplotlibcpp;
void basic() {
plt::figure();
plt::plot({1, 2, 3}, {{"label", "a line"}});
plt::plot({1, 3, 5}, {{"label", "also a line"}});
plt::legend();
plt::show();
}
void bbox() {
plt::figure();
plt::plot({1, 2, 3}, {{"label", "a line"}});
plt::plot({1, 3, 5}, {{"label", "also a line"}});
plt::legend(std::vector<double>{0.5, 0.7});
plt::show();
}
/*
void keywords() {
plt::figure();
plt::plot({1, 2, 3}, {{"label", "a line"}});
plt::plot({1, 3, 5}, {{"label", "also a line"}});
plt::legend("best", {{"borderpad", "0.2"}});
plt::show();
}
*/
int main() {
basic();
bbox();
// keywords();
return 0;
}