f



Using using

I want to plot column 2 against col. 1, but subtract
a constant from col. 2. I tried, in a test script,

plot 'test.dat' using 1:($2 + 1) w p pt 7

but gnuplot complains

Warning: empty y range [1:1], adjusting to [0.99:1.01]

although the data file contains

1 1
2 2
3 3
4 4
5 5

What am I doing wrong? I read this in the manual:

plot 'file' using 1:($2+$3) "%1f,%1f,%1f"

which led me to use the above. I assume the format stuff
is not needed.

If I am doing this wrong, how do I modify a given column
to be plotted arithmetically?

-- 
Dieter Britz
0
Dieter
8/22/2013 2:24:42 PM
comp.graphics.apps.gnuplot 5008 articles. 0 followers. Post Follow

6 Replies
2921 Views

Similar Articles

[PageSpeed] 51

Am 22.08.2013 16:24, schrieb Dieter Britz:
> I want to plot column 2 against col. 1, but subtract
> a constant from col. 2. I tried, in a test script,
> 
> plot 'test.dat' using 1:($2 + 1) w p pt 7
> 
> but gnuplot complains
> 
> Warning: empty y range [1:1], adjusting to [0.99:1.01]
> 
> although the data file contains
> 
> 1 1
> 2 2
> 3 3
> 4 4
> 5 5
> 

You´ve set an xrange that ends between one and two.

0
Karl
8/22/2013 3:46:37 PM
On Thu, 22 Aug 2013 17:46:37 +0200, Karl wrote:

> Am 22.08.2013 16:24, schrieb Dieter Britz:
>> I want to plot column 2 against col. 1, but subtract a constant from
>> col. 2. I tried, in a test script,
>> 
>> plot 'test.dat' using 1:($2 + 1) w p pt 7
>> 
>> but gnuplot complains
>> 
>> Warning: empty y range [1:1], adjusting to [0.99:1.01]
>> 
>> although the data file contains
>> 
>> 1 1 2 2 3 3 4 4 5 5
>> 
>> 
> You´ve set an xrange that ends between one and two.

No I didn't - I think. Here is the whole script:

gnuplot << eoi
set term postscript enh eps 24
set output 'test.eps'
plot 'test.dat' using 1:($2 + 1) w p pt 7
quit
eoi

What should I be writing if I want the number 1 added to
all the values in column 2? The data file is OK; if I
make that using 1:2 it plots alright.


-- 
Dieter Britz
0
Dieter
8/23/2013 8:50:50 AM
Am 23.08.2013 10:50, schrieb Dieter Britz:
>
> gnuplot<<  eoi
> set term postscript enh eps 24
> set output 'test.eps'
> plot 'test.dat' using 1:($2 + 1) w p pt 7
> quit
> eoi

If you call gnuplot from a shell you should use column(2).
0
Christoph
8/23/2013 9:40:37 AM
On Fri, 23 Aug 2013 11:40:37 +0200, Christoph Bersch wrote:

> Am 23.08.2013 10:50, schrieb Dieter Britz:
>>
>> gnuplot<<  eoi set term postscript enh eps 24 set output 'test.eps'
>> plot 'test.dat' using 1:($2 + 1) w p pt 7 quit eoi
> 
> If you call gnuplot from a shell you should use column(2).

?? I have been using this, e.g. "using 1:3" to override the
default 1:2, for years, and never a problem. Or do you mean
I must use that if I want to manipulate the values in a column?
If so, exactly how do I express that? The manual for 4.6 shows
it as I use it - and I get an error.

-- 
Dieter Britz
0
Dieter
8/23/2013 12:02:04 PM
On Fri, 23 Aug 2013 12:02:04 +0000, Dieter Britz wrote:

> On Fri, 23 Aug 2013 11:40:37 +0200, Christoph Bersch wrote:
> 
>> Am 23.08.2013 10:50, schrieb Dieter Britz:
>>>
>>> gnuplot<<  eoi set term postscript enh eps 24 set output 'test.eps'
>>> plot 'test.dat' using 1:($2 + 1) w p pt 7 quit eoi
>> 
>> If you call gnuplot from a shell you should use column(2).
> 
> ?? I have been using this, e.g. "using 1:3" to override the default 1:2,
> for years, and never a problem. Or do you mean I must use that if I want
> to manipulate the values in a column?
> If so, exactly how do I express that? The manual for 4.6 shows it as I
> use it - and I get an error.

PS: I worked it out, and it works - thanks!


-- 
Dieter Britz
0
Dieter
8/23/2013 12:44:55 PM
Am 23.08.2013 14:02, schrieb Dieter Britz:
> On Fri, 23 Aug 2013 11:40:37 +0200, Christoph Bersch wrote:
>
>> If you call gnuplot from a shell you should use column(2).
>
> ?? I have been using this, e.g. "using 1:3" to override the
> default 1:2, for years, and never a problem. Or do you mean
> I must use that if I want to manipulate the values in a column?

Ok, I wasn't very specific:

If you want to manipulate the values in a column, you can use either 
column(3) or its shorthand $3. However, if you invoke gnuplot from a 
shell using heredocs (<<eoi), like in your example, the $3 is 
interpreted as a shell variable. You could of course escape the dollar 
sign, but IMHO the best way is to use column(3) in that case which makes 
you independent of the environment.

Christoph
0
Christoph
8/23/2013 1:04:19 PM
Reply:

Similar Artilces:

when to use ; and when to use ,
Any statements like printf("abc"); scanf("%d",&x); a=20; can be replaced by printf("abc"), scanf("%d",&x), a=20; So when should we use ; and when sould we use , In article <1181971596.941107.318810@o11g2000prd.googlegroups.com>, Ravi <ra.ravi.rav@gmail.com> wrote: >Any statements like > printf("abc"); > scanf("%d",&x); > a=20; >can be replaced by > printf("abc"), scanf("%d",&x), a=20; > >So when should we use ; and when sould we use , Use ; when you want ...

when to use == and when to use is
I know this question has been answered: http://stackoverflow.com/questions/6570371/when-to-use-and-when-to-use-is , but I still have doubts. Consider the following code: class A: def __init__(self, a): self._a = a #def __eq__(self, other): # return self._a != other._a obj_0 = A(0) obj_1 = A(1) obj_2 = A(2) obj = obj_1 if obj == obj_0: print(0) elif obj == obj_1: print(1) elif obj == obj_2: print(2) if obj is obj_0: print(0) elif obj is obj_1: print(1) elif obj is obj_2: print(2) Both if statements wo...

Using where; Using index vs Using where
Hello, What are the difference between the following statements, which one is better? mysql> desc SELECT COUNT(*) as `cnt` FROM vote WHERE `ip` = INET_ATON('127.0.0.1') AND (`addtime` > NOW() - INTERVAL 1 DAY) ; +----+-------------+-------+-------+---------------+--------------- +---------+------+------+--------------------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+-------+-------+---------------+--------------- +---------+------+------+--------------------------+ | 1 | S...

Just When I Was Getting Used To Using Using
I have a class Packet that contains a nested class Payload and an enumeration: struct Packet { struct Payload { } ; } ; I had gotten into the habit of writing: using Packet::Payload; so I could write: Payload::..blah.. instead of Packet::Payload::..blah I have done this... (gulp) in many, many .cpp files. I tried out the new Visual C++ Express compiler from you-know-who on my source code and got 1000's of error messages: ...\Packet\Packet.cpp(13) : error C2885: 'Packet::Payload': not a valid using-declaration at non-class scope What does the standard say? Is th...

How to use backing store while using object graphics?
I don't know how to let IDL back store the display, note that I've written "device, retain=2" in the IDL_startup.pro file, and it works fine while using direct graphics. Here is an example, PRO test_gui COMPILE_OPT, IDL2 mywindow = OBJ_NEW('IDLgrWindow') ;;retain=2 myview = OBJ_NEW('IDLgrView', VIEWPLANE_RECT=[0, 0, 19, 19]) mymodel = OBJ_NEW('IDLgrModel') data = DIST(20) mycontour = OBJ_NEW('IDLgrContour', data, COLOR=[100, 150, 200], $ C_LINESTYLE=[0, 2, 4], /PLANAR, GEOMZ=0, C_VALUE=INDGEN(20)) myview->Add, mymodel m...

Use and usefulness of the as syntax
First, could you confirm the following syntax import foo as f equivalent to import foo f = foo Now, I was wondering about the usefulness in everyday programming of the as syntax within an import statement. Here are some instances retrieved from real code of such a syntax import numpy as np import math as _math import pickle as pickle -- In the first case, the syntax is motivated by brevity need, isn't it ? -- The second case seems to be rather widespread and causes math attribute to be private but I don't figure out why this matters. -- In the last case, I can see no poin...

How can i use console in C when doing graphics using SDL
I cannot view in the console what all i have included in printf() .Why this? Code: #include<stdio.h> #include<conio.h> #include "SDL/SDL.h" int main(void) { int x=1; SDL_Event event; SDL_Init(SDL_INIT_JOYSTICK ); SDL_Joystick *joy; // Check for joystick if(SDL_NumJoysticks()>0){ // Open joystick joy=SDL_JoystickOpen(0); if(joy) { printf("Opened Joystick 0\n"); printf("Name: %s\n", SDL_JoystickName(0)); } SDL_Quit(); SDL_JoystickClose(joy); return 0; } In article <1159283029.883083.230880@e3g2000cwe.googlegroups.co...

file in use, could not use
Hi. I have two databases that are both linked to the same backend table. I can't use them both at the same time, yet other users can have both functioning simultaneously on their machines. Opening them is not the problem. ..but the error message appears when I run any queries linked to the table. It works in one database, but not the other. All users are running XP sp2 with Access 2003. The error message is the same regardless if anyone is using the backend or not. I believe it is machine specific...MY machine. I haven't a clue. Any ideas? -- Message posted via http://www.accessmon...

Disk in use when not in use
After a hang and hardware reset, I could not boot into eCS 1.14, getting a display that I've never seen before: a VGA display with a white background and a box that said the program pointed to by SET RUNWORKPLACE= could not be loaded. C-A-D worked to shut this display down, but reboot produced the same outcome. This was corrected by rebooting and using an archived desktop. To make sure everything is OK I next booted into my maintenance partition and tried to run CDKDSK C: /F. It wouldn't run because the disk was "in use or locked by another process". Except the disk is not in use. I suppose this false condition was created by the strange and new crash, but for all I know it has existed for months, since I haven't run CHKDSK from the other partition in ages. I can't figure out how to correct this condition. I have downloaded DFSee but don't know how to use it. DFSee reports: Pid06= WARNING : More than ONE partition is marked active! but it's not obvious to me what to do about it. I did use DFSee to set the C: drive dirty and force a CHKDSK at boot, but that didn't correct the two disks active condition. Is there a DFSee expert who can give me some advice? -- John Varela (Trade "OLD" lamps for "NEW" for email.) I apologize for munging the address but the spam is too much. Sir: John Varela wrote: > After a hang and hardware reset, I could not boot into eCS 1...

To use locking or not to use it
Hello, I am builiding a multi-threaded application which has the following components : 1 writer thread - it gets information from the network and updates a table of numeric data, then informs the 2 reader threads that there is new information, so they should start running 2 reader threads that are awakened by the writer thread, use the writer thread's table to retrieve updated numerical data to do their calculations. Since the writer updates the table and the readers read from it, I want to use a reader/writer locking mechanism. However, I thought about the following...

When to use postgreSQL , when to use other
We are using Oracle and mySQL for web-applications I'm planing to use postgresql also. Maybe we will also use Cach`e . Does anyone using an other database-engines than postgresql also? What are your decision criterias to choose which db-engine for a certain project? e.g. less/more than x records in database , less/more than x select/DML-Staements per second reliablity, backup, replication... ---------------------------(end of broadcast)--------------------------- TIP 9: the planner will ignore your desire to choose an index scan if your joining column's ...

Used Cisco Used Switch Used Cisco Router Used Cisco Switch At LinkWaves Corp
Hello Guy. I just bought a cisco 7206VXR from http://www.linkwaves.com. Quick shipping fedex 3 days saver for $85. I think they are great Quick Ship Great Services Excelent Products For Quick Quote. Please visit here http://www.linkwaves.com/requestquote.asp For Quick Search. Please visit here http://www.linkwaves.com/productsearch.asp Their Contact is LinkWaves Corp 29980 Technology Drive, Suite 6 Murrieta, CA 92563 Tel: +1-909-725-9143 Fax: =1-707-221-3762 http://www.linkwaves.com sales(at)linkwaves.com ...

Why index used/not used
Hello. Explain. I have table "traf_raw" contains field "sip_id" (integer). This field indexed with "CREATE INDEX traf_raw_sip ON traf_raw (sip_id)". Question. When I try to get different rows postgres use index with one "sip_id" and not use index with another "sip_id". I don't understand why it is happen, but with more complex queries Seq Scan is so slowly. Example. With "sip_id='19'" there many rows in table, with "sip_id='29'" there is no rows. cnupm=> ANALYZE traf_raw; ANALYZE cnupm=> EXPLAIN ANALYZE SELECT * FROM traf_raw WHERE sip_id='19' LIMIT 10 OFFSET 100000; QUERY PLAN --------------------------------------------------------------------------------------------------------------------- Limit (cost=5230.95..5230.99 rows=1 width=56) (actual time=2505.89..2505.89 rows=0 loops=1) -> Seq Scan on traf_raw (cost=0.00..5230.99 rows=10808 width=56) (actual time=0.04..2490.02 rows=10977 loops=1) Filter: (sip_id = 19) Total runtime: 2505.95 msec (4 rows) cnupm=> EXPLAIN ANALYZE SELECT * FROM traf_raw WHERE sip_id='29' LIMIT 10 OFFSET 100000; QUERY PLAN --------------------------------------------------------------------------------------------------------------------------...

To use or not to use CLOS
I must admit that I'm completely a newbie in Lisp, as I've been writing C and (some) C++ for years. I don't like the way in wich C++ resolves object programming, although sometimes I'm forced to use object oriented programming in C, in the same way as GTK+ does. Now I emprend a (personal) project and would like to start it from the very beginning in Lisp (my first project in this language). My simple question, and I want to ear answers from all you experts, is: do you recomend me CLOS or perhaps consider that using simple structure and Lisp facilities would be more than enough?...

Defined but not used? But I am using it!
I can't figure this out. So in a templated class of mine I have the following. namespace menutree { static bool debug = false; } And in various parts of the code I have statements like. if (menutree::debug) { std::cout << "here" << std::endl; Everything compiles but I get the warning "warning: `bool menutree::debug' defined but not used" Can someone shed some light on this? Thanks! Travis wrote: > I can't figure this out. So in a templated class of mine I have the > following. > > namespace menutree > { > static boo...

ActGen to use or not to use?
Hello, I was doing a project with Actel FPGA ex128 with Libero Platinum Eval version software. in my project I had to use some counters,Multiplexers etc. which I wrote myself. Now as I was a beginner I didnt use the ActGen. Is it worth the effort to write the code partly by using ActGen macros for counter and muxes and etc. Thanks Naimesh Naimesh wrote: > I was doing a project with Actel FPGA ex128 with Libero Platinum Eval > version software. > > in my project I had to use some counters,Multiplexers etc. which I > wrote myself. Good work. Writing your own code makes y...

If you used to use Windows or now used Windows less because of FreeBSD why?
For a Graduation Project, I am comparing Open-Source software to Propetarity Software. So if you used to use Windows or now use Windows less, why do you use FreeBSD more now? Yes, I know I asked a question like this before, but forgot to ask this one. ;). I continue to use windows on the desktop because of certain apps and games that only run on windows. Making the switch to another platorm is not a priority. I am quite good with windows security and other platforms offer no functionality that windows lacks, in my instance. I recently began utilizing freebsd for some of my services, along with my windows server. I use mysql and postfix on freebsd. I have lately been experimenting with linux, but the lack of sata support is inhibiting progress. I am patiently awaiting the next release of debian, my favorite distro so far. As a libertarian, I am quite fond of open-source ideals. A few points on linux and freebsd: The freebsd packages collection, I feel, is lacking. I really think some improvements need to be addressed to accomodate users that prefer binary implementation. For example, smb client support is broken in the binary implementations of xfce4 and gnome2. Freebsd-update is a huge leap forward, as far as updates are concerned. The freebsd installer is far superior to any other I have ever used. I can install freebsd and apply binary security updates in less than ten minutes on a p2-300. Debian installation is a c...

HPT, name all the operating systems and apps you use on your job, and the % of time you use them
Or slink away like a cola hypocrite always does. DFS wrote: > Or slink away like a cola hypocrite always does. What is this? An OT SPAM fest? -- KDE 4.3.1 user On Wed, 16 Sep 2009 15:24:39 +0100, Tony Manco wrote: > DFS wrote: > >> Or slink away like a cola hypocrite always does. > > > What is this? An OT SPAM fest? Not yet... Schestowitz usually arrives in the early evening. Tony Manco wrote: > DFS wrote: > >> Or slink away like a cola hypocrite always does. > > > What is this? An OT SPAM fest? No. It's the trolls not gett...

7, name all the operating systems and apps you use on your job, and the % of time you use them
Or slink away like a cola hypocrite always does. On Wed, 16 Sep 2009 09:58:29 -0400, DFS wrote: > Or slink away like a cola hypocrite always does. Unless you do the same - WHY? Micoshaft Appil asstroturfing fraudster pounding the sock DFS wrote on behalf of Half Wits from Micoshaft Appil Department of Marketing: > Or slink away like a cola hypocrite always does. Its Cobol you utter small weenie corporation worshipper. Google (a Linux company) share trading bigger than Micoshaft Corporation ------------------------------------------------------------------------ Average $1...

Don't use c#: Use PHP for Desktop Apps (!)
http://www.devx.com/opensource/Article/21235 Now, PHP has begun to carve a space for itself in the standalone application arena as well with PHP-GTK. As its name indicates, PHP-GTK combines PHP with the GIMP Tool Kit (GTK), an object-oriented framework for developing graphical user interfaces (GUIs). GIMP (GNU Image Manipulation Program), which was developed using X11 on Linux platforms, basically enables the same PHP-GTK code to run on Linux, MS Windows, BeOS, and Mac 0SX without any changes. So while PHP requires a server-often Apache-to run, you can use PHP-GTK to create standalone GUIs t...

Spamowitz, name all the operating systems and apps you use on your job, and the % of time you use them
Or slink away like a cola hypocrite always does. "DFS" <nospam@dfs_.com> wrote in message news:h8qqse$skj$1@aioe.org... > Or slink away like a cola hypocrite always does. > > I think that the conventional wisdom here says that he does not have a job and is therefore sponging off his parents and using Mr. Kent's ISP, although that may be out of date. On Wed, 16 Sep 2009 10:04:49 -0400, amicus_curious wrote: > "DFS" <nospam@dfs_.com> wrote in message news:h8qqse$skj$1@aioe.org... >> Or slink away like a cola hypocrite always does. &...

Using Netbean IDE for writing/compiling/debugging apps without using Project
Hi Is there a way to configure Netbean IDE such that it does not insist on creating a Project everying time I want to use it to write/compile/debug small Java apps I am writing to learn Java. I find that default Netbean IDE behaviour to insist on a Project before I can create a Java file for sample learning applications makes it very complicated for me as a Java beginner. Thanks Bob I tried to do it, but failed. As far as i know, it can't be done without creating project. Regards <bagarow@yahoo.com> wrote in message news:1147285977.728460.285540@q12g2000cwa.googlegroups.com...

Using a DLL that uses a second library which use Java Runtime Environment
Hello, I am having problems when I try to import a DLL in Matlab that I created myself with the Visual C++ 2010 express. My library uses a second library that I don't want Matlab to worry about (since it uses complex data structures and don't know how it has been created). My library exports the function prototypes with C support (I use -> extern "C" __declspec(dllexport)). I made a simple console application in C++ that uses my library and it works correctly. Matlab loads my library without any problem. The problem comes when I call a function that defines a variable sp...

Used Cisco Used Cisco Router Used Cisco Switch At LinkWaves Corp
Hello Guys, Please let me know if you need Cisco. Will take offers WS-X6704-10GE $8390 (CFC) WS-X6724-SFP $7300 ( CFC) PA-MC-8TE1+ $5295 PA-MC-STM-1SMI $12900 4GE-SFP-LC $21995 WS-F6700-DFC3BXL $7400 SA-VAM, $1199/each WS-C3750G-24PS-S, $3599/each 6E3-SMB, $5500/each 8FE-FX-SC-B, $899/each PA-A3-E3, $799/each PA-MC-8T1 $1500/each OSM-8OC3-POS-MM $3500/each OSM-2OC12-POS-MM $3499/each OSM-2OC12-POS-SI $5599/each WS-X6502-10GE $1995/each PA-A3-8E1-IMA $1550/each PA-A3-8T1-IMA $1440/each PA-MCX-8TE1-M $6200/each PA-MC-8TE1+ $5500/each PA-MC-STM-1SMI $12900/each NM-8T1-IMA $750/each NM-1GE $2200/...

Web resources about - Using using - comp.graphics.apps.gnuplot

Donald Trump on course to win Super Tuesday as Marco Rubio and Ted Cruz battle for second
The billionaire real estate tycoon has been declared the winner in five states – Alabama, Georgia, Massachusetts, Tennessee and Virginia.

The latest way that Windows 10 is keeping users safe from hackers
Although Microsoft's total lack of transparency regarding Windows 10 is alarming, there's no question that the company is doing everything it ...

NBC’s Seeso service launches on Roku and Fire TV
Back in October, NBC announced a subscription video service called ‘Seeso’ that focuses on comedy shows and charges $3.99 per month. The service ...

High School Musical 4? Disney Announces Large Casting Call
Today in a press release, Disney announced that a large casting call was underway for new for a planned Disney Channel Original Movie with an ...

Scott Kelly heading home after record space flight
CBS News Scott Kelly heading home after record space flight CBS News Last Updated Mar 1, 2016 9:01 PM EST. Astronaut Scott Kelly and cosmonaut ...

How Osama Bin Laden micromanaged Al Qaeda from hiding in the last year's of his life
Al Qaeda's leaders were increasingly worried about spies in their midst, drones in the air and secret tracking devices, documents seized in the ...

After Council Vote, Still No Clear Answer on Whether the City Will Save Pronto
by Heidi Groover The future of Pronto: Ask again later. Ansel Herz After a lengthy city council discussion, we still have no answer on the question ...

Facebook caught in privacy debate after arrest of executive in Brazil
The arrest comes after Brazilian police wanted WhatsApp data linked to a drug trafficking case another example of the tech industry's tussle ...

Tabletop board games, meet virtual reality
Lost Cities is an award-winning card game, and now, one developer wants to make it possible to play with opponents all over the globe by harnessing ...

Rumored ‘Star Wars 8’ Title Released
We’re still over 22 months away from the release of Star Wars 8 . But with the production now underway, we can expect little titbits regarding ...

Resources last updated: 3/2/2016 3:35:36 AM