Last active
May 22, 2024 10:21
-
-
Save briandk/fd3fe7f9816478b0415a to your computer and use it in GitHub Desktop.
Preamble for high resolution and vector-graphic plots in Jupyter Notebook
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Make plots inline | |
%matplotlib inline | |
# Make inline plots vector graphics instead of raster graphics | |
# from IPython.display import set_matplotlib_formats | |
# set_matplotlib_formats('pdf', 'svg') | |
# DeprecationWarning: `set_matplotlib_formats` is deprecated since IPython 7.23, directly use `matplotlib_inline.backend_inline.set_matplotlib_formats()` | |
import matplotlib_inline | |
matplotlib_inline.backend_inline.set_matplotlib_formats('retina', 'png', quality = 100) | |
# import modules for plotting and data analysis | |
import matplotlib.pyplot # as plt | |
import numpy | |
import pandas | |
import seaborn |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
will there be a way to "Save image as..." ? In my browser I had that option for PNG output, but is no longer there now with SVG, furthermore for PDF I get a "view PDF" link, which is even dead. Any clue?