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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:29:56+00:00 2026-05-25T02:29:56+00:00

This is in part related to my question yesterday. So here is the data

  • 0

This is in part related to my question yesterday.

So here is the data and a plot created in ggplot2.

df = data.frame(date=c(rep(2008:2013, by=1)),
                value=c(303,407,538,696,881,1094))


ggplot(df, aes(date, value, width=0.64)) + 
        geom_bar(stat = "identity", fill="#336699", colour="black") +
        ylim(c(0,1400)) + opts(title="U.S. Smartphone Users") +
        opts(axis.text.y=theme_text(family="sans", face="bold")) +
        opts(axis.text.x=theme_text(family="sans", face="bold")) +
        opts(plot.title = theme_text(size=14, face="bold")) +
        xlab("Year") + ylab("Users (in millions)") +        
        opts(axis.title.x=theme_text(family="sans")) +
        opts(axis.title.y=theme_text(family="sans", angle=90)) +
        geom_segment(aes(x=2007.6, xend=2013, y=550, yend=1350), arrow=arrow(length=unit(0.4,"cm")))

Is it possible to produce the squigly trend line in the following graph with ggplot2

I had created the plot in R and then made prettied it up in Adobe Photoshop, and I’m wondering if could have produced that squiggly trend line straight in R.

If this can’t be done in ggplot2, are there any specific R packages which would be amenable to this task?

I’m not asking about reproducing the graph. That’s not an issue. Just producing the trend line seems to be an issue.

enter image description here

  • 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-25T02:29:56+00:00Added an answer on May 25, 2026 at 2:29 am

    As per all the comments: the squiggly line is scientifically dubious, since it isn’t based upon a statistical model of the data. (And it appears to show the number of smartphone users levelling off, when the data shows no such thing.) So the best advice is “don’t do it”.

    Since you seem really keen on the idea though, yes it is possible.

    You can add any line you like with geom_line. To replicate the silly line in your infographic, you could do a straight line plus a sine curve for give it wiggle. Assuming your plot was named p

    p + geom_line(
      aes(date, value), 
      data = data.frame(
        date = seq(2008, 2013, length.out = n),
        value = seq(600, 1300, length.out = n) + 100 * sin(seq(0, 4 * pi, length.out = n))  
      ), 
      arrow = arrow(length = unit(0.4, "cm"))
    )
    

    A better approach would be to use a loess smoothed curve.

    p + geom_smooth(method = "loess", se = FALSE)  #maybe also span = 0.5, for extra wigglyness.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The code related to this question is here: https://github.com/jchester/lua-polarssl/tree/master/src Currently I'm trying to wrap
This question is related to another thread, you can read here: Forms authentication with
I am writing this question in part based on a related question on helper-scripts
to be honest- ive asked (a part of this question) here but now i
This is kind of a two part question. But it both relates to the
This maybe a related question: Java assignment issues - Is this atomic? I have
This is part of a series of at least two closely related, but distinct
This is part of a series of at least two closely related, but distinct
This is related to my question at the below link, however posting on a
Related to my question here . I've got a JavaScript statement as follows: <script

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.