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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T15:14:57+00:00 2026-06-09T15:14:57+00:00

How can I avoid the grey shading of the plot area that occurs when

  • 0

How can I avoid the grey shading of the plot area that occurs when plotting the following data?

df <-data.frame(x = c(0,0.2,0.5), y = c(0.6,0.7,0.9))

p <-ggplot(df, aes(x, y, ymin=0, ymax=1, xmin=0, xmax=1))

p <- p + geom_point(alpha=2/10, shape=21, 
                fill="blue", colour="black", size=5)

p

enter image description here

So fine up until this point but then adding a line equation using geom_smooth causes part of the background to become grey.

p <- p + geom_smooth(method="lm", se=FALSE, formula=y~x, colour="black")
p

enter image description here

Any suggestions on how to avoid this? Thanks.

  • 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-09T15:14:59+00:00Added an answer on June 9, 2026 at 3:14 pm

    Add fill=NA to your geom_smooth call:

    p + geom_smooth(method="lm", se=FALSE, formula=y~x,colour="black",fill=NA)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I avoid NullPointerExceptions ? I have tried using try-catch blocks but that
How can I avoid that a user starts the same program twice? The current
When I use Sweave with R , I can avoid explicitly naming the plot
How i can avoid cross-site-scripting, by knowing, from what site user is requesting data?
How to alter the JavaScript code below so that it can avoid exposing the
I read that if you do this, you can avoid conflicts with other libraries
I know in Jenkins you can avoid duplicate builds from running on top of
Is there any way I can avoid using array_flip to optimize performance. I am
I read of a useful trick about how you can avoid using the wrong
Can I avoid the open DataReader exception (There is already an open DataReader associated

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.