@@ -47,6 +47,7 @@ namespace matplot {
4747 if (next_plot_replace_) {
4848 children_.clear ();
4949 colororder_index_ = 0 ;
50+ axes_type::clear ();
5051 }
5152 children_.push_back (obj);
5253 touch ();
@@ -2214,6 +2215,9 @@ namespace matplot {
22142215 y_axis_.limits_mode_auto (true );
22152216 y2_axis_.limits_mode_auto (true );
22162217 z_axis_.limits_mode_auto (true );
2218+ axes_type::x_axis ().reverse (false );
2219+ axes_type::y_axis ().reverse (false );
2220+ minor_grid (false );
22172221 touch ();
22182222 }
22192223
@@ -2318,8 +2322,6 @@ namespace matplot {
23182322 line_handle axes_type::plot (const std::vector<double > &x,
23192323 const std::vector<double > &y,
23202324 std::string_view line_spec) {
2321- this ->y_axis ().reverse (false );
2322- this ->minor_grid (false );
23232325 axes_silencer s{this };
23242326 line_handle l = std::make_shared<class line >(this , x, y, line_spec);
23252327 this ->emplace_object (l);
@@ -2328,8 +2330,6 @@ namespace matplot {
23282330
23292331 line_handle axes_type::plot (const std::vector<double > &y,
23302332 std::string_view line_spec) {
2331- this ->y_axis ().reverse (false );
2332- this ->minor_grid (false );
23332333 axes_silencer s{this };
23342334 line_handle l = std::make_shared<class line >(this , y, line_spec);
23352335 this ->emplace_object (l);
0 commit comments