Figure Caption not Showing for ggplot2 Graph

I created this graph using ggplot2:

```{r ggplot1, fip.cap="Example graph"}
ggplot(data.frame(x = c(1, 2, 3, 4, 5), y = c(1, 4, 9, 16, 25)), aes(x=x, y=y)) +
labs(x="$x$", y="$y$") +
geom_line() + geom_point()
```

The figure caption should be "Example graph". But for some reason it's not showing. For every other graph I made, it worked perfectly fine. Here is an image.

in this example you are using fip.cap instead of fig.cap

check your option name in your document

Wow. I checked for typos and I didn't notice it until you told me. Thanks, it works now.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.