Skip to content

Commit 98214bc

Browse files
Update axes_type.cpp
The plot can inherit properties of a heat map and become reversed in Y-axis and have the minor_grid enabled as proposed in the issue #110 . Adding these 2 lines to each plot function solves the issue, but it is a very bad fix in my opinion. Ideally, every class should have a feature where its default settings are reset.
1 parent 36d8dc6 commit 98214bc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

source/matplot/core/axes_type.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2318,6 +2318,8 @@ namespace matplot {
23182318
line_handle axes_type::plot(const std::vector<double> &x,
23192319
const std::vector<double> &y,
23202320
std::string_view line_spec) {
2321+
this->y_axis().reverse(false);
2322+
this->minor_grid(false);
23212323
axes_silencer s{this};
23222324
line_handle l = std::make_shared<class line>(this, x, y, line_spec);
23232325
this->emplace_object(l);
@@ -2326,6 +2328,8 @@ namespace matplot {
23262328

23272329
line_handle axes_type::plot(const std::vector<double> &y,
23282330
std::string_view line_spec) {
2331+
this->y_axis().reverse(false);
2332+
this->minor_grid(false);
23292333
axes_silencer s{this};
23302334
line_handle l = std::make_shared<class line>(this, y, line_spec);
23312335
this->emplace_object(l);
@@ -5416,4 +5420,4 @@ namespace matplot {
54165420
parent_->backend_->draw_path(cx,cy,color);
54175421
}
54185422

5419-
} // namespace matplot
5423+
} // namespace matplot

0 commit comments

Comments
 (0)