Plots.jl icon indicating copy to clipboard operation
Plots.jl copied to clipboard

control the size of colorbars?

Open JianghuiDu opened this issue 5 years ago • 4 comments

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?

JianghuiDu avatar Dec 27 '19 15:12 JianghuiDu

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 avatar Jan 07 '20 09:01 daschw

@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

isentropic avatar Jun 09 '20 06:06 isentropic

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.

Gyoshi avatar Dec 29 '20 17:12 Gyoshi

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!

thompsonmj avatar Mar 23 '22 16:03 thompsonmj

Fixed by the undocumented Plots.gr_cbar_width[] = <some value> (defaulting to 0.03).

t-bltg avatar Nov 05 '22 22:11 t-bltg