I have a situation where, for display purposes, I need to crop the displayed chart in the <div> container.
At the most basic level, this is what I would like to do:
```{r fig.width=7, fig.height=6,results='asis',echo=FALSE} cat('<div>') plot(cars) cat('</div>') ```
However, the output is as follows:

Is there a workaround if you need to "wrap" the output?
The same behavior occurs when it completes the plot. Otherwise, including private tags, it works as expected:
```{r fig.width=7, fig.height=6,results='asis',echo=FALSE} cat('<div>') cat('</div>') plot(cars) cat('<h1>Hello</h1>') ```
But the wrapper of the image seems to break it. I also notice that <img> wrapped in <p> can this behavior be stopped?
source share