Sponsored Content
Full Discussion: Gnuplot 3d binning
Top Forums Shell Programming and Scripting Gnuplot 3d binning Post 302935223 by garethsays on Friday 13th of February 2015 01:50:11 PM
Old 02-13-2015
Gnuplot 3d binning

Hello

I have a text file with tens of thousands of rows
The format is
x y

where both x and y can be anything between -100 and +100.

What I would like to do is have a 3d gnuplot where there are 10,000 squared or bins and each bin will count how many rows have a value that would be assigned to that bin.



So if a row is -50, -50
and then next row is again -50, -50

then the value for that bin would be 2

anybody got any idea how to make script in bash to do this??

I need to count the number of rows with x value between -100 and -99 and y value between -100 and -99....
then count the number of rows with x value between -100 and -99 and y value between -99 and -98

etc

and then is should have a 3 column text file which I cna display in gnuplot.
 

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Help with gnuplot

Hi, I am a beginner using UNIX, and was wondering how to use gnuplot from UNIX on my pc. I am connected remotely to my work's UNIX server using Secure Shell Client, and gnuplot won't open a new window when I use the plot command. How do I do this? Moreover, is it possible to save things from the... (0 Replies)
Discussion started by: KTTFB64
0 Replies

2. Shell Programming and Scripting

Sampling and Binning- Engineering problem

Hi everyone! Can you please help me with some shell scripting? I have an input file input.txt It has 3 columns (Time, Event, Value) Time event Value 03:38:22 A 57 03:38:23 A 56 03:38:24 B 24 03:38:25 C 51 03:38:26 B 7 03:38:26 ... (7 Replies)
Discussion started by: Needhelp2
7 Replies

3. Shell Programming and Scripting

trimming and binning rows

I could not find this on the search.. I want to know how to trim a row so lets say I have a file that looks like this: bob 88888888888888 and I want to trim column 2 (lets say 4 off the front and end) bob 888888 Also, how would I bin column 2 Lets so I want to add and average... (1 Reply)
Discussion started by: phil_heath
1 Replies

4. UNIX and Linux Applications

GNUplot

Hi, I am trying to make a plot of an ASCII file using GNUplot, but I keep getting error msg: for example plot filename.txt It says that (.txt ) is not identified ... I tried to write it without the .txt part, but I also get the error msg. Any idea why? :confused: (1 Reply)
Discussion started by: cosmologist
1 Replies

5. Shell Programming and Scripting

Binning rows while skipping the first column

Hi I have a file that I want to bin. I am using this code: awk -F'\t' -v r=40 '{for(i=r;i<=NF;i+=r){for(j=0;j<r;j++){sum+=$(i-j)}printf "%s ", sum/r;sum=0}; printf "\n"}' file1 > file2 So basically what this code does is that it will averaging every 40 columns (creating bins of 40). But... (2 Replies)
Discussion started by: phil_heath
2 Replies

6. Emergency UNIX and Linux Support

GNUPLOT help needed

Dear All, I am new to GNUPLOT :D and dont know how it works, but actually there is a LINUX script generated by me which is running & capturing data in real time, the problem is that i want to plot that data in real time using GNUPLOT.:confused: please help.:wall: (5 Replies)
Discussion started by: jojo123
5 Replies

7. Shell Programming and Scripting

gnuplot horizontal

simple question I thought. How do I setup a chart in gnuplot that draws a "upper threshold" for a given set of data. I have the graph charting fine. I have peaks and valleys. I can either setup a number that I want to be the "upper threshold". a horizontal line based either in the data,... (5 Replies)
Discussion started by: kag3ythree
5 Replies

8. Shell Programming and Scripting

problem in binning the data

hi i have some data like this input: 1 apples oranges 234 2 oranges apples 2345 3 grapes bananas 1000000 4 melons banans 10000000 5 bananas apples 5000000 6 mangoes banans 2000000 7 apples bananas 1999999 i want to put all those which are coming between 1 and 999999 in to one bin... (8 Replies)
Discussion started by: anurupa777
8 Replies
YAGI(5) 							File Formats Manual							   YAGI(5)

NAME
yagi - yagi binary output format DESCRIPTION
This manual page describes the output format of the file created by the Yagi-Uda project's yagi program. The file is a binary file with a header of 100 bytes. The header consists of: offset(bytes) information data-type 0 elements int 4 driven int 8 parasitic int 12 min_frequency double 20 max_frequency double 28 design frequency double 36 step_frequency double 44 angular_step double 52 0 double 92 0 double Following the header, there starts the coordinates(x,y,l) of each element and the voltage applied to each element. Then we write the element currents one after the other, at each frequency. Hence the element currents will be written 12,000 times with a 3 element yagi analysed at 4,000 different frequencies. All complex data is stored in a structure of type fcomplex, defined as: struct fcomplex {double real, double imaginary}; offset(bytes) information data-type 100 x1 double /* coordinates */ 108 y1 double 116 l1 double 100+(n-1)*24 x_n double 100+(n-1)*24+8 y_n double 100+(n-1)*24+16 l_n double -------------- Repeated for each element. 100+24*elements Voltage1 fcomplex /* voltage */ 100+24*elements+(n-1)*16 Voltage_n fcomplex -------------- Repeated for each element n at each frequency step f. 100+40*elements Current1@f1 fcomplex /* current */ 100+40*elements+(n-1)*16 Current_n@f1 fcomplex 100+56*elements Current@f2 fcomplex 100+40*elements+(n-1)*16 Current_n@f2 fcomplex FILES
filename.out binary file SEE ALSO
yagi(1), output(1), input(1), optimise(1), first(1) and input(5). AUTHORS
Dr. David Kirkby G8WRB (david.kirkby@onetel.net), with help with converting to DOS from Dr. Joe Mack NA3T (mack@fcrfv2.ncifcrf.gov). Yagi version 1.16 24th October 2000 YAGI(5)
All times are GMT -4. The time now is 11:06 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy