SankeyPlots.jl icon indicating copy to clipboard operation
SankeyPlots.jl copied to clipboard

Bug gradient coloring?

Open davide-f opened this issue 4 years ago • 2 comments

Dear Developer, The new update including the compact formulation has improved the quality of the results, however when using the color mode gradient, I experience an unexpected coloring. I attach an example of the image. image Thank you, Davide

davide-f avatar Mar 05 '21 13:03 davide-f

Could you provide the code for this example, so I can reproduce and figure out the issue?

daschw avatar Mar 06 '21 09:03 daschw

Sorry for the delay, below you can find the example.

data = [1.0  12.0  0.970741
  2.0  11.0  0.099867
  2.0  10.0  0.0874267
 10.0  12.0  0.0233846
  2.0  12.0  0.542539
  1.0  13.0  0.388331
  3.0  11.0  0.0804934
  3.0  10.0  0.110872
 10.0  13.0  0.00206157
  3.0  13.0  0.221796
  1.0  14.0  0.468872
  4.0  11.0  0.185785
  4.0  10.0  0.278111
 10.0  14.0  0.00151853
  4.0  14.0  0.763057
  1.0  15.0  0.353096
  5.0  11.0  0.000423724
  5.0  10.0  0.000141012
 10.0  15.0  0.242061
  5.0  15.0  0.208177
  1.0  16.0  0.970009
  6.0  11.0  0.0001099
  6.0  10.0  3.7705e-5
 10.0  16.0  0.222575
  6.0  16.0  0.208594
  1.0  17.0  0.584011
  7.0  11.0  0.139244
  7.0  10.0  0.189689
 10.0  17.0  0.000833531
  7.0  17.0  0.286463
  1.0  18.0  0.601005
 10.0  18.0  0.278003
  1.0  19.0  0.311745
  8.0  11.0  0.146233
  8.0  10.0  0.252754
 10.0  19.0  0.000103437
  8.0  19.0  0.553732
  1.0  20.0  0.44891
  9.0  11.0  0.127771
  9.0  10.0  0.182001
 10.0  20.0  0.00132186
  9.0  20.0  0.498821
  1.0  21.0  0.519072
 10.0  21.0  0.32917]

tot_colors = vcat(palette(:rainbow)[2], palette(:default)[1:10], palette(:rainbow)[5], palette(:rainbow)[2], palette(:default)[1:10])
sankey(convert(Vector{Int}, data[:, 1]), convert(Vector{Int}, data[:, 2]), data[:, 3];
	node_colors = tot_colors,
        edge_color=:gradient,
        compact=true)

davide-f avatar Mar 11 '21 23:03 davide-f