Merge pull request #1260 from jheinen/master

gr: added support for non-string legend labels
This commit is contained in:
Josef Heinen 2017-11-22 21:46:38 +01:00 committed by GitHub
commit 1419a919aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1212,7 +1212,7 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
else
lab = series[:label]
end
tbx, tby = gr_inqtext(0, 0, lab)
tbx, tby = gr_inqtext(0, 0, string(lab))
w = max(w, tbx[3] - tbx[1])
end
if w > 0
@ -1271,7 +1271,7 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
end
GR.settextalign(GR.TEXT_HALIGN_LEFT, GR.TEXT_VALIGN_HALF)
gr_set_textcolor(sp[:legendfontcolor])
gr_text(xpos, ypos, lab)
gr_text(xpos, ypos, string(lab))
ypos -= dy
end
end