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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T22:26:55+00:00 2026-06-03T22:26:55+00:00

I can’t change the fontsize in a direct.label (from the directlabels package) ggplot2 plot.

  • 0

I can’t change the fontsize in a direct.label (from the directlabels package) ggplot2 plot. See below for a reproducible example – there’s no problem in rotating the labels 45 degrees, making them bold, serif, and 50% transparent (all the other arguments in the list at the end of the code below) – but I can’t control the fontsize. (I don’t really want them to be 25, this is just for testing….)

Is there something I’m missing, or is this a bug?

library(ggplot2)
library(scales)
library(directlabels)
df <- data.frame(x = rnorm(26), y=rnorm(26), let=letters)
p <- ggplot(df, aes(x, y, color=let)) + geom_point() 
direct.label(p, 
    list("top.points", rot=45, fontsize=25, 
        fontface="bold", fontfamily="serif", alpha=0.5))
  • 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-03T22:26:56+00:00Added an answer on June 3, 2026 at 10:26 pm

    I figured it out, you use cex to change the font size.

    df <- data.frame(x = rnorm(26), y=rnorm(26), let=letters)
    p <- ggplot(df, aes(x, y, color=let)) + geom_point() 
    direct.label(p, 
        list("top.points", rot=45, cex=6, 
              fontface="bold", fontfamily="serif", alpha=0.5))
    

    That would give you,
    jjj

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

Sidebar

Related Questions

Does anyone know how can I replace this 2 symbol below from the string
Can somebody help me with this. There is HTML code: <h3> <label> <input type=checkbox
Can anyone give me an example of how to return the following json simply
Can MOSS integrate and get user profiles from multiple Active Directory and/or LDAP stores?
Can a Visual Studio 2008 custom tool be passed additional parameters from the custom
Can anyone direct me to a good tutorial on how to set up virtual
Can someone tell me the regex to see if something is surrounded in double
Can I perform aggregate queries on values in an hstore column? For example, I'd
Can anyone see why this form is being submitted in the normal fashion and
Can anyone tell the block animation equivalent of this below code snippet? [UIView beginAnimations:@View

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.