Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6799785
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:53:24+00:00 2026-05-26T18:53:24+00:00

When I try to give the title name as a function argument for Z

  • 0

When I try to give the title name as a function argument for Z and for legend, it is not working.. I also tried by just giving z. Please advise..

drawGraph <- function(x, y, z) {
    g_range <- range(0,x)
    plot(x, type="o", col="blue", ylim=g_range,axes=FALSE, ann=FALSE)
    box()
    axis(1, at=1:19, lab=FALSE)
    text(1:19, par("usr")[3] - 2, srt=45, adj=1.2, labels=y, xpd=T, cex=0.3)
    axis(2, las=1, at=500*0:g_range[2])
    main_title<-as.character(z)
    title(main=main_title, col.main="red", font.main=4)
    title(xlab="Build", col.lab=rgb(0,0.5,0))
    title(ylab="MS", col.lab=rgb(0,0.5,0))
    legend("topright", g_range[2], c("z"), cex=0.8, col=c("blue"), pch=21, lty=1);
}
drawGraph(AET, lab, AveElapsedTime)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T18:53:24+00:00Added an answer on May 26, 2026 at 6:53 pm

    If you wanted to construct a title outside of the function you could use an as.expression(z). This would let the title be “The average time with ranges: 1 to 8” and the values in the range would be adjusted “on the fly”.

    drawGraph <- function(x, y, z) {
        g_range <- range(0,x)
        plot(x, type="o", col="blue", ylim=g_range,axes=FALSE, ann=FALSE)
        box()
        axis(1, at=1:19, lab=FALSE)
        text(1:19, labels=y,par("usr")[3] - 2, srt=45, adj=1.2, xpd=T, cex=0.3)
        axis(2, las=1, at=500*0:g_range[2])
        main_title<-as.expression(z)
        title(main=main_title, col.main="red", font.main=4)
        title(xlab="Build", col.lab=rgb(0,0.5,0))
        title(ylab="MS", col.lab=rgb(0,0.5,0))
        legend("topright", g_range[2], c("z"), cex=0.8, col=c("blue"), pch=21, lty=1);
    }
    x <- rpois(19, 4)
    AveElapsedTime=paste("The average time with ranges:", 
                           round(range(x)[1], 3), 
                            "to" , round(range(x), 3)[1])
    lab=1:19
    drawGraph(AET, lab, AveElapsedTime)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm not sure how I should express this, but I'll give it a try.
So the title is a tad ambiguous, but I'll try and give an example.
I'll try to give as much info as I can without giving more than
I have a quick little application and wanted to give a try to develop
I want to give Windows Server 2008 a try as a .NET developer and
I'd like to give Objective-C a try in game programming. The problem is I'd
I'd like to try out OpenGL programming in Scheme. Can anyone give a recommendation
I would like to to try Emacs, and want to give it the best
I'm coming from a TortoiseSVN background and decided to give TortoiseHg a try. One
Probably this isn't the right place... but ill give it a try. I want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.