Powered by AppSignal & Oban Pro

Bluered Colorscale

32_bluered_colorscale.livemd

Bluered Colorscale

Mix.install([
  {:plotly_ex, "~> 0.3"},
  {:kino, "~> 0.18"}
])

Section

"Bluered" is a diverging colorscale from blue (low) to red (high), passing through white at the midpoint. Similar to RdBu but with blue on the low end.

alias Plotly.{Figure, Heatmap}

z = for i <- 0..9, do: (for j <- 0..9, do: :math.sin(i / 3.0 + j / 5.0) * 10)

Figure.new()
|> Figure.add_trace(Heatmap.new(z: z, colorscale: "Bluered"))
|> Figure.update_layout(title: "Bluered Colorscale Heatmap")
|> Plotly.show()