0
votes

I have data that depicts a 3D distribution of points caracterizing a star. So in short words, I have a random 3D distribution of points inside a sphere. I want to do a 3D plot of all the points except all of them that are within the x>=0,y>=0,z>=0 sector. That is I want to cut out 1/8 of the sphere. My attempt:

spl 'data' u ($2>=0.?($3>=0.?($4>=0.?1/0:$2):$2):$2):3:4:7 w d lc palette z

does nothing. I mean, it seems to plot everything. Columns are $2=x, $3=y, $4=z and $7 a magnitude to give the color to the points.

Any idea of what I'm doing wrong?

Thanks!

1
Your filter looks Ok to me. maybe try lc palette cb instead of lc palette z?mgilson

1 Answers

1
votes

Your conditional syntax at least seems correct. With the following data file:

1 1 1 1
1 -1 1 2
1 1 -1 3
1 -1 -1 4

-1 1 1 5
-1 -1 1 6
-1 1 -1 7
-1 -1 -1 8

The command

spl 'data.dat' u ($1>=0.?($2>=0.?($3>=0.?1/0:$1):$1):$1):2:3:4 w points pt 7 ps 3 palette z

produces this output: enter image description here

The point at (1,1,1) is absent, as it should be. This is using gnuplot 4.6.0. When I tried the command w d lc palette z I couldn't see anything, perhaps the with dots option behaves differently?