ich habe eine Frage zum Zusammenspiel dieser Software.
Ich tue folgendes:
Ich erstelle in Python Matplotlib einen Graphen.
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
mpl.style.use('seaborn-colorblind')
import glob
from matplotlib2tikz import save as tikz_save
Daten_roh = np.loadtxt('plot_Tempkalibrierung_roh.dat',skiprows=6)
Daten_kal = np.loadtxt('plot_Tempkalibrierung_kal.dat',skiprows=6)
Daten_rohM = np.matrix([Daten_roh[:,0],
...
Daten_roh[:,39]])
Daten_kalM = np.matrix([Daten_kal[:,0],
...
Daten_kal[:,39]])
roh_min = np.squeeze(np.asarray(Daten_rohM.min(0)))
roh_max = np.squeeze(np.asarray(Daten_rohM.max(0)))
kal_min = np.squeeze(np.asarray(Daten_kalM.min(0)))
kal_max = np.squeeze(np.asarray(Daten_kalM.max(0)))
fig = plt.figure(figsize=(7,4))
ax = fig.add_subplot(111)
xachse = np.arange(0, 27923)*2/3600
ax.fill_between(xachse[11500:12600],roh_min[11500:12600],roh_max[11500:12600],color = 'red',alpha=0.2, label ='roh')
ax.fill_between(xachse[11500:12600],kal_min[11500:12600],kal_max[11500:12600],color = 'blue',alpha=0.2, label ='kal')
ax.plot(xachse[11500:12600],Daten_kal[11500:12600,2],'k',label='ref')
ax.grid()
plt.xlabel('Zeit (h)')
plt.ylabel('Zeit in \si{\\degreeCelsius}')
plt.ylim(59.95,60.45)
plt.legend()
#plt.show()
tikz_save('Kalibrierauswertung.pgf')
Wenn ich mir den entsprechenden Code anzeigen lasse sieht dieser so aus:
% This file was created by matplotlib2tikz v0.6.14.
\begin{tikzpicture}
\begin{axis}[
xlabel={Zeit (h)},
ylabel={Zeit in \si{\degreeCelsius}},
xmin=6.35836111111111, xmax=7.02997222222222,
ymin=59.95, ymax=60.45,
tick align=outside,
tick pos=left,
xmajorgrids,
x grid style={white!69.019607843137251!black},
ymajorgrids,
y grid style={white!69.019607843137251!black},
legend style={draw=white!80.0!black},
legend cell align={left},
legend entries={{ref},{roh},{kal}}
]
\addlegendimage{no markers, black}
\path [draw=red, fill=red, opacity=0.2] (axis cs:6.38888888888889,62.739)
--(axis cs:6.38888888888889,62.106)
--(axis cs:6.38944444444444,62.119)
--(axis cs:6.39,62.099)
...
--cycle;
\path [draw=blue, fill=blue, opacity=0.2] (axis cs:6.38888888888889,62.5879316853268)
--(axis cs:6.38888888888889,61.9106342850214)
--(axis cs:6.38944444444444,61.9235743705174)
--(axis cs:6.39,61.9176020251081)
...
--(axis cs:6.38944444444444,62.5550997327063)
--(axis cs:6.38888888888889,62.5879316853268)
--cycle;
\addplot [semithick, black]
table {%
6.38888888888889 62.4369057060658
6.38944444444444 62.4070223582104
6.39 62.3791311779396
6.39055555555556 62.3442671274878
...
6.99944444444444 55.1620916186744
};
\end{axis}
\end{tikzpicture}In Tex ist der Code so eingebunden:
\begin{figure}
\centering
\input{B:/Pr...g/Kalibrierauswertung.pgf}
\caption{beipsielhafte Kalibriererebnisse}
\label{G_KaliTemp}
\end{figure}
- Wieso stimmt die Legende nicht und wie kann ich das ändern?
- Wieso werden die Größenangaben aus python nicht übernommen und wie kann ich das ändern?
Vielleicht noch eine dritte Frage: Sollte es eher ein python Problem sein, weiß jemand an wen ich mich dann wenden kann?
Danke und Gruß,
Axel

