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
XkbFreeGeomRows(3)						   XKB FUNCTIONS						XkbFreeGeomRows(3)

NAME
XkbFreeGeomRows - Free rows in a section SYNOPSIS
void XkbFreeGeomRows ( section, first, count, free_all ) XkbSectionPtr section; int first; int count; Bool free_all; ARGUMENTS
- section section in which rows should be freed - first first row to be freed - count number of rows to be freed - free_all True => all rows are freed DESCRIPTION
Xkb provides a number of functions to allocate and free subcomponents of a keyboard geometry. Use these functions to create or modify key- board geometries. Note that these functions merely allocate space for the new element(s), and it is up to you to fill in the values explicitly in your code. These allocation functions increase sz_* but never touch num_* (unless there is an allocation failure, in which case they reset both sz_* and num_* to zero). These functions return Success if they succeed, BadAlloc if they are not able to allocate space, or BadValue if a parameter is not as expected. If free_all is True, all rows are freed regardless of the value of first and count. Otherwise, the number of rows specified by count are freed, beginning with the row specified by first in the specified section. RETURN VALUES
Success The XkbFreeGeomRows function returns Success when there are no allocation or argument errors. DIAGNOSTICS
BadAlloc Unable to allocate storage BadValue An argument is out of range X Version 11 libX11 1.2.1 XkbFreeGeomRows(3)
All times are GMT -4. The time now is 09:30 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy