Print vectors passed to label a as vectors in GR
This commit is contained in:
parent
236aaed2a3
commit
bd8e9dc947
@ -874,7 +874,6 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
|
|||||||
# has to be done now due to a potential adjustment to the plotarea given an outer legend.
|
# has to be done now due to a potential adjustment to the plotarea given an outer legend.
|
||||||
legendn = 0
|
legendn = 0
|
||||||
legendw = 0
|
legendw = 0
|
||||||
legendi = 0
|
|
||||||
if sp[:legend] != :none
|
if sp[:legend] != :none
|
||||||
GR.savestate()
|
GR.savestate()
|
||||||
GR.selntran(0)
|
GR.selntran(0)
|
||||||
@ -889,12 +888,7 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
|
|||||||
for series in series_list(sp)
|
for series in series_list(sp)
|
||||||
should_add_to_legend(series) || continue
|
should_add_to_legend(series) || continue
|
||||||
legendn += 1
|
legendn += 1
|
||||||
if typeof(series[:label]) <: Array
|
|
||||||
legendi += 1
|
|
||||||
lab = series[:label][legendi]
|
|
||||||
else
|
|
||||||
lab = series[:label]
|
lab = series[:label]
|
||||||
end
|
|
||||||
tbx, tby = gr_inqtext(0, 0, string(lab))
|
tbx, tby = gr_inqtext(0, 0, string(lab))
|
||||||
legendw = max(legendw, tbx[3] - tbx[1])
|
legendw = max(legendw, tbx[3] - tbx[1])
|
||||||
end
|
end
|
||||||
@ -1485,7 +1479,6 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
|
|||||||
GR.setscale(0)
|
GR.setscale(0)
|
||||||
gr_set_font(legendfont(sp))
|
gr_set_font(legendfont(sp))
|
||||||
w = legendw
|
w = legendw
|
||||||
i = legendi
|
|
||||||
n = legendn
|
n = legendn
|
||||||
if w > 0
|
if w > 0
|
||||||
dy = _gr_point_mult[1] * sp[:legendfontsize] * 1.75
|
dy = _gr_point_mult[1] * sp[:legendfontsize] * 1.75
|
||||||
@ -1538,12 +1531,7 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
|
|||||||
gr_draw_markers(series, xpos - .035, ypos, clims, 6)
|
gr_draw_markers(series, xpos - .035, ypos, clims, 6)
|
||||||
end
|
end
|
||||||
|
|
||||||
if typeof(series[:label]) <: Array
|
|
||||||
i += 1
|
|
||||||
lab = series[:label][i]
|
|
||||||
else
|
|
||||||
lab = series[:label]
|
lab = series[:label]
|
||||||
end
|
|
||||||
GR.settextalign(GR.TEXT_HALIGN_LEFT, GR.TEXT_VALIGN_HALF)
|
GR.settextalign(GR.TEXT_HALIGN_LEFT, GR.TEXT_VALIGN_HALF)
|
||||||
gr_set_textcolor(sp[:legendfontcolor])
|
gr_set_textcolor(sp[:legendfontcolor])
|
||||||
gr_text(xpos, ypos, string(lab))
|
gr_text(xpos, ypos, string(lab))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user