Implement title_location for GR
This commit is contained in:
parent
226bf7e705
commit
530ad1e701
@ -20,7 +20,7 @@ const _gr_attr = merge_with_base_supported([
|
|||||||
:fillrange, :fillcolor, :fillalpha,
|
:fillrange, :fillcolor, :fillalpha,
|
||||||
:bins,
|
:bins,
|
||||||
:layout,
|
:layout,
|
||||||
:title, :window_title,
|
:title, :title_location, :window_title,
|
||||||
:guide, :lims, :ticks, :scale, :flip,
|
:guide, :lims, :ticks, :scale, :flip,
|
||||||
:tickfont, :guidefont, :legendfont,
|
:tickfont, :guidefont, :legendfont,
|
||||||
:grid, :gridalpha, :gridstyle, :gridlinewidth,
|
:grid, :gridalpha, :gridstyle, :gridlinewidth,
|
||||||
@ -865,7 +865,14 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
|
|||||||
gr_set_font(sp[:titlefont])
|
gr_set_font(sp[:titlefont])
|
||||||
GR.settextalign(GR.TEXT_HALIGN_CENTER, GR.TEXT_VALIGN_TOP)
|
GR.settextalign(GR.TEXT_HALIGN_CENTER, GR.TEXT_VALIGN_TOP)
|
||||||
gr_set_textcolor(sp[:foreground_color_title])
|
gr_set_textcolor(sp[:foreground_color_title])
|
||||||
gr_text(gr_view_xcenter(), viewport_subplot[4], sp[:title])
|
tpos = if sp[:title_location] == :left
|
||||||
|
viewport_plotarea[1]
|
||||||
|
elseif sp[:title_location] == :right
|
||||||
|
viewport_plotarea[2]
|
||||||
|
else
|
||||||
|
gr_view_xcenter()
|
||||||
|
end
|
||||||
|
gr_text(tpos, viewport_subplot[4], sp[:title])
|
||||||
end
|
end
|
||||||
|
|
||||||
if xaxis[:guide] != ""
|
if xaxis[:guide] != ""
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user