我希望绘制 x=-3|sin (y)| 的图形,以生成类似字母 E 的图形部分。您能帮忙吗?
答案1
我会用pgfplots
并以参数方式绘制
% arara: pdflatex
\documentclass{standalone}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
axis lines=middle,
ymin=-4,ymax=4,
]
\addplot[ samples=200, domain=-pi:pi] ({-3*abs(sin(deg(x)))}, {x});
\end{axis}
\end{tikzpicture}
\end{document}
答案2
这是你要找的吗?
(要删除轴,只需替换school book axes
为xy Cartesian
)
\documentclass[a4paper]{article}
\usepackage[utf8x]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{tikz}
\usetikzlibrary{datavisualization}
\usetikzlibrary{datavisualization.formats.functions}
\begin{document}
\begin{tikzpicture}
\datavisualization [school book axes, visualize as smooth line]
data[format=function] {
var y : interval [-pi:pi] samples 210;
func x = -3*abs(sin(\value y r));
};
\end{tikzpicture}
\end{document}