Skip to content

Instantly share code, notes, and snippets.

@js51
Last active August 25, 2021 01:26
Show Gist options
  • Select an option

  • Save js51/fa6110efc5f75c2c56b7f76f1df871ae to your computer and use it in GitHub Desktop.

Select an option

Save js51/fa6110efc5f75c2c56b7f76f1df871ae to your computer and use it in GitHub Desktop.
Matplotlib figure, no colour with latex text
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