diff --git a/python/port/mod/matplotlib/modpyplot.cpp b/python/port/mod/matplotlib/modpyplot.cpp index 32f156387..5e634c29d 100644 --- a/python/port/mod/matplotlib/modpyplot.cpp +++ b/python/port/mod/matplotlib/modpyplot.cpp @@ -74,6 +74,7 @@ mp_obj_t modpyplot_axis(mp_obj_t arg) { sPlotStore->setXMax(mp_obj_get_float(items[1])); sPlotStore->setYMin(mp_obj_get_float(items[2])); sPlotStore->setYMax(mp_obj_get_float(items[3])); + sPlotStore->setAxesAuto(false); } // Build the return value diff --git a/python/port/mod/matplotlib/plot_controller.cpp b/python/port/mod/matplotlib/plot_controller.cpp index eb7aa0abf..1beb952f5 100644 --- a/python/port/mod/matplotlib/plot_controller.cpp +++ b/python/port/mod/matplotlib/plot_controller.cpp @@ -3,6 +3,7 @@ namespace Matplotlib { void PlotController::viewWillAppear() { + m_store->initRange(); curveView()->reload(); } diff --git a/python/port/mod/matplotlib/plot_store.h b/python/port/mod/matplotlib/plot_store.h index 41eaa1bae..12ff2fbf8 100644 --- a/python/port/mod/matplotlib/plot_store.h +++ b/python/port/mod/matplotlib/plot_store.h @@ -121,6 +121,7 @@ public: void setAxesRequested(bool b) { m_axesRequested = b; } bool axesRequested() const { return m_axesRequested; } + void setAxesAuto(bool b) { m_axesAuto = b; } void initRange(); void setGridRequested(bool b) { m_gridRequested = b; }