lines in 3D

View: New views
5 Messages — Rating Filter:   Alert me  

lines in 3D

by WesM :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi

I have created a 3D surface plot of some data contained in a file. I would like to add
to the plot a rectangle in 3d. How can I add lines (or better yet a rectangle) to 3D
plots?

Re: lines in 3D

by Thomas Sefzick :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

you may add arrows without heads:

set xrange [0:pi]
set yrange [0:pi]
set samples 10
set arrow 1 from 0.5,0.5,0.5 to 2.5,0.5,0.5 nohead front
set arrow 2 from 2.5,0.5,0.5 to 2.5,2.5,0.5 nohead front
set arrow 3 from 2.5,2.5,0.5 to 0.5,2.5,0.5 nohead
set arrow 4 from 0.5,2.5,0.5 to 0.5,0.5,0.5 nohead
splot sin(x)*sin(y) with pm3d

WesM wrote:
Hi

I have created a 3D surface plot of some data contained in a file. I would like to add
to the plot a rectangle in 3d. How can I add lines (or better yet a rectangle) to 3D
plots?

Re: lines in 3D

by WesM :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thank you Thomas. That will work.


you may add arrows without heads:

set xrange [0:pi]
set yrange [0:pi]
set samples 10
set arrow 1 from 0.5,0.5,0.5 to 2.5,0.5,0.5 nohead front
set arrow 2 from 2.5,0.5,0.5 to 2.5,2.5,0.5 nohead front
set arrow 3 from 2.5,2.5,0.5 to 0.5,2.5,0.5 nohead
set arrow 4 from 0.5,2.5,0.5 to 0.5,0.5,0.5 nohead
splot sin(x)*sin(y) with pm3d

WesM wrote:
Hi

I have created a 3D surface plot of some data contained in a file. I would like to add
to the plot a rectangle in 3d. How can I add lines (or better yet a rectangle) to 3D
plots?


Re: lines in 3D

by WesM :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks again Thomas

Can the arrow command read its head and tail coordinates from a file? If so would you show me
how to do that.



you may add arrows without heads:

set xrange [0:pi]
set yrange [0:pi]
set samples 10
set arrow 1 from 0.5,0.5,0.5 to 2.5,0.5,0.5 nohead front
set arrow 2 from 2.5,0.5,0.5 to 2.5,2.5,0.5 nohead front
set arrow 3 from 2.5,2.5,0.5 to 0.5,2.5,0.5 nohead
set arrow 4 from 0.5,2.5,0.5 to 0.5,0.5,0.5 nohead
splot sin(x)*sin(y) with pm3d

WesM wrote:
Hi

I have created a 3D surface plot of some data contained in a file. I would like to add
to the plot a rectangle in 3d. How can I add lines (or better yet a rectangle) to 3D
plots?


Re: lines in 3D

by Thomas Sefzick :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

you may plot vectors:

set xrange [0:pi]
set yrange [0:pi]
set zrange [0:1]
set surface
set hidden3d

splot sin(x)*sin(y), '-' with vectors nohead
0.5 0.5 0.5 2.0 0.0 0.0
2.5 0.5 0.5 0.0 2.0 0.0
2.5 2.5 0.5 -2.0 0.0 0.0
0.5 2.5 0.5 0.0 -2.0 0.0
e


Thanks again Thomas

Can the arrow command read its head and tail coordinates from a file? If so would you show me
how to do that.


Thomas Sefzick wrote:
you may add arrows without heads:

set xrange [0:pi]
set yrange [0:pi]
set samples 10
set arrow 1 from 0.5,0.5,0.5 to 2.5,0.5,0.5 nohead front
set arrow 2 from 2.5,0.5,0.5 to 2.5,2.5,0.5 nohead front
set arrow 3 from 2.5,2.5,0.5 to 0.5,2.5,0.5 nohead
set arrow 4 from 0.5,2.5,0.5 to 0.5,0.5,0.5 nohead
splot sin(x)*sin(y) with pm3d

WesM wrote:
Hi

I have created a 3D surface plot of some data contained in a file. I would like to add
to the plot a rectangle in 3d. How can I add lines (or better yet a rectangle) to 3D
plots?