Sponsored Content
Full Discussion: gnuplot trouble
Special Forums UNIX and Linux Applications gnuplot trouble Post 302549332 by kingnothing on Monday 22nd of August 2011 04:48:38 PM
Old 08-22-2011
gnuplot trouble

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.

Code:
#   GPLOT.PL pseudo commands for GNUPLOT"
## IF TYPE eq ps   set terminal postscript landscape color
## IF TYPE eq eps  set terminal postscript eps color
set terminal png xFFFFDD size 1280,800
## IF TYPE eq png  set terminal png
## IF TYPE eq pbm  set terminal pbm
set output "bars.png"
set xlabel "Date"
set ylabel "Gigabytes"
set multiplot
set autoscale
set border 3
set yrange [0:70000]
set xtics border nomirror rotate
set xtics ("8/22/2011" 8/22/2011, "8/23/2011" 8/23/2011)
set ytics border nomirror
set origin 0.0,0.0
set title "BARCHART"
set style data histogram
set style histogram rows
set style fill solid 1.00 border -1
set boxwidth 0.9
plot "graphdata.rpt" u 5 t "Column 5" lc rgb "#FFD300"
plot '' u 2 t "Column 2", '' u 3 t "Column 3", '' u 4 t "Column 4"


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:
Mod Comment Please use [CODE] tags when posting listings and the like

Last edited by pludi; 08-22-2011 at 06:13 PM..
 

9 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. 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

3. Shell Programming and Scripting

xargs and gnuplot

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)
Discussion started by: paulianna2002
9 Replies

4. 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

5. UNIX for Dummies Questions & Answers

GNUPLOT problem

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)
Discussion started by: jamie_123
10 Replies

6. Shell Programming and Scripting

Gnuplot command

My data input looks like this: -16.25 -38.75 9.69094 -16.25 -36.25 10.0594 -16.25 -33.75 10.3884 -16.25 -31.25 10.6653 -16.25 -28.75 10.7947 -16.25 -26.25 10.8838 -16.25 -23.75 10.8463 -16.25 -21.25 10.8131 -16.25 -18.75 10.7509 -16.25 -16.25 10.6581 -16.25 -13.75 10.6859 -16.25... (0 Replies)
Discussion started by: programmerc
0 Replies

7. Shell Programming and Scripting

Gnuplot question

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)
Discussion started by: sidiq1983
0 Replies

8. Shell Programming and Scripting

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... (1 Reply)
Discussion started by: garethsays
1 Replies

9. Shell Programming and Scripting

Gnuplot script

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
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)
All times are GMT -4. The time now is 06:01 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy