Skip to content
Prev 202480 / 398500 Next

polygon graph

Jose Narillos de Santos wrote:
(You need to get your variable names straight: DP, not USGDP)
As you have it, polygon is looking for values 1:28 on the x-axis.
It won't find them:

  par('usr')

will tell you what the range of x-values is on the plot.

Change your line to:

  polygon(c(t[1],t,t[st]), c(0, g$DP, 0), col = "blue")

This should work (untested).

  -Peter Ehlers