Skip to content

Commit

Permalink
GR backend: use textext for :log2 and :ln axis scaling (JuliaPlots#4991)
Browse files Browse the repository at this point in the history
This fixes JuliaPlots#4871

Only the case of :log10 has been treated before.
  • Loading branch information
pjaap committed Sep 30, 2024
1 parent 5a611ce commit a1a80c8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .zenodo.json
Original file line number Diff line number Diff line change
Expand Up @@ -775,6 +775,10 @@
"affiliation": "The Alan Turing Institute",
"name": "Penelope Yong",
"type": "Other"
},
{
"name": "Patrick Jaap",
"type": "Other"
}
],
"upload_type": "software"
Expand Down
4 changes: 2 additions & 2 deletions PlotsBase/ext/GRExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,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
Expand All @@ -440,7 +440,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
Expand Down

0 comments on commit a1a80c8

Please sign in to comment.