From 7ab8c8ff7d817711bf57b2ad15c65137c525cacd Mon Sep 17 00:00:00 2001 From: Christopher Albert Date: Wed, 1 Oct 2025 16:55:29 +0200 Subject: [PATCH] fix: allow log tick labels below epsilon --- src/utilities/ticks/fortplot_tick_formatting.f90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utilities/ticks/fortplot_tick_formatting.f90 b/src/utilities/ticks/fortplot_tick_formatting.f90 index 73513b77..33301c72 100644 --- a/src/utilities/ticks/fortplot_tick_formatting.f90 +++ b/src/utilities/ticks/fortplot_tick_formatting.f90 @@ -26,7 +26,7 @@ function format_tick_value(value, range) result(formatted) abs_value = abs(value) - if (abs_value < 1.0e-10_wp) then + if (abs_value <= epsilon(1.0_wp)) then formatted = '0' else if (range >= 100.0_wp .or. abs_value >= SCIENTIFIC_THRESHOLD_HIGH) then ! Use integer format for large ranges @@ -60,7 +60,7 @@ function format_tick_value_smart(value, max_chars) result(formatted) abs_value = abs(value) ! Handle zero - if (abs_value < 1.0e-10_wp) then + if (abs_value <= epsilon(1.0_wp)) then formatted = '0' return end if