diff --git a/Makefile b/Makefile index df536db..0d8a870 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,7 @@ all: build/s4f-regionalgruppen-logos.zip -build/bars.pdf: plot_bars.py | build - python plot_bars.py - - -build/s4f_logo_dortmund.pdf: regionalgruppen.txt build/bars.pdf logo.tex create_logos.py +build/s4f_logo_dortmund.pdf: regionalgruppen.txt logo.tex create_logos.py python create_logos.py diff --git a/create_logos.py b/create_logos.py index 31e2e63..7047811 100644 --- a/create_logos.py +++ b/create_logos.py @@ -66,6 +66,14 @@ def build_logo(regionalgruppe): '--export-plain-svg=' + filename + '.svg', ], cwd=OUTDIR, stdout=sp.PIPE, check=True) + sp.run([ + 'inkscape', + filename + '.pdf', + '--without-gui', + '--export-text-to-path', + '--export-pdf=' + filename + '.pdf', + ], cwd=OUTDIR, stdout=sp.PIPE, check=True) + print(regionalgruppe, 'done') diff --git a/logo.tex b/logo.tex index 75ab790..f86ce64 100644 --- a/logo.tex +++ b/logo.tex @@ -29,7 +29,7 @@ \begin{scope} \clip (0, 0) circle (3.34cm); - \node[anchor=center] at (0, 0) {\includegraphics[height=6.68cm]{build/bars.pdf}}; + \node[anchor=center] at (0, 0) {\includegraphics[height=6.68cm]{warming_stripes_circle.pdf}}; \end{scope} \path[ diff --git a/plot_bars.py b/plot_bars.py deleted file mode 100644 index dc503d3..0000000 --- a/plot_bars.py +++ /dev/null @@ -1,35 +0,0 @@ -import matplotlib.pyplot as plt -from matplotlib.patches import Rectangle -from matplotlib.collections import PatchCollection -import pandas as pd - -plt.rcParams['font.family'] = 'Open Sans' - -URL = 'https://data.giss.nasa.gov/gistemp/tabledata_v4/GLB.Ts+dSST.csv' - -df = pd.read_csv( - URL, - skiprows=1, - index_col=0, - na_values='***', -) -year_mean = df['J-D'].dropna() - - -fig = plt.figure(figsize=(4, 4)) -ax = fig.add_axes([0, 0, 1, 1]) -ax.set_axis_off() - - -cmap = plt.get_cmap('RdBu_r') - -rectangles = [Rectangle((year, 0), 1, 1) for year in year_mean.index] -col = PatchCollection(rectangles) -col.set_array(year_mean) -col.set_cmap(cmap) -ax.add_collection(col) - -ax.set_ylim(0, 1) -ax.set_yticks([]) -ax.set_xlim(1880, 2019) -fig.savefig('build/bars.pdf') diff --git a/warming_stripes_circle.pdf b/warming_stripes_circle.pdf new file mode 100644 index 0000000..d1a290a Binary files /dev/null and b/warming_stripes_circle.pdf differ