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

Method legend_string

source/matplot/axes_objects/line.cpp:135–152  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133 }
134
135 std::string line::legend_string(std::string_view title) {
136 if (line_spec_.has_line() && line_spec_.has_non_custom_marker()) {
137 return " keyentry " +
138 line_spec_.plot_string(
139 line_spec::style_to_plot::plot_line_and_marker) +
140 " title \"" + escape(title) + "\"";
141 } else if (line_spec_.has_line()) {
142 return " keyentry " +
143 line_spec_.plot_string(
144 line_spec::style_to_plot::plot_line_only) +
145 " title \"" + escape(title) + "\"";
146 } else {
147 return " keyentry " +
148 line_spec_.plot_string(
149 line_spec::style_to_plot::plot_marker_only) +
150 " title \"" + escape(title) + "\"";
151 }
152 }
153
154 std::string line::data_string() {
155 const bool markers_are_automatic = marker_indices_.empty();

Callers

nothing calls this directly

Calls 4

escapeFunction · 0.85
has_lineMethod · 0.80
has_non_custom_markerMethod · 0.80
plot_stringMethod · 0.45

Tested by

no test coverage detected