小编Ste*_*han的帖子

Tikz 精确平滑的曲线

我正在尝试绘制一些曲线,但效果不太好。

  • 我需要的

我需要的

  • 我得到什么

我得到什么

\documentclass{standalone}
\usepackage{tikz}
\usepackage{pgfplots}

\begin{document}
    \begin{tikzpicture}
        \begin{axis}[
            ticks=none,
            xtick distance=1,
            ytick distance=1,
            axis equal image=true,
            grid,
            grid style={gray!50},
            grid=both,
            xlabel={$x$},
            ylabel={$y$},
            axis lines=middle,
            xmin=-4, xmax=9, ymin=-5, ymax=4,
            axis x line=center,
            axis y line=center,
        ]
            \addplot[thick, smooth] plot coordinates
            {
                (-3, -1)
                (-.5, -3)
                (.5, -1.9)
                (1.5, -2.8)
                (3.5, 1)
                (5.5, 3)
                (7.5, -1.95)
                (8, -1.5)
            };
        \end{axis}
    \end{tikzpicture}
\end{document}
Run Code Online (Sandbox Code Playgroud)

是否可以在不添加大量点的情况下构建如此平滑的曲线?在原图中,您可以看到几个参考点。有什么办法可以配置\addplot或者其他命令吗?

tikz pgf

3
推荐指数
1
解决办法
1万
查看次数

标签 统计

pgf ×1

tikz ×1