Hi AIMPED,
Thanks for your answer, but it didn’t help me, my Python is pretty much rusty so I dont really understand your code … I have understand that the colorbar is a marker property, I have tryed
Couleurs = range(colorant"skyblue", stop=colorant"red", length=length(VitesseClasse))
trace = barpolar(r=Frequence, theta=direction, mode="lines",
marker=attr(
size=Frequence,
sizeref=0.05,
color=Vitesse,
autocolorscale=false,
colorscale=Couleurs,
colorbar=attr(
tickmode="array",
tickvals=VitesseClasse[2:end] .- 1,
ticktext=categories)))
layout = Layout(
title = attr(
text = "Wind rose",
x = 0.5,
xanchor = "center"))
plot(trace,layout)
But the result is not what I expect :
The color bar is display but not on the all set of values (0-2, 2-4, … 28-30) and without colors
following a MWE for 7 directions :
Frequence = [0.33177112545511583, 0.27283184242297487, 0.2148431929881266, 0.11502666527240407, 0.03707471029441123, 0.012358236764803741, 0.0009506335972925955, 0.001901267194585191, 0.001901267194585191, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.40592054604393824, 0.28233817839590086, 0.1074215964940633, 0.05608738224026314, 0.010456969570218551, 0.0009506335972925955, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.5095396081488313,0.20913939140437102, 0.09126082534008917, 0.013308870362096338, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.6445295789643798, 0.30705465192550835, 0.07795195497799283, 0.030420275113363055, 0.001901267194585191, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
1.1692793246698925, 0.4857737682165163, 0.17396594830454498, 0.038975977488996415, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
1.466827640622475, 0.7063207627883985, 0.22339889536375995, 0.059889916629433514, 0.004753167986462978, 0.004753167986462978, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
1.0067209795328587, 0.557071288013461, 0.15970644434515605, 0.04658104626733718, 0.009506335972925956, 0.0009506335972925955, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
direction = ["E", "E", "E", "E", "E", "E", "E", "E", "E", "E", "E", "E", "E", "E", "E", "E",
"ENE", "ENE", "ENE", "ENE", "ENE", "ENE", "ENE", "ENE", "ENE", "ENE", "ENE", "ENE", "ENE", "ENE", "ENE", "ENE",
"NE", "NE", "NE", "NE", "NE", "NE", "NE", "NE", "NE", "NE", "NE", "NE", "NE", "NE", "NE", "NE",
"NNE", "NNE", "NNE", "NNE", "NNE", "NNE", "NNE", "NNE", "NNE", "NNE", "NNE", "NNE", "NNE", "NNE", "NNE", "NNE",
"N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N",
"NNW", "NNW", "NNW", "NNW", "NNW", "NNW", "NNW", "NNW", "NNW", "NNW", "NNW", "NNW", "NNW", "NNW", "NNW", "NNW",
"NW", "NW", "NW", "NW", "NW", "NW", "NW", "NW", "NW", "NW", "NW", "NW", "NW", "NW", "NW", "NW"]
VitesseClasse = 0:2:30
Couleurs = range(colorant"skyblue", stop=colorant"red", length=length(VitesseClasse))
Vitesse = vcat([Couleurs for i = 1:7]...)
Couleurs = range(colorant"skyblue", stop=colorant"red", length=length(VitesseClasse))
categories = ["$(VitesseClasse[Index]) - $(VitesseClasse[Index+1])" for Index in eachindex(VitesseClasse[1:end-1])]
trace = barpolar(r=Frequence, theta=direction, mode="lines",
marker=attr(
size=Frequence,
sizeref=0.05,
color=Vitesse,
autocolorscale=false,
colorscale=Couleurs,
colorbar=attr(
tickmode="array",
tickvals=VitesseClasse[2:end] .- 1,
ticktext=categories)))
layout = Layout(
title = attr(
text = "Wind rose",
x = 0.5,
xanchor = "center"))
plot(trace,layout)
François