由于某种原因,这段代码生成的图看起来非常丑陋。这两个系列看起来像是手绘的。我以为这个smooth
属性会有所帮助,但图仍然很丑陋。
\documentclass[8pt]{beamer}
\usepackage{pgfplots}
\begin{document}
\begin{frame}
\begin{tikzpicture}
\begin{axis}[domain=-0.015:1.15,
width=10cm,
scale only axis,
xmin=-0.015,
xmax=1.15,
height=8cm,
axis y line=left,
xlabel=$x_{\alpha}$,
ylabel=$y_{j}$]
\addplot [id=logit,color=blue,thick,smooth,mark=x] coordinates {(-0.0148,-1.56862) (0.02902,-3.28582)(0.06382,-3.28582)(0.12780,-2.56495)(1.13767,-3.33220)};
\end{axis}
\begin{axis}[domain=-0.015:1.15,
width=10cm,
scale only axis,
xmin=-0.015,
xmax=1.15,
height=8cm,
axis y line=right,
axis x line=none,
ylabel=$\tau_{j}$]
\addplot [id=txdef,color=green,thick,smooth,mark=*] coordinates {(-0.0148,0.17241) (0.02902,0.03571)(0.06382,0.03571)(0.12780,0.07143)(1.13767,0.03448)};
\end{axis}
\end{tikzpicture}
\end{frame}
\end{document}
答案1
这是我删除两个键后情节的样子smooth
。这是你想要实现的吗?如果不是,你希望情节是什么样子的?
\documentclass{beamer}
\usepackage{pgfplots}
\begin{document}
\begin{frame}
\begin{tikzpicture}
\begin{axis}[domain=-0.015:1.15,
width=8cm,
scale only axis,
xmin=-0.015,
xmax=1.15,
height=8cm,
axis y line=left,
xlabel=$x_{\alpha}$,
ylabel=$y_{j}$]
\addplot [id=logit,color=blue,thick,mark=x] coordinates {(-0.0148,-1.56862) (0.02902,-3.28582)(0.06382,-3.28582)(0.12780,-2.56495)(1.13767,-3.33220)};
\end{axis}
\begin{axis}[domain=-0.015:1.15,
width=8cm,
scale only axis,
xmin=-0.015,
xmax=1.15,
height=8cm,
axis y line=right,
axis x line=none,
ylabel=$\tau_{j}$]
\addplot [id=txdef,color=green,thick,mark=*] coordinates {(-0.0148,0.17241) (0.02902,0.03571)(0.06382,0.03571)(0.12780,0.07143)(1.13767,0.03448)};
\end{axis}
\end{tikzpicture}
\end{frame}
\end{document}