Skip to content

modify the name of axis of an R function

6 messages · David Winsemius, plocq, PIKAL Petr +1 more

#
Hi,

I use the function fpot of packages evd. If I call the fit that I obtain
"fit", I want to modify the name of the axis and the main title that is
produced by plot(fit1). To do this, I want to create a new function where I
would have the names modified. The problem is that I can't find the function
that produce these plots... I tried to see in plot.uvevd but it doesn't
seems to be the good one. Can anybody help me?
Many thanks! 

--
View this message in context: http://r.789695.n4.nabble.com/modify-the-name-of-axis-of-an-R-function-tp4198804p4198804.html
Sent from the R help mailing list archive at Nabble.com.
#
On Dec 15, 2011, at 1:53 AM, plocq wrote:

            
Usually this would be accomplished with

plot(fit, main="main title", xlab="X-axis lable", ylab="y-axis label")
Seems unlikely that this would be needed.
The way to address this, if you are committed to this path, is to  
first determine the class of the fit-object and then to look for a  
plot method with methods(plot). If you see an S3 method you can call  
up the code with:

evd:::plot.fit-class  # when "fit-class" is the value you got with  
class(fit)

If it's an S4 method, then it's much more convoluted, and over time  
I've learned not to try.
#
Thanks you very much!  The way plot(fit, main="main title", xlab="X-axis
lable", ylab="y-axis label") seems to work quite well, I didn't notice that
I could do this. 

I have in fact one more problem with it : the fact is that I have three
plots that are called by the function. I can specify my three titles by
doing "main=c("title1","title2","title3")" whithout any problem. But
proceeding this way to specify the axes' titles doesn't work anymore. How
can I specify three differents pairs of titles for these axes?

Thank you again

--
View this message in context: http://r.789695.n4.nabble.com/modify-the-name-of-axis-of-an-R-function-tp4198804p4200631.html
Sent from the R help mailing list archive at Nabble.com.
#
On Dec 15, 2011, at 11:30 AM, plocq wrote:

            
You are replying to a message on a mailing list (which most people do  
NOT see as a web page)  and the Postng Guide asks that you include  
context.
The Posting Guide also asks that you provide a specific example of  
what you mean by "not working".
No, we don't really want to do that. Nabble user are guests and need  
to learn that Rhelp is not Nabble.
And Rhelp is not at Nabble, and it's not an archive, either.
#
Hi
that
How
I am rather confused 

plot(1,1, main=c("title1", "title2"), xlab=c("x1","x2"), 
ylab=c("y1","y2"))

puts 2 titles and two axes labels into one plot but is it really what you 
want?

Regards
Petr
http://www.R-project.org/posting-guide.html
#

        
> On Dec 15, 2011, at 1:53 AM, plocq wrote:
>> Hi,
    >> 
    >> I use the function fpot of packages evd. If I call the
    >> fit that I obtain "fit", I want to modify the name of the
    >> axis and the main title that is produced by plot(fit1).

    > Usually this would be accomplished with

    > plot(fit, main="main title", xlab="X-axis lable",
    > ylab="y-axis label")

    >> To do this, I want to create a new function where I would
    >> have the names modified.

    > Seems unlikely that this would be needed.

    >> The problem is that I can't find the function that
    >> produce these plots... I tried to see in plot.uvevd but
    >> it doesn't seems to be the good one. Can anybody help me?
    >> Many thanks!

    > The way to address this, if you are committed to this
    > path, is to first determine the class of the fit-object
    > and then to look for a plot method with methods(plot). If
    > you see an S3 method you can call up the code with:

    > evd:::plot.fit-class # when "fit-class" is the value you
    > got with class(fit)

    > If it's an S4 method, then it's much more convoluted, and
    > over time I've learned not to try.

huh?   
David, I'm disappointed.

Not at all much more convoluted, just different.
I think you should make a 2nd attempt, starting with
things like

  showMethods(plot)

with versions

  showMethods(plot, class = "...")
  showMethods(plot, include = TRUE)
  showMethods(plot, class = "...", include = TRUE)

or then directly

  selectMethod(plot, "<class>")

----

and yes, this is all not relevant to  evd  where the methods are
S3 only...

Martin Maechler, ETH Zurich

    > -- 

    > David Winsemius, MD West Hartford, CT