0
votes

I am trying to draw a figure using some perspective in GNUPLOT. I have already used set xyplane at 0 to add the perspective effect. The problem now is that the tics appear in front of my sphere. For a 3D effect, I want the sphere to obstruct some of the tics, leaving them in the background (the ones on the y and x axis). I tried using set tics back but it doesn't work.

Here is the code:

# set term x11 0
set xlabel 'X'
set ylabel 'Y'
set zlabel 'Z'
set title 'Ray on Sphere 2'
set parametric
set isosamples 50,50
set hidden
set view 120, 200
set view equal
R = 3e-6
set urange [-pi/2:pi/2]
set vrange [0:2*pi]
set xyplane at 0
set xtics back
splot R*cos(u)*cos(v),R*cos(u)*sin(v)-1.5e-6,R*sin(u) w l lc rgb 'yellow' title 'Silica Particle',\
      '-' w p title 'Incidence Point'

and the result:

enter image description here

2

2 Answers

2
votes

I think your best bet is to move the tic labels to the other side of the plot.

# All as before
set xlabel 'X'
set ylabel 'Y'
set zlabel 'Z'
set title 'Ray on Sphere 2'
set parametric
set isosamples 50,50
set hidden
set view 120, 200
set view equal
R = 3e-6
set urange [-pi/2:pi/2]
set vrange [0:2*pi]
set xyplane at 0

# Now a change in the tic label placement
set xtics  offset graph   0, 1.2
set ytics  offset graph  -1.2, 0
set xlabel offset graph   0, 1.5
set ylabel offset graph  -1.5, 0

splot R*cos(u)*cos(v),R*cos(u)*sin(v)-1.5e-6,R*sin(u) w l lc rgb 'yellow' title 'Silica Particle'

enter image description here

I'm sure you can make it nicer by tweaking the placement, the font size, etc

0
votes

Your view setting is a bit strange for me.

With set view 60,160 it looks like this

enter image description here

One can play with the view interactively and read the setting from the bottom bar.