1

Is that possible to set cylindrical grid (polar grid + z in the 3rd dimension)? Or I have to draw it manually (how?)

1 Answer 1

2

Save the following set of instructions as plot3dgrid.gnu

#set term png
#set output 'sine.png'
set dummy u,v
set angles degrees
unset key
set parametric
set view 70, 150, 0.8, 1.2
set samples 32, 32
set isosamples 21, 21
set mapping cylindrical
set hidden3d back offset 0 trianglepattern 3 undefined 1 altdiagonal bentover
set yzeroaxis linetype 0 linewidth 1.000
set ticslevel 0
set title "3D cylindrical grid" 
set urange [ -180.000 : 180.000 ] noreverse nowriteback
set vrange [ -90.0000 : 90.0000 ] noreverse nowriteback
splot cos(u),sin(u),v with lines lc rgb "cyan" ,'sinedata.dat' with lines lc rgb "red" lw 1

Open gnuplot where you save the above .gnu file, write in gnuplot prompt,

gnuplot> load './plot3dgrid.gnu'

You will have figure like this,

enter image description here

Where I have a data file sinedata.dat contains several y values corresponds to x values separated by a space or tab. where y=60*sin(2*Π*x/50)

If you remove the # in first two lines and run it in gnuplot, you will have a png image of this.

3
  • nice work u've done,thanks. but i need a cylindrical coorinates grid- a polar grid + z as normal
    – WildBaker
    Jan 28, 2014 at 21:42
  • sorry I missed the "polar". I will try to help. An example or image of what exactly you are searching will be helpful.
    – sourav c.
    Jan 29, 2014 at 13:50
  • there can be "set grid polar", but only for 2d, so it doesn't work for splot command. I want sth like this in 3d, it's called "cylindrical grid". It can be only "polar grid" w/o grid for z coordinates, so the "x; y" plane (or rather fi, r) would look like grid for polar coordinates (sth like upload.wikimedia.org/wikipedia/commons/thumb/1/13/… )
    – WildBaker
    Jan 30, 2014 at 17:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .