Skip to content

why is generating the same graph???

4 messages · Vanúcia Schumacher, David Winsemius, PIKAL Petr +1 more

#
On Feb 22, 2012, at 7:08 PM, Van?cia Schumacher wrote:

            
Color me puzzled:

You are complaining that the same graph is produced when you give it  
the same data?
#
Hi
I am rather puzzled. Hist will always plot a histogram if you give 
suitable data to it. You do not show what x is. 
And I believe that if you do

hist(dados[[1]], seq(20, 35, 0.5), prob=TRUE, xlab="Bla bla 
(m/s)",ylab="xxxxxxxxxxx", main="150 m")
curve(dweibull(x, shape=0.614, scale=2.435), 0,18,add=T, col='blue')

You get some changes in your graph. If not something is wrong with hist or 
curve. You maybe redefined those functions somehow.

Regards
Petr
http://www.R-project.org/posting-guide.html
#
The usual - in fact probably the only - explanation for the same graph is that the same data set is plotted. 

This can happen by mistake for lots of reasons, all associated with the operator. Check that:
- you have no error messages on file reading. if read.table fails, the initial data set will not be replaced, and R will plot the data set by that name.
- your script is actually plotting the data set you are reading; it is surprisingly easy to get names wrong by a character and not notice
- that you are reading the right file
- that the files you are reading contain different data
- that the differences are in column 1 of the data set and not in another column
- if you're plotting inside a function, check that the data plotted has the name of the argument and not the name of an object somewhere else in your workspace (This happens often when testing scripts; if we say f<-function(x) plot(y)   and then run f using, say, f(z), the function will plot y if it exists in the parent environment for the function. It's not unusual to have created a temporary y (or whatever) to test the code... 

S
This email and any attachments are confidential. Any use...{{dropped:8}}