Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.graphics.apps.gnuplot > #273

Re: Plotting line graphs in 3D

From Christoph Bersch <usenet@bersch.net>
Newsgroups comp.graphics.apps.gnuplot
Subject Re: Plotting line graphs in 3D
Date 2011-04-20 15:23 +0200
Organization GWDG, Goettingen
Message-ID <iommop$196k$1@gwdu112.gwdg.de> (permalink)
References <e52df71e-1581-43fa-a49f-dea420e447e1@v31g2000vbs.googlegroups.com> <iomibs$14h5$1@gwdu112.gwdg.de>

Show all headers | View raw


On 20.04.2011 14:08, Christoph Bersch wrote:
> On 20.04.2011 14:02, Durand wrote:
>>
>> I'm wondering whether it is possible to plot a line on a 3d plane. I
>> tried doing splot sin(x) but it made a surface rather than just a
>> line. I'm trying to plot an electromagnetic wave, essentially
>> something like this: http://en.wikipedia.org/wiki/File:Onde_electromagnetique.svg
>
> set parametric
> splot u, cos(u), 0, u, 0, cos(u)

Or, what comes closer to you request:

set ticslevel 0
set style arrow 1 head filled size screen 0.01,15,45 linestyle 1
set style arrow 2 head filled size screen 0.01,15,45 linestyle 2

splot '+' u 1:(0):(sin(0.2*pi*$1)) ls 1 lw 3 with lines t '', \
       '' u 1:(int($0)%3 == 0 ? 0 : 1/0):(0):(0):(0):(sin(0.2*pi*$1)) 
with vectors arrowstyle 1 t '',\
       '' u 1:(sin(0.2*pi*$1)):(0) ls 2 lw 3 with lines t '', \
       '' u 1:(int($0)%3 == 0 ? 0 : 1/0):(0):(0):(sin(0.2*pi*$1)):(0) 
with vectors arrowstyle 2 t ''

See topic "Special-filenames" for the meaning of '+'.
Normally, the number of vectors is set by the sampling points 'set 
samples'. In order to have a smooth curve, but not too much vectors, 
they are decimated using (int($0)%3 == 0 ? 0 : 1/0).

The splot command consists of four lines, you must correct the 
linebreaks of the e-mail client.

Christoph

Back to comp.graphics.apps.gnuplot | Previous | NextPrevious in thread | Find similar


Thread

Plotting line graphs in 3D Durand <durand1@gmail.com> - 2011-04-20 05:02 -0700
  Re: Plotting line graphs in 3D Christoph Bersch <usenet@bersch.net> - 2011-04-20 14:08 +0200
    Re: Plotting line graphs in 3D Christoph Bersch <usenet@bersch.net> - 2011-04-20 15:23 +0200

csiph-web