Skip to content

Commit

Permalink
GR backend: use textext for :log2 and :ln axis scaling
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 27, 2024
1 parent 18b7551 commit a08a88c
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 src/backends/gr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit a08a88c

Please sign in to comment.