Merge pull request #716 from mkborregaard/fix-gr_inqtext

define default behaviour for symbol in gr_text
This commit is contained in:
Michael Krabbe Borregaard 2017-03-04 15:13:36 +01:00 committed by GitHub
commit 124f1fe701

View File

@ -172,6 +172,8 @@ function gr_polyline(x, y, func = GR.polyline; arrowside=:none)
end
end
gr_inqtext(x, y, s::Symbol) = gr_inqtext(x, y, string(s))
function gr_inqtext(x, y, s)
if length(s) >= 2 && s[1] == '$' && s[end] == '$'
GR.inqtextext(x, y, s[2:end-1])
@ -182,6 +184,8 @@ function gr_inqtext(x, y, s)
end
end
gr_text(x, y, s::Symbol) = gr_text(x, y, string(s))
function gr_text(x, y, s)
if length(s) >= 2 && s[1] == '$' && s[end] == '$'
GR.mathtex(x, y, s[2:end-1])