From b50b774c5be776bfe9386175b09b856bee97c16a Mon Sep 17 00:00:00 2001 From: Patrick Jaap Date: Mon, 30 Sep 2024 14:59:06 +0200 Subject: [PATCH] GR backend: use textext for :log2 and :ln axis scaling (#4991) This fixes #4871 Only the case of :log10 has been treated before. --- .zenodo.json | 4 ++++ src/backends/gr.jl | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.zenodo.json b/.zenodo.json index 42fbc2c8a..eb7341d1f 100644 --- a/.zenodo.json +++ b/.zenodo.json @@ -775,6 +775,10 @@ "affiliation": "The Alan Turing Institute", "name": "Penelope Yong", "type": "Other" + }, + { + "name": "Patrick Jaap", + "type": "Other" } ], "upload_type": "software" diff --git a/src/backends/gr.jl b/src/backends/gr.jl index 64b61562f..7e9cc2771 100644 --- a/src/backends/gr.jl +++ b/src/backends/gr.jl @@ -250,7 +250,7 @@ end gr_inqtext(x, y, s) = gr_inqtext(x, y, string(s)) gr_inqtext(x, y, s::AbstractString) = - if (occursin('\\', s) || occursin("10^{", s)) && + if (occursin('\\', s) || occursin(r"10\^{|2\^{|e\^{", s)) && match(r".*\$[^\$]+?\$.*", String(s)) === nothing GR.inqtextext(x, y, s) else @@ -259,7 +259,7 @@ gr_inqtext(x, y, s::AbstractString) = gr_text(x, y, s) = gr_text(x, y, string(s)) gr_text(x, y, s::AbstractString) = - if (occursin('\\', s) || occursin("10^{", s)) && + if (occursin('\\', s) || occursin(r"10\^{|2\^{|e\^{", s)) && match(r".*\$[^\$]+?\$.*", String(s)) === nothing GR.textext(x, y, s) else