fix surface for pyplot
This commit is contained in:
parent
0628fb9dc3
commit
d59f6c96d5
@ -924,7 +924,7 @@ function _before_layout_calcs(plt::Plot{PyPlotBackend})
|
|||||||
kw[:spacing] = "proportional"
|
kw[:spacing] = "proportional"
|
||||||
|
|
||||||
if RecipesPipeline.is3d(sp) || ispolar(sp)
|
if RecipesPipeline.is3d(sp) || ispolar(sp)
|
||||||
cbax = fig."add_axes"([0.9, 0.1, 0.03, 0.8])
|
cbax = fig."add_axes"([0.9, 0.1, 0.03, 0.8], label=string("cbar", sp[:subplot_index]))
|
||||||
cb = fig."colorbar"(handle; cax=cbax, kw...)
|
cb = fig."colorbar"(handle; cax=cbax, kw...)
|
||||||
else
|
else
|
||||||
# divider approach works only with 2d plots
|
# divider approach works only with 2d plots
|
||||||
@ -949,7 +949,7 @@ function _before_layout_calcs(plt::Plot{PyPlotBackend})
|
|||||||
colorbar_orientation="horizontal"
|
colorbar_orientation="horizontal"
|
||||||
end
|
end
|
||||||
|
|
||||||
cbax = divider.append_axes(colorbar_position, size="5%", pad=colorbar_pad) # Reasonable value works most of the usecases
|
cbax = divider.append_axes(colorbar_position, size="5%", pad=colorbar_pad, label=string("cbar", sp[:subplot_index])) # Reasonable value works most of the usecases
|
||||||
cb = fig."colorbar"(handle; cax=cbax, orientation = colorbar_orientation, kw...)
|
cb = fig."colorbar"(handle; cax=cbax, orientation = colorbar_orientation, kw...)
|
||||||
|
|
||||||
if sp[:colorbar] == :left
|
if sp[:colorbar] == :left
|
||||||
@ -1257,11 +1257,10 @@ function _update_min_padding!(sp::Subplot{PyPlotBackend})
|
|||||||
|
|
||||||
|
|
||||||
# optionally add the width of colorbar labels and colorbar to rightpad
|
# optionally add the width of colorbar labels and colorbar to rightpad
|
||||||
# if haskey(sp.attr, :cbar_ax)
|
if RecipesPipeline.is3d(sp) || haskey(sp.attr, :cbar_ax)
|
||||||
# bb = py_bbox(sp.attr[:cbar_handle]."ax"."get_yticklabels"())
|
bb = py_bbox(sp.attr[:cbar_handle]."ax"."get_yticklabels"())
|
||||||
# sp.attr[:cbar_width] = width(bb) + (sp[:colorbar_title] == "" ? 0px : 30px)
|
sp.attr[:cbar_width] = width(bb) + (sp[:colorbar_title] == "" ? 0px : 30px)
|
||||||
# rightpad = rightpad + sp.attr[:cbar_width]
|
end
|
||||||
# end
|
|
||||||
|
|
||||||
# add in the user-specified margin
|
# add in the user-specified margin
|
||||||
leftpad += sp[:left_margin]
|
leftpad += sp[:left_margin]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user