MCPcopy Create free account
hub / github.com/alandefreitas/matplotplusplus / to_string

Function to_string

source/matplot/util/colors.cpp:14–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12namespace matplot {
13
14 std::string to_string(matplot::color c) {
15 switch (c) {
16 case color::blue:
17 return "blue";
18 case color::black:
19 return "black";
20 case color::red:
21 return "red";
22 case color::green:
23 return "green";
24 case color::yellow:
25 return "yellow";
26 case color::cyan:
27 return "cyan";
28 case color::magenta:
29 return "magenta";
30 case color::white:
31 return "white";
32 case color::none:
33 return "none";
34 }
35 throw std::logic_error("colors::to_string: could not find a string for color");
36 }
37
38 matplot::color string_to_color(std::string_view s) {
39 if (s.size() == 1) {

Callers 15

run_title_commandMethod · 0.85
run_colormap_commandMethod · 0.85
run_box_commandMethod · 0.85
run_axes_commandMethod · 0.85
run_legend_commandMethod · 0.85
run_multiplot_commandMethod · 0.85
range_stringMethod · 0.85
label_stringMethod · 0.85

Calls

no outgoing calls

Tested by 1

plot_stringMethod · 0.68