|
From: Peter D. <pc...@wi...> - 2007-12-06 01:46:00
|
Has anyone plotted vector fields with the pseudo-file '+'? It would be
nice to avoid intermediate files.
It seems like '+'s one-variable limitation in plot would make that
impossible, though.
Intuitively, I want to do something like:
plot '+' using ($1):($2):($2**2 - 2*$1*$2):(3*$1*$2 - 6*$1**2) \
with vectors
to express the vector equation:
F(x, y) = <y^2 - 2xy, 3xy - 6x^2>
|
|
From: Thomas S. <t.s...@fz...> - 2007-12-06 10:36:58
|
you need 'x' and 'y' values generated automatically, so you need 'splot': # adjust vector length l = 0.005 set xrange [-3:3] set yrange [-3:3] # number of x-values set samples 20 # number of y-values set isosamples 20 # view from top set view 0,0 # and don't care about the 'empty z range' warning splot '+' using 1:2:(0.0):(l*($2**2 - 2.*$1*$2)):(l*(3.*$1*$2 - 6.*$1**2)):(0.0) with vectors works, but 'plot' would be better, so first 'splot' into a table and then use the resulting datafile as input: set table 'data' splot '+' ... (like above) unset table plot 'data' using 1:2:4:5 with vectors Peter Danenberg wrote: > > Has anyone plotted vector fields with the pseudo-file '+'? It would be > nice to avoid intermediate files. > > It seems like '+'s one-variable limitation in plot would make that > impossible, though. > > Intuitively, I want to do something like: > > plot '+' using ($1):($2):($2**2 - 2*$1*$2):(3*$1*$2 - 6*$1**2) \ > with vectors > > to express the vector equation: > > F(x, y) = <y^2 - 2xy, 3xy - 6x^2> > > ------------------------------------------------------------------------- > SF.Net email is sponsored by: The Future of Linux Business White Paper > from Novell. From the desktop to the data center, Linux is going > mainstream. Let it simplify your IT future. > http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 > _______________________________________________ > Gnuplot-info mailing list > Gnu...@li... > https://lists.sourceforge.net/lists/listinfo/gnuplot-info > > -- View this message in context: http://www.nabble.com/Vector-fields-with-pseudo-file-%27%2B%27-tf4953569.html#a14189855 Sent from the Gnuplot - User mailing list archive at Nabble.com. |
|
From: Peter D. <pc...@wi...> - 2007-12-07 07:44:02
Attachments:
pseudofile-xy.patch
|
On Thu, Dec 06, 2007 at 02:37:01AM -0800, Thomas Sefzick wrote:
> you need 'x' and 'y' values generated automatically, so you need
> 'splot':
That's a beautiful hack, Thomas; I see your hack, and raise you the
attached patch which generates two columns of data regardless of
plot/splot.
The following simply works with patched gnuplot:
set isosamples 60,60
plot [-6:6][-6:6] '+' using 1:2:(l*$2):(l*sin($1)) with vectors
Before I submit the patch to the developers, though, I'd like to
straighten out the following things:
* detect whether df_current_plot->plot_style == VECTOR, and add an
extra column to (s)plot (df_current_plot isn't set by the time I
get it);
* generate three dimensions of data for splot (extrapolating the
current code to three dimensions produces a plane).
|
|
From: Peter D. <pc...@wi...> - 2007-12-07 12:34:05
|
On Thu, Dec 06, 2007 at 02:37:01AM -0800, Thomas Sefzick wrote:
> works, but 'plot' would be better, so first 'splot' into a table and
> then use the resulting datafile as input:
There's another variaton, Thomas, that uses `set view map'; for
instance, to plot the contour map and gradient vector field of:
f(x, y) = sin(x) + sin(y)
try:
f(x, y) = sin(x) + sin(y)
set multiplot
set contour
set cntrparam level 10
set view map
set xrange [-6:6]
set yrange [-6:6]
unset surface
unset key
set isosamples 100,100
set samples 100,100
splot f(x, y)
unset contour
set isosamples 30,30
set samples 30,30
set surface
set key
l = 0.5
splot '+' using 1:2:(0.0):(l*cos($1)):(l*cos($2)):(0.0) with \
vectors title "f(x,y) = sin(x) + sin(y)"
See it here:
http://wikisophia.org/wiki/User:Danenberg#Vector_field
|
|
From: Tatsuro M. <tma...@ya...> - 2007-12-07 07:10:10
|
Hello 2007-12-14 Shigeharu Takeno <sh...@ie...> * src/plot3d.c (eval3d_plots get3d_data): Implement taking key entry titles from datafile column headers. 'splot <foo> using 1:2:3 title 3' The date 2007-12-14 is the near future. Is this the date of 2007-12-04? Tatsuro MATSUOKA -------------------------------------- New Design Yahoo! JAPAN 2008/01/01 http://pr.mail.yahoo.co.jp/newdesign/ |