Using SVG in a Jupyter notebook with R kernel mangles the text. See here and here. The workaround is to use PNG. It's a bit blurry. In Python, you can ask the PNG renderer to use more dots per inch with
InlineBackend.figure_format = 'retina'
See for example trick 15 here.
How can I get higher resolution plots using the R kernel? SVG workaround? PNG renderer settings?
Edit: I'm using ggplot in R.
Edit 2: I found repr.plot defaults here, including res, which looks to be dots per inch (dpi). However, when I raise the res from 120 to 300, the plot gets bigger, despite me setting height and width.
Edit 3: I filed this issue. There are suggestions for how to fix it in the code, but no workarounds.
I have recently discover that packages : plotly can work well on creating ggplot images
try the plot_ly() function to save png pics
here is a demo using plot_ly
hope this can help!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With