You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Data
x =rand([1, 2, 3, 4, 5], 50)
y =rand(50)
z =rand(50)
# Vector with labels to show on hover
hovector = []
for i in1:length(x)
label ="$(x[i]), $(y[i]), $(z[i])"push!(hovector, label)
end# Frequency histograms and blank plot for top right cornerplotly()
x_hist = Plots.plot(x,
st =:histogram,
nb =50,
leg =false,
yguide ="Frequency",
xticks =false,
guide_position =:left,
color =RGB{Float64}(0.031,0.318,0.612))
y_hist = Plots.plot(y,
st =:histogram,
nb =50,
leg =false,
color =RGB{Float64}(0.031,0.318,0.612),
yticks =false,
xguide ="Frequency",
orientation =:h)
blank = Plots.plot(grid =false, showaxis =false)
# Main plot
bubblecolor =cgrad(:inferno, scale =:exp)
bubbles = Plots.plot(x, y, st =:scatter,
marker_z = z,
ms =10,
hover = hovector,
color = bubblecolor,
label =nothing,
cb =false)
# Workaround for title (plot_title not currently implemented, see http://docs.juliaplots.org/latest/generated/attributes_plot/)
title = Plots.plot(ones(3), line =nothing, size = (600, 80),
grid =false, showaxis =false, leg =false,
annotations=(2, 1.5, "Main Title"))
# Merge plots
l =@layout [x_hist blank
bubbles{0.8w,0.8h} y_hist]
plots = Plots.plot(x_hist, blank, bubbles, y_hist,
layout = l, link =:both,
size = (700, 500))
superplot = Plots.plot(title, plots, layout =grid(2,1,heights=[0.1,0.9]))
# Add colorbar
Plots.plot!([0], [0], zcolor=[NaN], cbtitle="Intensity", leg =false,
clims =extrema(z),
color = bubblecolor,
background_color_subplot=:transparent,
markerstrokecolor=:transparent, framestyle=:none,
cb =:right,
inset=bbox(0.1, 0, 0.05, 0.9, :center, :right),
subplot=6)
which gives me:
My question is related to the last block # Add colorbar (note the color gradient bubblecolor defined just under # Main plot). I am using an exponential scale for my color gradient to make lower Intensity values stand out more clearly -darkly-, and although this is reflected in the color of the bubbles themselves, the colorbar still shows the default linear scale of the :inferno color gradient. This obviously affects the readability of the main scatter.
If I change the line where bubblecolor is defined to
So, the color attribute in the last block is sensitive to changes in rev within cgrad, but not scale. Is this an expected limitation, or am I doing something wrong?
PS: Any idea why the cbtitle “Intensity” doesn’t show up? This is less of an issue but would be great to be able to include it.
Backends
This bug occurs on ( insert x below )
Backend
yes
no
untested
gr (default)
x
pyplot
error
plotly
x
plotlyjs
x
pgfplotsx
x
inspectdr
x
Versions
Plots.jl version:
Backend version (]st -m):
Output of versioninfo():
The text was updated successfully, but these errors were encountered:
I have also found this same bug. The colorbar in pyplot() does not respect the cgrad scale. This however works in gr().
This used to work in v1.10.2. I noticed the bug once I upgraded to v1.16.4.
An example follows: pyplot() A = rand(0:10,10,10) grad = cgrad(:inferno, scale =:log) heatmap(A, c = grad) grad2 = cgrad(:inferno, scale =:exp) heatmap(A, c = grad2)
And now in gr() gr() heatmap(A, c = grad) heatmap(A, c = grad2)
Details
I have built the following composite plot:
which gives me:
My question is related to the last block
# Add colorbar
(note the color gradientbubblecolor
defined just under# Main plot
). I am using an exponential scale for my color gradient to make lower Intensity values stand out more clearly -darkly-, and although this is reflected in the color of the bubbles themselves, the colorbar still shows the default linear scale of the:inferno
color gradient. This obviously affects the readability of the main scatter.If I change the line where
bubblecolor
is defined tothen I get:
So, the
color
attribute in the last block is sensitive to changes inrev
withincgrad
, but notscale
. Is this an expected limitation, or am I doing something wrong?PS: Any idea why the
cbtitle
“Intensity” doesn’t show up? This is less of an issue but would be great to be able to include it.Backends
This bug occurs on ( insert
x
below )Versions
Plots.jl version:
Backend version (
]st -m
):Output of
versioninfo()
:The text was updated successfully, but these errors were encountered: