如果要取点,增加取点的数量/缩小取点的间隙是不是就可以解决「图象光滑度不是很满意」的问题呢?
related:
- https://ask.latexstudio.net/ask/question/7520.html
- https://ask.latexstudio.net/ask/question/17518.html
- https://ask.latexstudio.net/ask/question/17514.html
Claim:我不喜欢大量依赖「绝对坐标」的「可维护性差的」做法,上面
\tkzDefPoints{-2.39/0.27/A,-2/0/B,-1.15/-0.73/C,-0.55/0/D,-0.21/0.51/E,0/0/F,0.21/0.51/G,0.55/0/H,1.15/-0.73/I,2/0/J,2.39/0.27/K}
\draw plot[smooth,tension=.7] coordinates{(A)(B)(C)(D)(E)(F)(G)(H)(I)(J)(K)};
的丑陋语法让我难以接受...所以我 不打算用取点法 。
Learning From this link:
\documentclass[border=5pt,tikz]{standalone}
\tikzset{line join=round,line cap=round,thick}%
\newcommand*\myhalfpath[1][black]{%
\draw[#1] (0,0)
.. controls (.1,1) and (.6,1) .. (.8,0)
.. controls (1.2,-1.75) and (1.6,-1.2) .. (2.8,0)
.. controls (2.9,.1) and (3.1,.18) .. (3.2,.2)
;
}
\begin{document}
\begin{tikzpicture}
\draw[-latex] (-3.25,0) -- (3.25,0) node[below] {$x$};
\draw[-latex] (0,-2) -- (0,2) node[right] {$y$};
\begin{scope}[xscale=-1]
\myhalfpath[magenta]
\end{scope}
\myhalfpath[magenta]
\end{tikzpicture}
\begin{tikzpicture}
\draw[-latex] (-3.25,0) -- (3.25,0) node[below] {$x$};
\draw[-latex] (0,-2) -- (0,2) node[right] {$y$};
\myhalfpath[cyan]
\begin{scope}[scale=-1]
\myhalfpath[cyan]
\end{scope}
\end{tikzpicture}
\end{document}
如果还是不光滑就自己微调吧....
And, 希望OP可以从上面的这些提问中总结一套「此类函数绘制题」各个思路的对比和局限性的介绍,不然经常需要重复提问类似的问题。
问 用找点法拟合下面的图象时,图象光滑度不是很满意