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

Method plot_string

source/matplot/axes_objects/vectors.cpp:72–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70 w_data_(w_data), c_data_(c_data) {}
71
72 std::string vectors::plot_string() {
73 maybe_update_line_spec();
74 std::stringstream ss;
75 ss.precision(10);
76 ss << std::fixed;
77 ss << " '-' with vectors";
78 if (!c_data_.empty()) {
79 ss << " linecolor palette";
80 ss << " linewidth " << line_spec_.line_width();
81
82 switch (line_spec_.line_style()) {
83 case line_spec::line_style::solid_line:
84 ss << " dashtype 1";
85 break;
86 case line_spec::line_style::dashed_line:
87 ss << " dashtype '--'";
88 break;
89 case line_spec::line_style::dotted_line:
90 ss << " dashtype '.'";
91 break;
92 case line_spec::line_style::dash_dot_line:
93 ss << " dashtype '-.'";
94 break;
95 default:
96 break;
97 }
98 } else {
99 ss << line_spec_.plot_string(
100 line_spec::style_to_plot::plot_line_only, false);
101 }
102
103 if (use_y2_) {
104 ss << " xlim x1y2";
105 }
106 return ss.str();
107 }
108
109 std::string vectors::legend_string(std::string_view title) {
110 return " keyentry with vectors " +

Callers 1

legend_stringMethod · 0.45

Calls 3

emptyMethod · 0.80
line_styleMethod · 0.80
line_widthMethod · 0.45

Tested by

no test coverage detected