![丑陋的双坐标图](https://linux22.com/image/284209/%E4%B8%91%E9%99%8B%E7%9A%84%E5%8F%8C%E5%9D%90%E6%A0%87%E5%9B%BE.png)
由于某种原因,这段代码生成的图看起来非常丑陋。这两个系列看起来像是手绘的。我以为这个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}