Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.graphics.apps.gnuplot > #1534 > unrolled thread

Histogram plot

Started byGurpreet Kaur <gurpreet.bioinfo@gmail.com>
First post2012-12-10 08:21 -0800
Last post2012-12-11 20:42 +0100
Articles 6 — 4 participants

Back to article view | Back to comp.graphics.apps.gnuplot


Contents

  Histogram plot Gurpreet Kaur <gurpreet.bioinfo@gmail.com> - 2012-12-10 08:21 -0800
    Re: Histogram plot Hans-Bernhard Bröker <HBBroeker@t-online.de> - 2012-12-11 00:18 +0100
      Re: Histogram plot Gurpreet Kaur <gurpreet.bioinfo@gmail.com> - 2012-12-10 16:49 -0800
        Re: Histogram plot scileont@gmail.com - 2012-12-10 20:10 -0800
          Re: Histogram plot gkaur <gurpreet.bioinfo@gmail.com> - 2012-12-11 08:53 -0800
        Re: Histogram plot Hans-Bernhard Bröker <HBBroeker@t-online.de> - 2012-12-11 20:42 +0100

#1534 — Histogram plot

FromGurpreet Kaur <gurpreet.bioinfo@gmail.com>
Date2012-12-10 08:21 -0800
SubjectHistogram plot
Message-ID<e1b77f5b-8bc5-46ba-a7cc-c233e8e42dcb@googlegroups.com>
Hi all, 

I am trying to make a histogram with 2 columns from a big text file using gnuplot, but getting errors. Please suggest. 

Thanks

[toc] | [next] | [standalone]


#1535

FromHans-Bernhard Bröker <HBBroeker@t-online.de>
Date2012-12-11 00:18 +0100
Message-ID<ain8tlFgg0hU1@mid.dfncis.de>
In reply to#1534
On 10.12.2012 17:21, Gurpreet Kaur wrote:

> I am trying to make a histogram with 2 columns from a big text file
> using gnuplot, but getting errors. Please suggest.

How do you suppose anybody could make a meaningful suggestion if you 
don't show _any_ of the relevant facts: no commands, no input, no 
output, not even the actual errors you get?

[toc] | [prev] | [next] | [standalone]


#1536

FromGurpreet Kaur <gurpreet.bioinfo@gmail.com>
Date2012-12-10 16:49 -0800
Message-ID<109c485e-a15a-4a14-89fa-675ab553fa54@googlegroups.com>
In reply to#1535
On Monday, December 10, 2012 6:18:15 PM UTC-5, Hans-Bernhard Bröker wrote:
> On 10.12.2012 17:21, Gurpreet Kaur wrote:
> 
> 
> 
> > I am trying to make a histogram with 2 columns from a big text file
> 
> > using gnuplot, but getting errors. Please suggest.
> 
> 
> 
> How do you suppose anybody could make a meaningful suggestion if you 
> 
> don't show _any_ of the relevant facts: no commands, no input, no 
> 
> output, not even the actual errors you get?


Hi,
I am a beginner in Gnuplot and used following code for drawing histogram from two columns in text file, but histogram does not show in negative Y-axis.
n=100	#number of intervals
max=16000	#max value
min=-300  #min value
width=(max-min)/n	#interval width
hist(x,width)=width*floor(x/width)+width/2.0    #function used to map a value to the intervals
#set term png	               #output terminal and file
#set output "histogram.png"
set xrange [min:max]
set yrange [0:]
#to put an empty boundary around the
#data inside an autoscaled graph.
set offset graph 0.05,0.05,0.05,0.0
set xtics min,(max-min)/5,max
set boxwidth width*0.9
set style fill solid 0.5	#fillstyle
set tics out nomirror
set xlabel "avePot"
set ylabel "Frequency"
#count and plot
plot "ave.txt" u (hist($1,width)):(0.5) smooth freq w boxes lc rgb"red" 

Thanks

[toc] | [prev] | [next] | [standalone]


#1538

Fromscileont@gmail.com
Date2012-12-10 20:10 -0800
Message-ID<46358e26-c2fa-4211-855d-bb2d1ef67ecb@googlegroups.com>
In reply to#1536
> set yrange [0:]

This line explicitly sets your y-range to be from 0 to whatever. Remove it if you want gnuplot to automatically adjust y-range or change [0:] to correct interval.

[toc] | [prev] | [next] | [standalone]


#1540

Fromgkaur <gurpreet.bioinfo@gmail.com>
Date2012-12-11 08:53 -0800
Message-ID<35a8fe96-e1e7-46d7-9717-2b7c861c4cfe@googlegroups.com>
In reply to#1538
On Monday, December 10, 2012 11:10:13 PM UTC-5, scil...@gmail.com wrote:
> > set yrange [0:]
> 
> 
> 
> This line explicitly sets your y-range to be from 0 to whatever. Remove it if you want gnuplot to automatically adjust y-range or change [0:] to correct interval.


Hi, I tried this option, but still not getting

[toc] | [prev] | [next] | [standalone]


#1541

FromHans-Bernhard Bröker <HBBroeker@t-online.de>
Date2012-12-11 20:42 +0100
Message-ID<aipglpF17ptU1@mid.dfncis.de>
In reply to#1536
On 11.12.2012 01:49, Gurpreet Kaur wrote:
> On Monday, December 10, 2012 6:18:15 PM UTC-5, Hans-Bernhard Bröker
> wrote:

>> How do you suppose anybody could make a meaningful suggestion if
>> you don't show _any_ of the relevant facts: no commands, no input,
>> no output, not even the actual errors you get?

> I am a beginner in Gnuplot and used following code for drawing
> histogram from two columns in text file, but histogram does not show
> in negative Y-axis.

A proper histogram does not have negative values.  And you promised 
yours wouldn't either:

> set yrange [0:]

So why do you expect the result of counting things ("smooth freq") to 
turn out negative?

[toc] | [prev] | [standalone]


Back to top | Article view | comp.graphics.apps.gnuplot


csiph-web