Merge pull request #926 from daschw/ds-pyplot-colorbar
Reduced colorbar size on PyPlot for big z values (fix #925)
This commit is contained in:
commit
c9839dbefa
@ -1220,7 +1220,8 @@ function _update_plot_object(plt::Plot{PyPlotBackend})
|
|||||||
if haskey(sp.attr, :cbar_ax)
|
if haskey(sp.attr, :cbar_ax)
|
||||||
cbw = sp.attr[:cbar_width]
|
cbw = sp.attr[:cbar_width]
|
||||||
# this is the bounding box of just the colors of the colorbar (not labels)
|
# this is the bounding box of just the colors of the colorbar (not labels)
|
||||||
cb_bbox = BoundingBox(right(sp.bbox)-cbw+1mm, top(sp.bbox)+2mm, _cbar_width-1mm, height(sp.bbox)-4mm)
|
has_toplabel = sp[:zaxis][:extrema].emax >= 1e7
|
||||||
|
cb_bbox = BoundingBox(right(sp.bbox)-cbw+1mm, top(sp.bbox) + (has_toplabel ? 4mm : 2mm), _cbar_width-1mm, height(sp.bbox) - (has_toplabel ? 6mm : 4mm))
|
||||||
pcts = bbox_to_pcts(cb_bbox, figw, figh)
|
pcts = bbox_to_pcts(cb_bbox, figw, figh)
|
||||||
sp.attr[:cbar_ax][:set_position](pcts)
|
sp.attr[:cbar_ax][:set_position](pcts)
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user