Hi,
When using heatmap
together with Colorbar
, I am having trouble understanding how to use the arguments colorrange
and lowclip, highclip
.
I want to plot an array with values ranging from 0 to 1. If I try to make a figure that only has colors corresponding to the range 0.2 to 0.8, I would expect to see extended triangles on the Colorbar above 0.8 and below 0.2. However, this does not happen by default.
# Define array of data to plot ranging from 0.0 to 1.0
z = rand(Float64, (10, 10));
# Plot only colors from 0.2 to 0.8
f, ax, hm = heatmap(z,colorrange=(0.2,0.8));
Colorbar(f[:,end+1],hm,ticks=(0.0:0.2:1.0,string.(0.0:0.2:1.0)));
f
I would expect the above example to include the extended triangles. What can I do to include them here?
Additionally:
- How can I make
heatmap
and/orColorbar
determine automatically whether to show the triangles? - What can I pass to the arguments
lowclip
orhighclip
so that they impose the first and last color of acolormap
object?
Thanks!