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


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

Using arrays

Path csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From John Edwards <johned0@gmail.com>
Newsgroups comp.graphics.apps.gnuplot
Subject Using arrays
Date Sat, 3 Jun 2017 23:59:35 +0100
Lines 29
Message-ID <epgtapF1peqU1@mid.individual.net> (permalink)
Reply-To johned0@gmail.com
Mime-Version 1.0
Content-Type text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding 7bit
X-Trace individual.net Czf5C/zkrYrmJujNQo/C6grlMlz+MFHhrxvdnaf7w52iNxqsZ5
Cancel-Lock sha1:dOMEA8lQ9mp1XO6OXy8rohxx8+Y=
X-Mozilla-News-Host news://news.individual.net:119
User-Agent Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1
Content-Language en-GB
Xref csiph.com comp.graphics.apps.gnuplot:3665

Show key headers only | View raw


This may be a bit early, since the array functionality was only released 
so recently, but I've been trying to use arrays to replicate the 
functionality of plotting a multi-column file.

For example, if I have the following data.dat :

-90., -1.30e+01
-60., -3.78e+01
-30., -1.66e+01
0., -5.61e-03
30., -1.66e+01
60., -3.78e+01
90.,  -1.30e+01

And do plot "data.dat" then I get a graph we're all familiar with.

What I've come up with, to replicate using arrays, is :

array plt[7] = [ {-90., -1.30e+01}, {-60., -3.78e+01}, {-30., 
-1.66e+01}, {0., -5.61e-03}, {30., -1.66e+01}, {60., -3.78e+01}, {90., 
-1.30e+01} ]
plot plt u 1:2

But it doesn't give me what I expected.

I would welcome any thoughts.

Thanks very much,
John

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


Thread

Using arrays John Edwards <johned0@gmail.com> - 2017-06-03 23:59 +0100
  Re: Using arrays Ethan A Merritt <EAMerritt@gmail.com> - 2017-06-03 23:22 -0700
    Re: Using arrays John Edwards <johned0@gmail.com> - 2017-06-04 09:30 +0100
    Re: Using arrays Ethan A Merritt <sfeam@users.sourceforge.net> - 2017-06-05 09:41 -0700

csiph-web