Add option to change guide positions in pyplot

This commit is contained in:
Godisemo 2018-09-13 11:22:49 +02:00
parent 5d0740c0e5
commit 279ef2075f
2 changed files with 5 additions and 1 deletions

View File

@ -350,6 +350,7 @@ const _subplot_defaults = KW(
const _axis_defaults = KW( const _axis_defaults = KW(
:guide => "", :guide => "",
:guide_position => :auto,
:lims => :auto, :lims => :auto,
:ticks => :auto, :ticks => :auto,
:scale => :identity, :scale => :identity,

View File

@ -14,7 +14,7 @@ const _pyplot_attr = merge_with_base_supported([
:bins, :bar_width, :bar_edges, :bar_position, :bins, :bar_width, :bar_edges, :bar_position,
:title, :title_location, :titlefont, :title, :title_location, :titlefont,
:window_title, :window_title,
:guide, :lims, :ticks, :scale, :flip, :rotation, :guide, :guide_position, :lims, :ticks, :scale, :flip, :rotation,
:titlefontfamily, :titlefontsize, :titlefontcolor, :titlefontfamily, :titlefontsize, :titlefontcolor,
:legendfontfamily, :legendfontsize, :legendfontcolor, :legendfontfamily, :legendfontsize, :legendfontcolor,
:tickfontfamily, :tickfontsize, :tickfontcolor, :tickfontfamily, :tickfontsize, :tickfontcolor,
@ -1053,6 +1053,9 @@ function _before_layout_calcs(plt::Plot{PyPlotBackend})
pyaxis[:set_ticks_position]("both") # the hash marks pyaxis[:set_ticks_position]("both") # the hash marks
pyaxis[Symbol(:tick_, pos)]() # the tick labels pyaxis[Symbol(:tick_, pos)]() # the tick labels
end end
if axis[:guide_position] != :auto && letter != :z
pyaxis[:set_label_position](axis[:guide_position])
end
py_set_scale(ax, axis) py_set_scale(ax, axis)
axis[:ticks] != :native ? py_set_lims(ax, axis) : nothing axis[:ticks] != :native ? py_set_lims(ax, axis) : nothing
if ispolar(sp) && letter == :y if ispolar(sp) && letter == :y