FlowingData Forums » Data Visualization

How to plot Figure 6-7 from your new book?

Started 9 months ago by minghsuy / 3 posts

  1. Hi
    I tried to use
    scatter.smooth(x=1:length(unemployment$Value), y=unemployment$Value,ylim=c(0,11), degree=2, col="#CC00CC", span=0.5,family='symmetric',lwd=2,frame.plot=FALSE)
    But the line is not able to become thicker, only the data points become thicker, may you let us know how to plot as professional as you did in your book by R? Thank you

  2. @minghsuy - I brought that graph into Illustrator and changed colors, background, and line thickness, but if you want to change the line width in R, you'll have to draw the LOESS line (the fitted curve) separately. So instead of using scatter.smooth(), you could use plot() for just the dots, and then use loess() and lines() to add the line.

    I haven't tried this (just did a quick search), but it might be helpful:

    http://research.stowers-institute.org/efg/R/Statistics/loess.htm

    hth.

  3. Thank you :)


Reply

You must log in to post.

About this Topic

Tags