## February 14, 2013

You can follow this conversation by subscribing to the comment feed for this post.

For an alternate parameterization (with a more pointy bottom) see my Valentine to my spouse. I also include some math-geeky phrases of affection, such as "You are more beautiful than Euler's identity!"

Saw this great solution on Stackoverflow: http://stackoverflow.com/questions/8082429/plot-a-heart-in-r

```
dat<- data.frame(t=seq(0, 2*pi, by=0.1) )
xhrt <- function(t) 16*sin(t)^3
yhrt <- function(t) 13*cos(t)-5*cos(2*t)-2*cos(3*t)-cos(4*t)
dat\$y=yhrt(dat\$t)
dat\$x=xhrt(dat\$t)
plot(y ~ x, data=dat, type="l", bty="n", xaxt="n", yaxt="n", ann=FALSE)
with(dat, polygon(x,y, col="hotpink"))
points(c(10,-10, -15, 15), c(-10, -10, 10, 10), pch=169, font=5)
```

### Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

## Information

R for the Enterprise

Got comments or suggestions for the blog editor?
Email David Smith.