質問

I have points data in cylindrical coordinates. Can I make them arc like here. Now lines look like those

役に立ちましたか?

解決

To do this with a data file, you can use set dgrid3d and the set table output. The data that you have looks like this:

set pm3d
splot "data" u ($1*cos($2)):($1*sin($2)):3 w l

enter image description here

You can make an interpolation with set dgrid3d to improve the resolution:

set dgrid3d splines 20,20
set table "table"
splot "data" u 1:(acos(cos($2))):3

Now your refined grid data is saved in file "table". Note I sent the angle variable back to the 0 to pi interval to improve the interpolation. It's important to use the splines option, otherwise your data will be interpolated using all the data points, rather than only the neighboring ones. Plot this new data:

set pm3d
splot "table" u ($1*cos($2)):($1*sin($2)):3 w l

enter image description here

More data means the straight lines look less straight because there are more of them. You don't need to use the interpolate option with set pm3d, just adjust the number of scans of the set dgrid3d option.

他のヒント

I guess you can play with the number of samples used to give the impression that arcs are being drawn. For instance:

set parametric
set samples 10,10
set zrange [0:1]
set urange [0:2*pi]
set vrange [0:2*pi]
splot cos(u)*cos(v),cos(u)*sin(v),cos(u)

Gives the following graph: enter image description here

Now if you change the samples using

set samples 10,100

You get "arcs", which are simply more straight lines:

enter image description here

If you want more surface lines, then play a bit with the set isosamples option:

set isosamples 20,20

enter image description here

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top