Home   Publications   Resources   My CV   Contact   RSSRSS

Advanced Graphics I

June 23, 2013 by Daniel Marcelino | Filed under Tutorials.

polygon Polygon is a such handy function in R for drawing beautiful charts where we can select regions (polygons) of the surface. It's quite useful for indicating confidence regions of parameters, predictions for time-series, or areas under distributions:


Tags: ,

4 Responses to “Advanced Graphics I”

  1. Kenn says:

    The following lines are not polite!

    # rm(list = ls()) # clear objects
    # graphics.off() # close graphics windows

    If I want to try out your code and I already have an R session open then the last thing I want is first destroying the results of my previous work. Although every sensible person would first open a new empty session for trying out a code found from a random blog, you can't count on it. And in that case, rm(list=ls()) would be useless anyway. This shows your attitude towards your readers: you seem to think that everything they do is worthless when compared to your precious code.

    And what if I send you the code starting with:

    # unlink("C:/", recursive = TRUE, force=TRUE)
    # to have a clear starting point

    Would that be nice? Uh?

  2. YR says:

    Just add box() at the end of the script as the polygon overlaps with the x-axis ;-)

Leave a Reply

Your email address will not be published. Required fields are marked *

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    
    Markdown is turned off in code blocks:
     [This is not a link](http://example.com)

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see http://daringfireball.net/projects/markdown/syntax