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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T21:25:22+00:00 2026-05-18T21:25:22+00:00

In my work, I frequently display scatterplots using text labels. That’s meant a plot()

  • 0

In my work, I frequently display scatterplots using text labels. That’s meant a plot() command, followed by text(). I used cex to adjust to font size to what I wanted it very quickly.

I created a text scatterplot very quickly using qplot. But I can’t adjust the size fast. Here’s a silly code example:

data(state)
qplot(Income, Population, 
  data=as.data.frame(state.x77), 
  geom=c("smooth", "text"), method="lm", 
  label=state.abb)

Whereas in the old days I’d do:

plot(xlim=range(Income), ylim=range(Population),
  data=state.x77, type="n")
text(Income, Population, state.abb, 
     data=state.x77, cex=.5)

If I wanted the text size halved from what I saw at the defaults (oh, and I’d have to do a linear regression manually and add abline() to get the regression line — nice to do it all in one via ggplot2).

I know I can add a size adjustment with size, but it’s not a relative size adjustment like I’m used to. Hadley tweeted me to say that size is measured in mm, which isn’t fully intuitive to me. Since I often adjust the size of the plot, either in R or in LaTeX, an absolute scale isn’t as useful to me.

I must be missing something really simple. What is it?

  • 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-18T21:25:22+00:00Added an answer on May 18, 2026 at 9:25 pm

    I think you are tyring to adjust the size of the text itself, not the x-axis, right?

    Here’s an approach using the ggplot() command.

    ggplot(data = as.data.frame(state.x77), aes(x = Income, y = Population)) +
        geom_smooth(method = "lm", se = FALSE) +
        geom_text(aes(label = state.abb), size = 2.5)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I frequently work with the System.IO namespace. Is there a way to have that
I frequently connect and disconnect my laptop from a secondary display. Additionally I work
Our developers frequently work in large Visual Studio projects and we often run command-line
I frequently work with libraries that use char when working with bytes in C++.
I find myself frequently using Python's interpreter to work with databases, files, etc --
I select certain playlists in iTunes so frequently that I've created AppleScripts to display
This question has frequently been asked over stackoverflow.com but none of the answers work
We use Infopath at work, quite frequently for form design and then we integrate
work on asp.net vs 05 C#.Master page header contain the bellow code <script type=text/javascript
work on SQL Server 2000. want to Automated Email Notifications using SQL Server Job

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.