Created
October 21, 2019 08:17
-
-
Save detrin/1aed3172c6a5e323e1eba7a2e5082fe5 to your computer and use it in GitHub Desktop.
Matplotlib test
This file contains 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 numpy as np | |
import matplotlib.pyplot as plt | |
import random | |
from matplotlib import rc | |
rc('font',**{'family':'serif','serif':['Helvetica']}) | |
rc('text', usetex=True) | |
start, stop, step = 1, 10, 0.4 | |
data_x = [x for x in np.arange(start, stop, step)] | |
data_y = [(10-x)*0.2+4+random.uniform(-1, 1) for x in np.arange(start, stop, step)] | |
plt.ylabel(r'$-\frac{d T}{d x}\:(\mathrm{MeV\cdot cm}^{-1})$', fontsize=12) | |
plt.xlabel(r'$T\:(\mathrm{MeV})$' , fontsize=12) | |
plt.plot(data_x, data_y, "k.", label="label") | |
# plt.show() | |
plt.savefig("test.png", size=(4, 3), dpi=600) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment