Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Parametric plot with a data file instead of functions.

1,535 views
Skip to first unread message

Jean-Pierre Coulon

unread,
Jun 11, 2009, 6:00:23 AM6/11/09
to
I understand that: set param; plot sin(t), cos(t) draws a circle, but assume
my sin and cos functions come from a 3-column data file. Can I make a
parametric plot from this data file?

Regards,

Jean-Pierre Coulon (here "cacas.pam" is what others call "nospam")

Zoltan

unread,
Jun 11, 2009, 7:00:59 AM6/11/09
to
On 11 Jun., 12:00, Jean-Pierre Coulon <cou...@cacas.pam.obs-nice.fr>
wrote:

Hi,

I am not quite sure what you mean by "sin and cos functions come from


a 3-column data file".

If you want to plot the cos of column 2 versus the sin of column one,
then

plot 'dat.dat' using (sin($1)):(cos($2)) with lines

should work. (You just have got to make sure that you set angle
properly.)
If this is not what you need, then I am lost. Could you, please,
clarify the question?
Best,
Zoltán

Hans-Bernhard Bröker

unread,
Jun 11, 2009, 9:50:56 AM6/11/09
to
Jean-Pierre Coulon wrote:
> I understand that: set param; plot sin(t), cos(t) draws a circle, but
> assume my sin and cos functions come from a 3-column data file. Can I
> make a parametric plot from this data file?

The distinction between parametric and non-parametric doesn't exist for
data plots. So just plot your x and y data and that'll be it.

Jean-Pierre Coulon

unread,
Jun 12, 2009, 2:16:58 AM6/12/09
to
On Thu, 11 Jun 2009, Zoltan wrote:

> I am not quite sure what you mean by "sin and cos functions come from
> a 3-column data file".

Here is the datafile sincos.abs:
#angle cos 2+sin
0. 1. 2.
30 .866 2.5
60 .5 2.866
90 0. 3.
120 -.5 2.866
150 -.866 2.5
180 -1. 2.
210 -.866 1.5
240 -.5 1.133
270 0. 1.
300 .5 1.133
330 .866 1.5
360 1. 2 (not a very nice circle!)

> If you want to plot the cos of column 2 versus the sin of column one, then
> plot 'dat.dat' using (sin($1)):(cos($2)) with lines should work. (You just
> have got to make sure that you set angle properly.) If this is not what you
> need, then I am lost. Could you, please, clarify the question? Best, Zoltán

I found a workaround with splot, by putting the dummy variable into z,
and with a view angle where I don't see the Z axis:

set zrange [0:360]
set angle degrees
unset ztics
set view 0, 0
set xlabel "X"
set ylabel "Y"
splot 'sincos.abs' using 2:3:1 with lines

0 new messages