Posts Tagged ‘ plot ’

Repulsive dots pattern, the difference of distance

June 14, 2010
By
Repulsive dots pattern, the difference of distance

What if you wanted to randomly place objects into a field, and the more objects you had, the more they rejected newcomers placed nearby? To find out, I setup a simulation. The code, shown at the end, isn’t all that interesting, and the plots shown below aren’t all that special. I think there is one

Read more »

Example 7.41: hazard function plotting

June 14, 2010
By
Example 7.41: hazard function plotting

As we continue with our series on survival analysis, we demonstrate how to plot estimated (smoothed) hazard functions. RWe will utilize the routines available in the muhaz package. Background information on the methods can be found in K.R. Hess, D.M....

Read more »

R: More plotting fun with Poission

May 28, 2010
By
R: More plotting fun with Poission

Coded as follows: x = seq(.001,50,.001) par(bg="black") par(mar=c(0,0,0,0)) plot(x,sin(1/x)*rpois(length(x),x),pch=20,col="blue")

Read more »

First annual R plot replication prize

May 3, 2010
By
First annual R plot replication prize

$100 to the first person who can figure out how I created this plot and replicate it. Some hints: It was done in R. There is only one underlying probability distribution involved (one “rdist()“). Including the “plot” statement, I created this with 3 short lines of code. This is based on a random sampling of unstated size, so

Read more »

R: more plotting fun, this time with the Poisson

April 21, 2010
By
R: more plotting fun, this time with the Poisson

Click on image for a larger version. Here is the code: par(bg="black") par(mar=c(0,0,0,0)) plot(sort(rpois(10000,100))/rpois(10000,100),frame.plot=F,pch=20,col="blue")

Read more »

Summarising data using scatter plots

April 18, 2010
By
Summarising data using scatter plots

A scatter plot is a graph used to investigate the relationship between two variables in a data set. The x and y axes are used for the values of the two variables and a symbol on the graph represents the combination for each pair of values in the data set. This type of graph is

Read more »

R: another nifty graph

April 8, 2010
By
R: another nifty graph

Make sure to click on the image to see the large version. Code for this graph: moxbuller = function(n) { u = runif(n) v = runif(n) x = cos(2*pi*u)*sqrt(-2*log(v)) y = sin(2*pi*v)*sqrt(-2*log(u)) r = list(x=x, y=y) return(r) } r = moxbuller(50000) par(bg="black") par(mar=c(0,0,0,0)) plot(r$x,r$y, pch=".", col="blue", cex=1.2)

Read more »

Summarising data using dot plots

March 26, 2010
By
Summarising data using dot plots

A dot plot is a type of display that compares counts, frequencies, totals or other summary measures for a series of categories. The dot plot can be arranged with the categories either on the vertical or horizontal axis of the display to allow comparising between the different categories as well as comparison within categories where

Read more »

R plotting fun

March 25, 2010
By
R plotting fun

Not easy to produce cool looking graphs in R, but it can be done. The results of some messing around are above. Here is the code I used:

Read more »

R: Add vertical line to a plot

March 21, 2010
By

If you have a plot open and want to add a vertical line to it: abline(v=20) #Add vertical line at x=20

Read more »