Last active
August 25, 2021 01:26
-
-
Save js51/fa6110efc5f75c2c56b7f76f1df871ae to your computer and use it in GitHub Desktop.
Matplotlib figure, no colour with latex text
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
| import matplotlib as mpl | |
| import matplotlib.pyplot as plt | |
| from cycler import cycler | |
| import numpy as np | |
| nice_fonts = { | |
| # Use LaTeX to write all text | |
| "text.usetex": True, | |
| "font.family": "serif", | |
| "axes.labelsize": 11, | |
| "font.size": 11, | |
| "legend.fontsize": 10, | |
| "xtick.labelsize": 10, | |
| "ytick.labelsize": 10, | |
| } | |
| plt.style.use('default') | |
| mpl.rcParams.update(nice_fonts) | |
| monochrome = (cycler('color', ['k']) * cycler('marker', ['', '.']) * | |
| cycler('linestyle', ['-', '--', ':'])) | |
| plt.rc('axes', prop_cycle=monochrome) | |
| fig = plt.figure() | |
| plt.plot(<<x>>, <<y>>, marker='o', markersize=3, linewidth=0.75) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment