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 8940071
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:57:27+00:00 2026-06-15T10:57:27+00:00

I want to create transparent lines with the grid package. This works (only for

  • 0

I want to create transparent lines with the grid package.

This works (only for horizontal and vertical lines):

require(grid)
grid.newpage()
grid.rect(x=0.5, y=0.5, width=0, height=0.5, gp=gpar(col=rgb(1, 0, 0, .4)))

However, this doesn’t:

grid.newpage()
grid.lines(x=c(0.5, 0.5), y=c(0.25, 0.75), gp=gpar(col=rgb(1, 0, 0, .4)))

I tried this both in RStudio v0.97.237 and in RGui 2.15.2.

UPDATE: when I put this second code chunk in a function, such as in the dothegrid() in the first answer below, it does work in RStudio, but only after a restart, of after clicking “Clear All” in RStudio’s plot device pane.

UPDATE2: now we’re getting somewhere: It only works when clicking on “Clear All” in RStudio, followed by the grid.lines statement (WITHOUT the grid.newpage() statement)

  • 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-06-15T10:57:28+00:00Added an answer on June 15, 2026 at 10:57 am

    I don’t think the proble is due to newpage command.

    I play with units :

    this doesn’t work

     grid.newpage()
     grid.lines(x,y,   gp=gpar(col='red'),default.units = "npc")
    

    But when I change the default units this work :

     grid.newpage()
     grid.lines(x,y,   gp=gpar(col='red',alpha=0.4),default.units='naif')
    

    Notice that that naif is used when you pass the functions a numeric vector without any associated units.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to be able to create a transparent background using only CSS but
I want to create a dialog with transparent BG and no border. For this
Yes, I want to use GIMP to create a transparent image with some text
i want create Dynamic Slideshow in Jquery i'm Write this code var ctx =
I want create module which update list of usb devices automatically (not only mass
I want to create a c# application with multiple windows that are all transparent
I want to create a transparent button so that the user can still see
I am running Octave 3.4.0 and want to create a transparent surface plot. However,
I want to create 2 slideshows - one beside the other ( like this
I am new to MAC development. I want to create a window with transparent.

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.