-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample_plot.py
More file actions
29 lines (24 loc) · 795 Bytes
/
example_plot.py
File metadata and controls
29 lines (24 loc) · 795 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import matplotlib as mpl
mpl.use("pgf")
pgf_with_pdflatex = {
"pgf.texsystem": "pdflatex",
"font.family": "serif",
"pgf.preamble": \
r"\usepackage[utf8x]{inputenc}" \
r"\usepackage[T1]{fontenc}" \
r"\usepackage{times}"
}
mpl.rcParams.update(pgf_with_pdflatex)
# Output file basename
outputname = "example_plot"
import MoodyChart as MC
# Create plot window
# Options can be passed as plt = MC.MoodyChart(lang="es",f_plotmax=1e-1,...)
plt = MC.MoodyChart()
ax = plt.gca() # Only needed if something else is to be plotted
# Plot data passed as two [x1,x2,...],[y1,y2,...] arrays
# ax.plot([],[],'ro')
# ax.plot([],[],'bo')
# Plotting ...
plt.savefig(outputname + '.pgf', bbox_inches = 'tight')
plt.savefig(outputname + '.pdf', bbox_inches = 'tight')