nschloe / tikzplotlib

:bar_chart: Save matplotlib figures as TikZ/PGFplots for smooth integration into LaTeX.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

kwarg dropped for "P" marker

ogauthe opened this issue · comments

Hello,

When a greek cross "P" is used as a marker in a line, all the formatting information about the line is lost. I suppose "P" has no direct equivalent in PGFPlots, but then some other marker should be used or an error should be raised. In any case, the linestyle for instance is lost and this should not happen.

fig, ax = plt.subplots()
ax.plot([0,1], [1,0], linestyle="", marker="o", markersize=9, color="r")
ax.plot([0,1], [0,1], linestyle="", marker="P", markersize=9, color="b")
print(tikzplotlib.get_tikz_code(fig))

gives

% This file was created by tikzplotlib v0.9.5.
\begin{tikzpicture}

\begin{axis}[
tick align=outside,
tick pos=left,
x grid style={white!69.0196078431373!black},
xmin=-0.05, xmax=1.05,
xtick style={color=black},
y grid style={white!69.0196078431373!black},
ymin=-0.05, ymax=1.05,
ytick style={color=black}
]
\addplot [semithick, red, mark=*, mark size=4.5, mark options={solid}, only marks]
table {%
0 1
1 0
};
\addplot [semithick, blue]
table {%
0 0
1 1
};
\end{axis}

\end{tikzpicture}

you see that only the color survives to translation when "P" is used as a marker. Of course the tikz plot is dramatically different from the python one.

I just discovered this tool today, thank you for making it!

Fixed now, thanks for the report.