This example should show a text annotation on the over the plotted horizontal line. If the y-value of the line is even, use red text, otherwise, use green text.
using Interact, Plots, Blink
ui = @manipulate for y in slider(1:10)
c = y % 2 == 0 ? :red : :green
display(c)
plot(
[x -> y],
0:10,
xlims = (0,10),
ylims = (0,10),
annotations = (5,y,text("color annotation", color=c)),
legend=false,
)
end
w = Window()
body!(w, ui);
Observed behavior is that the colors are rounded to the nearest black or white value.
The following scatter! command will add a point to the plot and re-display it outside of interact. Now the text colors are displayed correctly.
scatter!([1],[1])
Reproduced this issue in Juno and in the browser with Mux.
This example should show a text annotation on the over the plotted horizontal line. If the y-value of the line is even, use
red
text, otherwise, usegreen
text.Observed behavior is that the colors are rounded to the nearest
black
orwhite
value.The following
scatter!
command will add a point to the plot and re-display it outside of interact. Now the text colors are displayed correctly.Reproduced this issue in Juno and in the browser with Mux.