How do I change the attributes of the colorbar in Plots? In particular I would like to change the width and change the location, s.t. it is directly next to the corresponding plot.
Thanks in advance.
How do I change the attributes of the colorbar in Plots? In particular I would like to change the width and change the location, s.t. it is directly next to the corresponding plot.
Thanks in advance.
Can you provide a small example of what your plot currently looks like together with the code that generated the plot? It would make it easier to answer your question.
Sure.
using Plots
x=rand(10)
y=rand(10)
zvals=rand(10)
scatter(x,y,
xguidefontsize=18, yguidefontsize=18,
label = "",
size = (700,400),
#colorbar =:best,
marker_z = zvals,
seriescolor=:cividis,
markersize = 10,
tickfontsize = 14,
)
the colorbar =
may be used to change the location of the colorbar.
Is any idea how to change width of colorbar?
Take a look at this solution where we use a layout and replace the colorbar with a heatmap with only the labels on the y-axis.