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

  • Home
  • SEARCH
  • 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 7495091
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T17:58:54+00:00 2026-05-29T17:58:54+00:00

I am currently using the latest version of ggplot2 from github. In version 0.8.9

  • 0

I am currently using the latest version of ggplot2 from github.

In version 0.8.9 I could do the following to increase space between axis.title and axis.text:

Before:

ggplot(diamonds, aes(clarity)) + geom_bar() + opts(
    axis.title.x = theme_text(vjust=-1.1)
)

Fix:

ggplot(diamonds, aes(clarity)) + geom_bar() + opts(
    axis.title.x = theme_text(vjust=-1.1),
    plot.margin = unit(c(1, 1, 0.8, 0.5), "lines")
)

link to graph

and the axis.title becomes fully visible.

In the latest github version of ggplot2 plot.margin has no effect on axis.title:

ggplot(diamonds, aes(clarity)) + geom_bar() + opts(
    axis.title.x = theme_text(vjust=-0.2),
    plot.margin = unit(c(1, 1, 2, 0.5), "lines"))

link to graph

(notice the increased bottom margin – I can’t get plot.background to work in the latest development version)

It seems that 0.8.9 allows axis.title to move over the extra space created by plot.margin, but this is not allowed in the latest development version.

Is there a new way to accomplish this task (or a quick fix for it) in the latest development version?

Any help appreciated.

  • 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-29T17:58:55+00:00Added an answer on May 29, 2026 at 5:58 pm

    I am closing the question as the fix I made seems to hold for now (see below).

    I found the following code in plot-render.r:64:

    xlab_height <- grobHeight(xlabel) + 
      if (is.null(labels$x)) unit(0, "lines") else unit(0.5, "lines")
    plot_table <- gtable_add_rows(plot_table, xlab_height)
    plot_table <- gtable_add_grob(plot_table, xlabel, name = "xlab", 
      l = panel_dim$l, r = panel_dim$r, t = -1)
    
    ylab_width <- grobWidth(ylabel) + 
      if (is.null(labels$y)) unit(0, "lines") else unit(0.5, "lines")
    plot_table <- gtable_add_cols(plot_table, ylab_width, pos = 0)
    plot_table <- gtable_add_grob(plot_table, ylabel, name = "ylab",
      l = 1, b = panel_dim$b, t = panel_dim$t)
    

    which I changed to:

    xlab_height <- grobHeight(xlabel) + 
      if (is.null(labels$x)) unit(0, "lines") else unit(0.5, "lines")
    plot_table <- gtable_add_rows(plot_table, xlab_height)
    plot_table <- gtable_add_grob(plot_table, xlabel, name = "xlab", 
      l = panel_dim$l, r = panel_dim$r, t = -1, clip = "off") <---- here
    
    ylab_width <- grobWidth(ylabel) + 
      if (is.null(labels$y)) unit(0, "lines") else unit(0.5, "lines")
    plot_table <- gtable_add_cols(plot_table, ylab_width, pos = 0)
    plot_table <- gtable_add_grob(plot_table, ylabel, name = "ylab",
      l = 1, b = panel_dim$b, t = panel_dim$t, clip = "off") <---- here
    

    This allows one to use the hjust/vjust combined with plot.margin to move the axis.titles without clipping.

    On request I filled this a bug on github.

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

Sidebar

Related Questions

I am currently building an Excel 2007 Add-in using VSTO (latest version + sp1)
I am currently developing a mobile application using the latest version of Flash Builder
Scenario I am using the latest version of DevExpress XtraGrid. I am currently binding
I am using the latest version of NLog ( from nuget ) and I
Currently I'm building an application using latest Prism for Silverlight 4. I've a module
I am currently using the following command to upload my site content: scp -r
Currently I found two ways to get the latest version - in Visual Studio
I am using autoNumeric plugin with the latest version of jQuery . I have
I am currently running the latest version of Code-blocks in Ubuntu 11.04. I have
Im trying to use msbuild to get the latest version of my code from

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.