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

Method plot_string

source/matplot/axes_objects/matrix.cpp:92–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90 }
91
92 std::string matrix::plot_string() {
93 std::string res = "'-' with";
94 if (!has_alpha()) {
95 if (matrices_.size() < 3) {
96 // image with colors from colormap
97 res += " image";
98 } else {
99 // 3 components for each point
100 res += " rgbimage";
101 }
102 } else {
103 // 4 components for each point
104 // even if matrices_.size() == 1
105 res += " rgbalpha";
106 }
107
108 if (should_plot_labels()) {
109 // low values in black
110 res += ", '-' with labels font \"" + escape(parent_->font()) + "," +
111 num2str(round(parent_->font_size())) +
112 "\" textcolor 'black'";
113 // high values in white
114 res += ", '-' with labels font \"" + escape(parent_->font()) + "," +
115 num2str(round(parent_->font_size())) +
116 "\" textcolor 'white'";
117 }
118 return res;
119 }
120
121 bool matrix::should_plot_labels() {
122 if (always_hide_labels_ || matrices_.size() > 1) {

Callers

nothing calls this directly

Calls 5

escapeFunction · 0.85
num2strFunction · 0.85
sizeMethod · 0.45
fontMethod · 0.45
font_sizeMethod · 0.45

Tested by

no test coverage detected