Skip to content

Commit

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

Only the case of :log10 has been treated before.
  • Loading branch information
pjaap authored Oct 2, 2024
1 parent 5a611ce commit f000fc7
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 f000fc7

Please sign in to comment.