working prototype

This commit is contained in:
Zhanibek 2021-03-19 12:25:52 +09:00
parent 7857eca3e3
commit ea66ee42fa
2 changed files with 11 additions and 9 deletions

View File

@ -383,6 +383,7 @@ const _subplot_defaults = KW(
:legendtitle => nothing, :legendtitle => nothing,
:colorbar => :legend, :colorbar => :legend,
:clims => :auto, :clims => :auto,
:colorbar_fontfamily => :match,
:colorbar_ticks => :auto, :colorbar_ticks => :auto,
:colorbar_tickfontfamily => :match, :colorbar_tickfontfamily => :match,
:colorbar_tickfontsize => 8, :colorbar_tickfontsize => 8,
@ -418,7 +419,6 @@ const _subplot_defaults = KW(
:colorbar_title => "", :colorbar_title => "",
:colorbar_titlefontsize => 10, :colorbar_titlefontsize => 10,
:colorbar_title_location => :center, # also :left or :right :colorbar_title_location => :center, # also :left or :right
:colorbar_fontfamily => :match,
:colorbar_titlefontfamily => :match, :colorbar_titlefontfamily => :match,
:colorbar_titlefonthalign => :hcenter, :colorbar_titlefonthalign => :hcenter,
:colorbar_titlefontvalign => :vcenter, :colorbar_titlefontvalign => :vcenter,
@ -1340,10 +1340,10 @@ const _match_map = KW(
:background_color_inside => :background_color_subplot, :background_color_inside => :background_color_subplot,
:foreground_color_legend => :foreground_color_subplot, :foreground_color_legend => :foreground_color_subplot,
:foreground_color_title => :foreground_color_subplot, :foreground_color_title => :foreground_color_subplot,
:left_margin => :margin, :left_margin => :margin,
:top_margin => :margin, :top_margin => :margin,
:right_margin => :margin, :right_margin => :margin,
:bottom_margin => :margin, :bottom_margin => :margin,
:titlefontfamily => :fontfamily_subplot, :titlefontfamily => :fontfamily_subplot,
:titlefontcolor => :foreground_color_subplot, :titlefontcolor => :foreground_color_subplot,
:legendfontfamily => :fontfamily_subplot, :legendfontfamily => :fontfamily_subplot,
@ -1353,6 +1353,8 @@ const _match_map = KW(
:colorbar_fontfamily => :fontfamily_subplot, :colorbar_fontfamily => :fontfamily_subplot,
:colorbar_titlefontfamily => :fontfamily_subplot, :colorbar_titlefontfamily => :fontfamily_subplot,
:colorbar_titlefontcolor => :foreground_color_subplot, :colorbar_titlefontcolor => :foreground_color_subplot,
:colorbar_tickfontfamily => :fontfamily_subplot,
:colorbar_tickfontcolor => :foreground_color_subplot,
:plot_titlefontfamily => :fontfamily, :plot_titlefontfamily => :fontfamily,
:plot_titlefontcolor => :foreground_color, :plot_titlefontcolor => :foreground_color,
:tickfontcolor => :foreground_color_text, :tickfontcolor => :foreground_color_text,

View File

@ -978,7 +978,7 @@ function _before_layout_calcs(plt::Plot{PyPlotBackend})
end end
cb."set_label"(sp[:colorbar_title],size=py_thickness_scale(plt, sp[:yaxis][:guidefontsize]),family=sp[:yaxis][:guidefontfamily], color = py_color(sp[:yaxis][:guidefontcolor])) cb."set_label"(sp[:colorbar_title],size=py_thickness_scale(plt, sp[:colorbar_titlefontsize]),family=sp[:colorbar_titlefontfamily], color = py_color(sp[:colorbar_titlefontcolor]))
# cb."formatter".set_useOffset(false) # This for some reason does not work, must be a pyplot bug, instead this is a workaround: # cb."formatter".set_useOffset(false) # This for some reason does not work, must be a pyplot bug, instead this is a workaround:
cb."formatter".set_powerlimits((-Inf, Inf)) cb."formatter".set_powerlimits((-Inf, Inf))
@ -1000,9 +1000,9 @@ function _before_layout_calcs(plt::Plot{PyPlotBackend})
sp[:colorbar_ticks] == :native ? nothing : py_set_ticks(cb.ax, ticks, ticks_letter, env) sp[:colorbar_ticks] == :native ? nothing : py_set_ticks(cb.ax, ticks, ticks_letter, env)
for lab in cbar_axis."get_ticklabels"() for lab in cbar_axis."get_ticklabels"()
lab."set_fontsize"(py_thickness_scale(plt, axis[:colorbar_tickfontsize])) lab."set_fontsize"(py_thickness_scale(plt, sp[:colorbar_tickfontsize]))
lab."set_family"(axis[:colorbar_tickfontfamily]) lab."set_family"(sp[:colorbar_tickfontfamily])
lab."set_color"(py_color(axis[:colorbar_tickfontcolor])) lab."set_color"(py_color(sp[:colorbar_tickfontcolor]))
end end
# Adjust thickness of the cbar ticks # Adjust thickness of the cbar ticks