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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:35:24+00:00 2026-06-17T07:35:24+00:00

I am trying to make a plot with no information beyond the data. No

  • 0

I am trying to make a plot with no information beyond the data. No axes; no grid; no title; just the plot.

But I keep getting extra margins and padding that I can’t remove.

library(ggplot2)
library(grid)

theme_bare <- theme(
  axis.line = element_blank(), 
  axis.text.x = element_blank(), 
  axis.text.y = element_blank(),
  axis.ticks = element_blank(), 
  axis.title.x = element_blank(), 
  axis.title.y = element_blank(), 
  #axis.ticks.length = unit(0, "lines"), # Error 
  axis.ticks.margin = unit(c(0,0,0,0), "lines"), 
  legend.position = "none", 
  panel.background = element_rect(fill = "gray"), 
  panel.border = element_blank(), 
  panel.grid.major = element_blank(), 
  panel.grid.minor = element_blank(), 
  panel.margin = unit(c(0,0,0,0), "lines"), 
  plot.background = element_rect(fill = "blue"),
  plot.margin = unit(c(0,0,0,0), "lines")
)

ggplot() + 
  geom_area (data=economics, aes(x = date, y = unemploy), linetype=0) +
  theme_bare

Produces this image: plot

What I want is this: plot ideal

I can’t figure out how to get rid of the blue and make the dark gray flush with the edges.

Could any one offer some advice?

  • 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-17T07:35:25+00:00Added an answer on June 17, 2026 at 7:35 am

    Here is the way to plot only the panel region:

    p <- ggplot() + geom_area (data=economics, aes(x = date, y = unemploy), linetype=0) +
      scale_x_date(expand = c(0,0)) + scale_y_continuous(expand = c(0,0)) +
      theme(line = element_blank(),
            text = element_blank(),
            title = element_blank())
    
    gt <- ggplot_gtable(ggplot_build(p))
    ge <- subset(gt$layout, name == "panel")
    
    grid.draw(gt[ge$t:ge$b, ge$l:ge$r])
    

    enter image description here

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

Sidebar

Related Questions

I am trying to make a bar plot that has extra data on it.
I am trying to make a contour plot of the following data using matplotlib
I'm trying to make a simple line plot but I get the following error:
I am trying to make a stacked geom_area plot, but would like to outline
I am trying to make a plot using barchart from lattice, but I am
I am trying to make a 2D density plot (from some simulation data) with
I am trying to make a scatter plot and annotate data points with different
I am trying to make a plot in R that has a portion of
I am trying to make a faceted plot in ggplot2 of the coefficients on
Trying to make a small countdown timer in my app but it's not working.

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.