For R chunks, chunk option results = "markup", fig.show="hold" will hide text output and place all figure after the chunk.
However, the same option doesn't work for python chunks.
Where the chunk is broken by hidden output (the result="hidden" option didn't work as it does in R chunks), and the figure is rendered right after plt.show()( the fig.show="hold" option didn't work).
Only if I set results = "hold" will the figure be placed after the whole chunk.
results = "hold", fig.show="hold" output for Python
Because reticulate provides a custom knitr engine, we need to re-implement handling of these chunk options ourselves. Unfortunately, these particular options have not yet been implemented.
For R chunks, chunk option
results = "markup", fig.show="hold"
will hide text output and place all figure after the chunk. However, the same option doesn't work for python chunks.My knitr render result look like this:
results = "hide", fig.show="hold"
output for RThe original chunk
results = "hide", fig.show="hold"
output for Pythonthe original chunk
Where the chunk is broken by hidden output (the
result="hidden"
option didn't work as it does in R chunks), and the figure is rendered right afterplt.show()
( thefig.show="hold"
option didn't work).Only if I set
results = "hold"
will the figure be placed after the whole chunk.results = "hold", fig.show="hold"
output for Pythonthe original chunk
But in this case, I am not able to hide unwanted text output.
session info: