Browse Source

Add tornado plot to a LaTeX file

main
parent
commit
f867bc70fa
  1. BIN
      tornado/tornado.pdf
  2. 17
      tornado/tornado.tex
  3. BIN
      tornado/tornado_plot.pdf
  4. 1142
      tornado/tornado_plot.pgf
  5. 21
      tornado/tornado_plot.py

BIN
tornado/tornado.pdf

17
tornado/tornado.tex

@ -0,0 +1,17 @@
\documentclass{article}
\usepackage{geometry}
\geometry{a5paper, portrait}
\usepackage{pgf}
\begin{document}
\begin{figure}[ht]
\centering
\includegraphics{tornado_plot.pdf}
\caption{Tornado plot}
\end{figure}
\end{document}

BIN
tornado/tornado_plot.pdf

1142
tornado/tornado_plot.pgf
File diff suppressed because it is too large
View File

21
tornado/tornado.py → tornado/tornado_plot.py

@ -3,13 +3,22 @@
import pandas as pd
import requests
import matplotlib.pyplot as plt
from matplotlib import rc
import matplotlib
import json
from scipy import interpolate
import numpy as np
# %% Use LaTeX
rc('text', usetex=True)
# %% Use LaTeX, XXX might not need this
plt.rc('text', usetex=True)
plt.rc('font', family='serif')
# matplotlib.use("pgf")
# matplotlib.rcParams.update({
# "pgf.texsystem": "pdflatex",
# 'font.family': 'serif',
# 'text.usetex': True,
# 'pgf.rcfonts': False,
# })
# %% Function to convert sizes in cm for figure size
def cm2inch(*tupl):
@ -55,7 +64,11 @@ ax.plot(df['death_change'], df['daily_deaths_avg'], lw=1)
ax.axvline(x=0, c='black', lw=1, ls=':')
ax.spines['top'].set_visible(False)
ax.spines['right'].set_visible(False)
plt.show()
plt.savefig('tornado_plot.pdf')
# %%
#df.plot(x='death_change', y='daily_deaths_avg')
#%%
#df.plot()
Loading…
Cancel
Save