Skip to content

Commit 0bb2379

Browse files
committed
fix(examples): disambiguate legend
1 parent f96bd93 commit 0bb2379

File tree

14 files changed

+20
-20
lines changed

14 files changed

+20
-20
lines changed

examples/appearance/labels/legend/legend_1.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ int main() {
1212
std::vector<double> y2 = transform(x, [](auto x) { return cos(2 * x); });
1313
plot(x, y2);
1414

15-
legend("cos(x)", "cos(2x)");
15+
::matplot::legend({"cos(x)", "cos(2x)"});
1616

1717
std::vector<double> y3 = transform(x, [](auto x) { return cos(3 * x); });
1818
auto p = plot(x, y3);
@@ -21,7 +21,7 @@ int main() {
2121

2222
show();
2323

24-
legend(off);
24+
::matplot::legend(off);
2525
show();
2626

2727
return 0;

examples/appearance/labels/legend/legend_2.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ int main() {
1313
auto ax2 = nexttile();
1414
plot(y2);
1515

16-
legend(ax1, "Line 1", "Line 2", "Line 3");
16+
::matplot::legend(ax1, {"Line 1", "Line 2", "Line 3"});
1717

1818
show();
1919
return 0;

examples/appearance/labels/legend/legend_3.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ int main() {
1616
p2->display_name("cos(2x)");
1717
hold(off);
1818

19-
legend();
19+
::matplot::legend({});
2020

2121
show();
2222
return 0;

examples/appearance/labels/legend/legend_4.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ int main() {
1717
plot(x, y4);
1818
hold(off);
1919

20-
auto l = legend("cos(x)", "cos(2x)", "cos(3x)", "cos(4x)");
20+
auto l = ::matplot::legend({"cos(x)", "cos(2x)", "cos(3x)", "cos(4x)"});
2121
l->location(legend::general_alignment::topleft);
2222
l->num_rows(2);
2323

examples/appearance/labels/legend/legend_5.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ int main() {
1515
auto p3 = plot(x, y3);
1616
hold(off);
1717

18-
legend({p1, p3}, {"First", "Third"});
18+
::matplot::legend({p1, p3}, {"First", "Third"});
1919

2020
show();
2121
return 0;

examples/appearance/labels/legend/legend_6.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ int main() {
1313
plot(x, y2);
1414
hold(off);
1515

16-
auto lgd = legend("cos(x)", "cos(2x)");
16+
auto lgd = ::matplot::legend({"cos(x)", "cos(2x)"});
1717
title(lgd, "My legend title");
1818

1919
show();

examples/appearance/labels/legend/legend_7.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ int main() {
1313
plot(x, y2);
1414
hold(off);
1515

16-
auto lgd = legend("cos(x)", "cos(2x)");
16+
auto lgd = ::matplot::legend({"cos(x)", "cos(2x)"});
1717
lgd->location(legend::general_alignment::bottomleft);
1818
lgd->box(false);
1919

examples/appearance/labels/legend/legend_8.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ int main() {
77

88
plot(rdm);
99

10-
auto lgd = legend("Line 1", "Line 2", "Line 3", "Line 4");
10+
auto lgd = ::matplot::legend({"Line 1", "Line 2", "Line 3", "Line 4"});
1111
lgd->font_size(12);
1212
lgd->text_color("blue");
1313
lgd->num_columns(2);

examples/appearance/labels/legend/legend_9.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ int main() {
66

77
auto random_lines = rand(4, 4, 0, 1);
88
auto ls = plot(random_lines);
9-
legend("Line 1", "Line 2");
9+
::matplot::legend({"Line 1", "Line 2"});
1010
ls[2]->display_name("Line 3");
1111

1212
show();

examples/appearance/multiplot/yyaxis/yyaxis_4.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ int main() {
1818
ps[1]->use_y2(true).color("m").line_style("--");
1919
gca()->y2_axis().color("m");
2020

21-
legend();
21+
::matplot::legend();
2222

2323
show();
2424
return 0;

0 commit comments

Comments
 (0)