1

I am trying to visualize a block of two different color particles and I want to add transparency to the points. I write a file (cubo.d) with this data (example):

1   1   1   ar
1   1   2   ar
1   2   1   ar
1   2   2   ar
2   1   1   ab
2   1   2   ab
2   2   1   ab
2   2   2   ab

And then I read it with this code in gnuplot:

set border 0
unset tics
unset key
set view equal xyz
set style fill transparent solid 0.2 noborder
spin(name) = name[1:2] eq "ar" ? 0xcdca00 : name [1:2] eq "ab" ? 0x000000 : 0x888888
splot 'cubo.d' using 1:2:3:(spin(strcol(4))) w p pt 5 ps 2

But the points doesn't have transparency. I tried adding fs solid 0.2 and also lc rgb 0x888888 after w p pt 5 ps 2 but those doesn't work either. The four yellow particles are hidding part of the black particles behind

The four yellow particles are hidding part of the black particles behind

barreraabc
  • 35
  • 4
  • Does this answer your question? [Gnuplot: transparency of data points when using palette](https://stackoverflow.com/questions/60250928/gnuplot-transparency-of-data-points-when-using-palette) – theozh May 01 '22 at 05:41
  • I saw that question but I couldn't get the answer from there. Thank you anyway, if I knew a little more about gnuplot probably I could have got it. – barreraabc May 01 '22 at 07:09

1 Answers1

1

The scheme for transparent colors is

lc rgb 0xaarrggbb

Check help colorspec.

theozh
  • 22,244
  • 5
  • 28
  • 72
  • Thanks, I changed the code like this, on the fifth line: "spin(name) = name[1:2] eq "ar" ? 0x88cdca00 : name [1:2] eq "ab" ? 0x88000000 : 0x888888" And it works. – barreraabc May 01 '22 at 06:57