Plots.jl
Plots.jl copied to clipboard
control the size of colorbars?
the widths of my color bars are too large. Is there a way to make them thinner? Or control the relative width to the plot region? When I put multiple plots together the relative widths of color bars also become even larger. Is there a way to fix this ratio in subplots?
There is no plot attribute that controls the colorbar width. Especially for the GR backend the automatical positioning and sizing of plot area, colorbars, ticks, axes guides, legends, etc. could be significantly improved, but it's a tricky issue. Any help is welcome and very much appreciated.
@daschw is there a way we could get a colorbarpadding
and colorbarwidth
arguments available? pyplot can really use these arguments for optional user colorbar tweaking.
I believe colorbarpadding
is especially useful as it is hard to determine the right spacing when comes to the 3d plots. Colorbar might overlap with zguidelabel. And it is fairly common
Since I couldn't find a workaround for sizing the colorbar anywhere else, here is a hack for adjusting the size/position of a colorbar that works by adjusting the bbox of an invisible inset subplot.
FWIW, I've been using plotly and gr for plotting and ran into this issue with portly colorbars. Tried pyplot, and the colorbars are much nicer with 0 effort!
Fixed by the undocumented Plots.gr_cbar_width[] = <some value>
(defaulting to 0.03
).