问题
How do I plot a white spherical surface? In three dimensions, radius should be 1, center at the origin.
I have scattered point data on the sphere. It is hard to look at it, since the points from the opposite end of the sphere are just as visible. Therefore I would like to create a white spherical "background" on top of which the data is clearly visible.
Restricting the range of one coordinate axis to [0:1] is cumbersome since it cuts off half the points at which I also want to look.
Tanks!
回答1:
Here is an example, borrowed from the gnuplot demo page. For a white sphere, replace yellow
with white
:
set parametric
set isosamples 50,50
set hidden
R = 1. # radius of sphere
set urange [-pi/2:pi/2]
set vrange [0:2*pi]
splot R*cos(u)*cos(v),R*cos(u)*sin(v),R*sin(u) w l lc rgb "yellow", \
"-" w p
1 0 0
-1 0 0
e
You can see that only one of the two data points is visible, while the other is hidden behind the sphere.
来源:https://stackoverflow.com/questions/47572292/how-to-plot-the-surface-of-a-sphere-in-gnuplot