[R] Bar plot

Peter Ehlers ehlers at ucalgary.ca
Wed Feb 10 05:50:53 CET 2010


Sunita Patil wrote:
> Hello Peter
> 
> Sorry I forgot to paste the error for tittle it was as follows
> 
> *Error in title(main = "Year Vs StudentsPassed") :   plot.new has not been
> called yet*

Well, that makes sense. You can't put a title on a
plot that doesn't exist.

  -Peter

> 
> Regards
> 
> Our Thoughts have the Power to Change our Destiny.
> Sunita
> Sent from Pune, MH, India
> 
> On Tue, Feb 9, 2010 at 11:22 PM, Peter Ehlers <ehlers at ucalgary.ca> wrote:
> 
>> Here is a simple 3-step solution:
>>
>> 1. type ?barplot
>> 2. find the section labelled 'Arguments'
>> 3. carefully read what each argument means/does
>>
>> Voila, problem(s) solved.
>>
>> (It was good to include some data, but not so good
>> to say that title(...) is giving "an error". No need
>> to be secretive about the error; just say what it was.)
>>
>>  -Peter Ehlers
>>
>> Sunitap22 wrote:
>>
>>> Hello
>>> (this might be a very simple question) My data is as follows (table name
>>> is student)
>>>   Year    StudentsPassed
>>> 1  2000    300
>>> 2  2001    360
>>> 3  2002    450
>>> 4  2003    450
>>> 5  2004    270
>>> 6  2005    280
>>> 7  2006    400
>>> 8  2007    270
>>>
>>> I want to plot a barplot so for this
>>> If I use barplot(students) it says "Error in barplot.default(students) :
>>> 'height' must be a vector or a matrix"
>>>
>>> so I used the following command
>>> barplot(StudentsPassed)
>>>
>>> But this doesnt give me the names for Xaxis, how can I get the names for
>>> Xaxis, also how can I get labels for X and Y axis, and tittle, I tried
>>> title(main = "Year Vs Number of Publications")
>>> to get the title but its giving me an error
>>>
>>> Thanks in advance
>>> Sunita
>>> I want to
>>>
>> --
>> Peter Ehlers
>> University of Calgary
>>
>>
> 

-- 
Peter Ehlers
University of Calgary



More information about the R-help mailing list