+134
-31
lines changedFilter options
+134
-31
lines changed Original file line number Diff line number Diff line change
@@ -16,6 +16,7 @@ out
16
16
.idea
17
17
codealike.json
18
18
.vs
19
+
.vscode
19
20
CMakeLists.txt.user
20
21
CMakeSettings.json
21
22
gh-md-toc
Original file line number Diff line number Diff line change
@@ -143,6 +143,8 @@ namespace matplot {
143
143
144
144
std::string bars::data_string() {
145
145
std::stringstream ss;
146
+
ss.precision(5);
147
+
ss << std::fixed;
146
148
double m = x_minimum_difference();
147
149
double cw = cluster_width();
148
150
for (size_t bar_group = 0; bar_group < ys_.size(); ++bar_group) {
Original file line number Diff line number Diff line change
@@ -127,6 +127,8 @@ namespace matplot {
127
127
}
128
128
std::vector<double> unique_groups = unique(x_data_);
129
129
std::stringstream ss;
130
+
ss.precision(5);
131
+
ss << std::fixed;
130
132
// for each group
131
133
for (size_t i = 0; i < unique_groups.size(); ++i) {
132
134
// for each point
Original file line number Diff line number Diff line change
@@ -45,6 +45,8 @@ namespace matplot {
45
45
46
46
std::string circles::data_string() {
47
47
std::stringstream ss;
48
+
ss.precision(5);
49
+
ss << std::fixed;
48
50
for (size_t i = 0; i < x_.size(); ++i) {
49
51
auto value_or_default = [](const std::vector<double> &v,
50
52
size_t index, double default_value) {
Original file line number Diff line number Diff line change
@@ -50,6 +50,8 @@ namespace matplot {
50
50
double contour_max_level = *max_it;
51
51
52
52
std::stringstream ss;
53
+
ss.precision(5);
54
+
ss << std::fixed;
53
55
if (filled_) {
54
56
auto [lower_levels, upper_levels] = get_lowers_and_uppers();
55
57
// Command for background filled curve
@@ -413,7 +415,8 @@ namespace matplot {
413
415
_levels = levels_;
414
416
415
417
// Extend minimum beyond zmin (for filled plots)
416
-
const bool log = parent_->z_axis().scale() == axis_type::axis_scale::log;
418
+
const bool log =
419
+
parent_->z_axis().scale() == axis_type::axis_scale::log;
417
420
if (extend_ == extend_option::both || extend_ == extend_option::min) {
418
421
double lower = log ? 1e-250 : -1e250;
419
422
_levels.insert(_levels.begin(), lower);
@@ -475,6 +478,8 @@ namespace matplot {
475
478
double zmin = *min_level_it;
476
479
477
480
std::stringstream ss;
481
+
ss.precision(5);
482
+
ss << std::fixed;
478
483
for (size_t i = 0; i < lines_.size(); ++i) {
479
484
if (i != 0) {
480
485
ss << ",";
@@ -766,6 +771,8 @@ namespace matplot {
766
771
auto [lower_levels, upper_levels] = get_lowers_and_uppers();
767
772
768
773
std::stringstream ss;
774
+
ss.precision(5);
775
+
ss << std::fixed;
769
776
if (filled_) {
770
777
// Plot the line segments
771
778
// Create one filled curve for each segment of a contour.
@@ -1024,7 +1031,7 @@ namespace matplot {
1024
1031
// nans at end of the underlying storage)
1025
1032
while (j + 1 < lines_[i].first.size() &&
1026
1033
is_separator(lines_[i].first[j + 1],
1027
-
lines_[i].second[j + 1])) {
1034
+
lines_[i].second[j + 1])) {
1028
1035
++j;
1029
1036
}
1030
1037
// Include an empty line to indicate this polygon or line
Original file line number Diff line number Diff line change
@@ -79,6 +79,8 @@ namespace matplot {
79
79
const bool has_x_bar = !x_negative_delta_.empty();
80
80
const bool has_xy_bar = has_y_bar && has_x_bar;
81
81
std::stringstream ss;
82
+
ss.precision(5);
83
+
ss << std::fixed;
82
84
if (has_xy_bar) {
83
85
for (size_t i = 0; i < y_data_.size(); ++i) {
84
86
ss << " " << x_data_[i] << " " << y_data_[i] << " "
Original file line number Diff line number Diff line change
@@ -58,6 +58,8 @@ namespace matplot {
58
58
59
59
std::string filled_area::data_string() {
60
60
std::stringstream ss;
61
+
ss.precision(5);
62
+
ss << std::fixed;
61
63
62
64
std::vector<double> stacked_data;
63
65
if (!stacked_) {
Original file line number Diff line number Diff line change
@@ -55,6 +55,8 @@ namespace matplot {
55
55
std::string histogram::plot_string() {
56
56
maybe_update_face_color();
57
57
std::stringstream ss;
58
+
ss.precision(5);
59
+
ss << std::fixed;
58
60
if (!is_polar()) {
59
61
if (!stairs_only_) {
60
62
ss << " '-' with boxes fillstyle solid";
@@ -87,6 +89,8 @@ namespace matplot {
87
89
std::string histogram::data_string() {
88
90
make_sure_data_is_preprocessed();
89
91
std::stringstream ss;
92
+
ss.precision(5);
93
+
ss << std::fixed;
90
94
if (!is_polar()) {
91
95
for (size_t i = 0; i < values_.size(); ++i) {
92
96
// <box center> <box height> <box width>
@@ -517,7 +521,8 @@ namespace matplot {
517
521
case binning_algorithm::sqrt:
518
522
return sqrt_rule(data, minx, maxx, hard_limits);
519
523
}
520
-
throw std::logic_error("histogram::histrogram_edges: could not find the binning algorithm");
524
+
throw std::logic_error("histogram::histrogram_edges: could not find "
525
+
"the binning algorithm");
521
526
}
522
527
523
528
std::vector<size_t>
Original file line number Diff line number Diff line change
@@ -98,6 +98,8 @@ namespace matplot {
98
98
font_size_factor = (xrange_increase + yrange_increase) / 2.;
99
99
}
100
100
std::stringstream ss;
101
+
ss.precision(5);
102
+
ss << std::fixed;
101
103
const bool custom_sizes = !sizes_.empty();
102
104
const bool custom_colors = !colors_.empty();
103
105
for (size_t i = 0; i < labels_.size(); ++i) {
Original file line number Diff line number Diff line change
@@ -163,6 +163,8 @@ namespace matplot {
163
163
const bool x_is_manual = !x_data_.empty();
164
164
165
165
std::stringstream ss;
166
+
ss.precision(5);
167
+
ss << std::fixed;
166
168
for (const auto &style : styles_to_plot()) {
167
169
if (visible_) {
168
170
const bool data_is_for_markers =
@@ -509,7 +511,7 @@ namespace matplot {
509
511
void line::run_draw_commands() {
510
512
// ask axes to draw the line
511
513
maybe_update_line_spec();
512
-
parent_->draw_path(x_data_,y_data_,line_spec_.color());
514
+
parent_->draw_path(x_data_, y_data_, line_spec_.color());
513
515
}
514
516
515
517
} // namespace matplot
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4