I am having a bit of trouble plotting a histogram in gnuplot. I am trying to use it to draw bars side by side. The first bar is from column five in my data file. The second bar is actually three bars stacked on top of each other and should be as tall as the first bar. The data is from the 2nd, 3rd, and 4th column of the same data file.
When I plot this, all I can see is the three stacked bars. I used xtics to offset the graph, and I could see the column 5 bar graph was behind it. So, it seems that they are sitting on top of each other. Does anyone know how to fix it so they will be side by side? Thanks!
Moderator's Comments:
Please use [CODE] tags when posting listings and the like
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)
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)
Hi All,
Seems I have an xargs stdin problem that I don't understand.
I have a script (call it myscript.sh) that takes the names of one or more file(s) specified on the command line and creates a single gnuplot command file containing multiple records, one for each specified file. Each of... (9 Replies)
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)
Hi,
Im trying to plot a time series with gnuplot. this is my script
set xdata time
set yrange
set timefmt "%H"
set xrange
set format x "%H:%M:%S"
plot "time_vs_times.txt" using 1:2 title 'Interarrival time' with points lw 2
and this is my data
11:14:18 5
11:14:19 10... (10 Replies)
Hi!
Let's say I have these two columns in file.txt
0 1
1 5
2 10
3 15
4 20
5 25
in gnuplot, i would plot usingplot 'file.txt' u 1:2
If I wanted to add a label to the y-axis I would useset label "Ef" at 0.0,7.0
However, I want the label Ef to be on the otherside of the y-axis. Not... (0 Replies)
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... (1 Reply)
Need assistance in getting a script right. It requires little tweaking and I am not getting it right .
Using below data and the below script it creates a table with png file but regarding the time it create 6,7,8 and i want each time 6:15 ,6:30 and so on
So that i can view the exact graph... (3 Replies)
Discussion started by: ajayram_arya
3 Replies
LEARN ABOUT DEBIAN
pshistogram
PSHISTOGRAM(l) PSHISTOGRAM(l)
NAME
pshistogram - Bin data and plot histograms
SYNOPSIS
pshistogram file -Jxxscale[/yscale] -Wbin_width [ -2 ] [ -A ] [ -Btickinfo ] [ -C ] [ -Eazimuth/elevation ] [ -Gfill ] [ -H[nrec] ] [ -I[o]
] [ -K ] [ -Lpen ] [ -O ] [ -P ] [ -Q ] [ -Rwest/east/south/north[r] ] [ -S ] [ -U[/dx/dy/][label] ] [ -V ] [ -Xx-shift ] [ -Yy-shift ] [
-Ztype ] [ -ccopies ] [ -bi[s][n] ]
DESCRIPTION
pshistogram reads the first column from file [or standard input] and calculates histogram parameters based on the bin-width provided. Using
these parameters, scaling, and optional range parameters it will generate PostScript code that plots a histogram. A cumulative histogram
may also be specified.
file ASCII [or binary, see -b] datafile. If no file is given, pshistogram will read standard input.
-Jx xscale[/yscale] (Linear scale(s) in distance unit/data unit).
-W Sets the bin width used for histogram calculations.
OPTIONS
No space between the option flag and the associated arguments.
-B Sets map boundary tickmark intervals. See psbasemap for details.
-2 Read second rather than first column.
-A Plot the histogram horizontally from x = 0 [Default is vertically from y = 0].
-C Center bin on each value. [Default is left edge].
-E Sets the viewpoint's azimuth and elevation (for perspective view) [180/90]'
-G Select filling of bars. [Default is no fill]. Specify the shade (0-255) or color (r/g/b, each in 0-255).
-H Input file(s) has Header record(s). Number of header records can be changed by editing your .gmtdefaults file. If used, GMT default
is 1 header record.
-I Inquire about min/max x and y after binning. No plotting is done. Append o to output an ASCII table of the resulting x,y data.
-K More PostScript code will be appended later [Default terminates the plot system].
-L Draw bar outline using the specified pen thickness. [Default is no outline].
-bo Selects binary output. Append s for single precision [Default is double].
-P Selects Portrait plotting mode [GMT Default is Landscape, see gmtdefaults to change this].
-Q Draw a cumulative histogram.
-R west, east, south, and north specify the Region of interest. To specify boundaries in degrees and minutes [and seconds], use the
dd:mm[:ss] format. Append r if lower left and upper right map coordinates are given instead of wesn. If not given, pshistogram will
automatically find reasonable values for the region.
-S Draws a stairs-step diagram instead of histogram.
-U Draw Unix System time stamp on plot. User may specify where the lower left corner of the stamp should fall on the page relative to
lower left corner of plot. Optionally, append a label, or c (which will plot the command string.). The GMT parameters UNIX_TIME and
UNIX_TIME_POS can affect the appearance; see the gmtdefaults man page for details.
-V Selects verbose mode, which will send progress reports to stderr [Default runs "silently"].
-X -Y Shift origin of plot by (x-shift,y-shift). Prepend a for absolute coordinates; the default (r) will reset plot origin.
-Z Choose between 6 types of histograms: 0 = counts [Default], 1 = frequency_percent, 2 = log (1.0 + count), 3 = log (1.0 + fre-
quency_percent), 4 = log10 (1.0 + count), 5 = log10 (1.0 + frequency_percent).
-c Specifies the number of plot copies. [Default is 1]
-bi Selects binary input. Append s for single precision [Default is double]. Append n for the number of columns in the binary file(s).
[Default is 2 input columns].
EXAMPLES
To draw a histogram of the data v3206.t containing seafloor depths, using a 250 meter bin width, center bars, and draw bar outline, try:
pshistogram v3206.t -JXh -W250 -C -L0.5p -V > plot.ps
If you know the distribution of your data, you may explicitly specify range and scales. E.g., to plot a histogram of the y-values (2nd col-
umn) in the file errors.xy using a 1 meter bin width, plot from -10 to +10 meters @ 0.75 cm/m, annotate every 2 m and 100 counts, and use
black bars, try:
cut -f2 errors.xy | pshistogram -W1 -R-10/10/0/0 -Jx0.75c/0.01c -B2:Error:/100:Counts: -G0 -V > plot.ps
Since no y-range was specified, pshistogram will calculate ymax in even increments of 100.
SEE ALSO gmt(1gmt), psbasemap(1gmt), psrose(1gmt), psxy(1gmt)
1 Jan 2004 PSHISTOGRAM(l)