| 19 | sizes_(sizes) {} |
| 20 | |
| 21 | std::string labels::set_variables_string() { |
| 22 | std::string res; |
| 23 | if (rectangles_) { |
| 24 | auto word_size = [this](size_t word_index) { |
| 25 | if (sizes_.size() > word_index) { |
| 26 | return round(sizes_[word_index]); |
| 27 | } else { |
| 28 | return static_cast<double>(round(parent_->font_size())); |
| 29 | } |
| 30 | }; |
| 31 | for (size_t i = 0; i < labels_.size(); ++i) { |
| 32 | double s = word_size(i); |
| 33 | res += " set object " + num2str(1000 + i) + |
| 34 | " rectangle at " + num2str(x_[i]) + ", " + |
| 35 | num2str(y_[i]) + " size " + |
| 36 | num2str(s * labels_[i].size() * width_factor) + ", " + |
| 37 | num2str(s * height_factor) + " fc lt 2 \n"; |
| 38 | } |
| 39 | } |
| 40 | return res; |
| 41 | } |
| 42 | |
| 43 | std::string labels::plot_string() { |
| 44 | std::string res = " '-' with labels"; |