From 51eabf08e1521c95d5ffbcc268964ce5c273e0f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Mon, 30 Mar 2020 16:04:59 +0200 Subject: [PATCH] [python] matplotlib: fix PlotStore::initRange for an only dot --- python/port/mod/matplotlib/pyplot/plot_store.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/python/port/mod/matplotlib/pyplot/plot_store.cpp b/python/port/mod/matplotlib/pyplot/plot_store.cpp index 68b61ae98..4eeb49d63 100644 --- a/python/port/mod/matplotlib/pyplot/plot_store.cpp +++ b/python/port/mod/matplotlib/pyplot/plot_store.cpp @@ -176,6 +176,9 @@ void checkPositiveRangeAndAddMargin(float * min, float * max) { } // Add margins float margin = (*max - *min)/10.0f; + if (margin < FLT_EPSILON) { + margin = 1.0f; + } *min -= margin; *max += margin; }