A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/alandefreitas/matplotplusplus/commit/0bb23796e919af96ba2249e60fa58613794b33de below:

disambiguate legend · alandefreitas/matplotplusplus@0bb2379 · GitHub

File tree Expand file treeCollapse file tree 14 files changed

+20

-20

lines changed

Filter options

Expand file treeCollapse file tree 14 files changed

+20

-20

lines changed Original file line number Diff line number Diff line change

@@ -12,7 +12,7 @@ int main() {

12 12

std::vector<double> y2 = transform(x, [](auto x) { return cos(2 * x); });

13 13

plot(x, y2);

14 14 15 -

legend("cos(x)", "cos(2x)");

15 +

::matplot::legend({"cos(x)", "cos(2x)"});

16 16 17 17

std::vector<double> y3 = transform(x, [](auto x) { return cos(3 * x); });

18 18

auto p = plot(x, y3);

@@ -21,7 +21,7 @@ int main() {

21 21 22 22

show();

23 23 24 -

legend(off);

24 +

::matplot::legend(off);

25 25

show();

26 26 27 27

return 0;

Original file line number Diff line number Diff line change

@@ -13,7 +13,7 @@ int main() {

13 13

auto ax2 = nexttile();

14 14

plot(y2);

15 15 16 -

legend(ax1, "Line 1", "Line 2", "Line 3");

16 +

::matplot::legend(ax1, {"Line 1", "Line 2", "Line 3"});

17 17 18 18

show();

19 19

return 0;

Original file line number Diff line number Diff line change

@@ -16,7 +16,7 @@ int main() {

16 16

p2->display_name("cos(2x)");

17 17

hold(off);

18 18 19 -

legend();

19 +

::matplot::legend({});

20 20 21 21

show();

22 22

return 0;

Original file line number Diff line number Diff line change

@@ -17,7 +17,7 @@ int main() {

17 17

plot(x, y4);

18 18

hold(off);

19 19 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)"});

21 21

l->location(legend::general_alignment::topleft);

22 22

l->num_rows(2);

23 23 Original file line number Diff line number Diff line change

@@ -15,7 +15,7 @@ int main() {

15 15

auto p3 = plot(x, y3);

16 16

hold(off);

17 17 18 -

legend({p1, p3}, {"First", "Third"});

18 +

::matplot::legend({p1, p3}, {"First", "Third"});

19 19 20 20

show();

21 21

return 0;

Original file line number Diff line number Diff line change

@@ -13,7 +13,7 @@ int main() {

13 13

plot(x, y2);

14 14

hold(off);

15 15 16 -

auto lgd = legend("cos(x)", "cos(2x)");

16 +

auto lgd = ::matplot::legend({"cos(x)", "cos(2x)"});

17 17

title(lgd, "My legend title");

18 18 19 19

show();

Original file line number Diff line number Diff line change

@@ -13,7 +13,7 @@ int main() {

13 13

plot(x, y2);

14 14

hold(off);

15 15 16 -

auto lgd = legend("cos(x)", "cos(2x)");

16 +

auto lgd = ::matplot::legend({"cos(x)", "cos(2x)"});

17 17

lgd->location(legend::general_alignment::bottomleft);

18 18

lgd->box(false);

19 19 Original file line number Diff line number Diff line change

@@ -7,7 +7,7 @@ int main() {

7 7 8 8

plot(rdm);

9 9 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"});

11 11

lgd->font_size(12);

12 12

lgd->text_color("blue");

13 13

lgd->num_columns(2);

Original file line number Diff line number Diff line change

@@ -6,7 +6,7 @@ int main() {

6 6 7 7

auto random_lines = rand(4, 4, 0, 1);

8 8

auto ls = plot(random_lines);

9 -

legend("Line 1", "Line 2");

9 +

::matplot::legend({"Line 1", "Line 2"});

10 10

ls[2]->display_name("Line 3");

11 11 12 12

show();

Original file line number Diff line number Diff line change

@@ -18,7 +18,7 @@ int main() {

18 18

ps[1]->use_y2(true).color("m").line_style("--");

19 19

gca()->y2_axis().color("m");

20 20 21 -

legend();

21 +

::matplot::legend();

22 22 23 23

show();

24 24

return 0;

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4