![功率/损耗图](https://linux22.com/image/478210/%E5%8A%9F%E7%8E%87%2F%E6%8D%9F%E8%80%97%E5%9B%BE.png)
我正在绘制下图:
我怀疑如何使箭头在底部附近弯曲(平滑)。这样看起来很奇怪。代码如下:
\documentclass[tikz,border=20pt]{standalone}
\usepackage{mathptmx}
\usepackage[outline]{contour}
\usetikzlibrary{calc,arrows.meta,patterns,backgrounds}
\begin{document}
\begin{tikzpicture}
\shade[left color=black!10, right color=black!80]
(0,0)-- ++(1,0)--
++(0,-0.25)-- ++(-0.25,0)-- ++(0.5,-0.5) node[anchor=north]{$P_{cus}(t)$} -- ++(0.5,0.5)-- ++(-0.25,0)-- ++(0,0.5)-- ++(1,0)--
++(0,-0.25)-- ++(-0.25,0)-- ++(0.5,-0.5) node[anchor=north]{$P_{fe}(t)$} -- ++(0.5,0.5)-- ++(-0.25,0)-- ++(0,0.5)-- ++(2,0)--
++(0,-0.25)-- ++(-0.25,0)-- ++(0.5,-0.5) node[anchor=north]{$P_{cur}(t)$} -- ++(0.5,0.5)-- ++(-0.25,0)-- ++(0,0.5)-- ++(2,0)--
++(0,-0.25)-- ++(-0.25,0)-- ++(0.5,-0.5) node[anchor=north]{Perdas por atrito} -- ++(0.5,0.5)-- ++(-0.25,0)-- ++(0,0.5)-- ++(1,0)--
++(0,-0.25)-- ++(-0.25,0)-- ++(0.5,-0.5) node[anchor=north]{Outras perdas} -- ++(0.5,0.5)-- ++(-0.25,0)-- ++(0,0.5)-- ++(1,0)--
++(0,-0.5)-- ++(1.5,1.5) node[anchor=west]{$P_o(t)$} -- ++(-1.5,1.5)-- ++(0,-0.5)-- ++(-10.5,0)-- ++(0,-3.25);
\draw (0.0,1.5) node[anchor=east]{$P(t)$};
\draw[thick, dashed] (4.0,0)--(4.0,3.75) node[anchor=south]{Entreferro};
\draw[thick, dashed] (6.5,0.25)--(6.5,3.75) node[anchor=south]{$P_e(t)$};
\end{tikzpicture}
\end{document}
答案1
利用to [out=...,in=...]
语法可以使角变得更平滑。
\documentclass[tikz,border=20pt]{standalone}
\usepackage{mathptmx}
\usepackage[outline]{contour}
\usetikzlibrary{calc,arrows.meta,patterns,backgrounds}
\begin{document}
\begin{tikzpicture}
\shade[left color=black!10, right color=black!80]
(0,0)-- ++(1,0) to [out=0,in=90]
++(0.2,-0.25) -- ++(-0.25,0)-- ++(0.5,-0.5) node[anchor=north]{$P_{cus}(t)$}
-- ++(0.5,0.5) -- ++(-0.25,0) to [out=90,in=180] ++(0.3,0.5)-- ++(0.7,0)to [out=0,in=90]
++(0.2,-0.25)-- ++(-0.25,0)-- ++(0.5,-0.5) node[anchor=north]{$P_{fe}(t)$}
-- ++(0.5,0.5)-- ++(-0.25,0)to [out=90,in=180] ++(0.3,0.5)-- ++(1.7,0)to [out=0,in=90]
++(0.2,-0.25)-- ++(-0.25,0)-- ++(0.5,-0.5) node[anchor=north]{$P_{cur}(t)$}
-- ++(0.5,0.5)-- ++(-0.25,0)to [out=90,in=180] ++(0.3,0.5)-- ++(1.7,0)to [out=0,in=90]
++(0.2,-0.25)-- ++(-0.25,0)-- ++(0.5,-0.5) node[anchor=north]{Perdas por atrito}
-- ++(0.5,0.5)-- ++(-0.25,0)to [out=90,in=180] ++(0.3,0.5)-- ++(0.7,0)to [out=0,in=90]
++(0.2,-0.25)-- ++(-0.25,0)-- ++(0.5,-0.5) node[anchor=north]{Outras perdas}
-- ++(0.5,0.5)-- ++(-0.25,0)to [out=90,in=180] ++(0.3,0.5)-- ++(0.7,0)--
++(0,-0.5)-- ++(1.5,1.5) node[anchor=west]{$P_o(t)$} -- ++(-1.5,1.5)-- ++(0,-0.5)-- (0,3.25)-- ++(0,-3.25);
\draw (0.0,1.5) node[anchor=east]{$P(t)$};
\draw[thick, dashed] (4.50,0)--(4.50,3.75) node[anchor=south]{Entreferro};
\draw[thick, dashed] (7.2,0.25)--(7.2,3.75) node[anchor=south]{$P_e(t)$};
\end{tikzpicture}
\end{document}
\documentclass[tikz,border=20pt]{standalone}
\usepackage{mathptmx}
\usepackage[outline]{contour}
\usetikzlibrary{calc,arrows.meta,patterns,backgrounds}
\begin{document}
\begin{tikzpicture}
\shade[left color=black!10, right color=black!80]
(0,0)-- ++(1,0) to [out=0,in=90]
++(0.2,-0.25) -- ++(-0.25,0)-- ++(0.5,-0.5) node[anchor=north]{$P_{cus}(t)$}
-- ++(0.5,0.5) -- ++(-0.25,0) to [out=90,in=0] ++(-0.25,0.5)-- ++(1,0)to [out=0,in=90]
++(0.2,-0.25)-- ++(-0.25,0)-- ++(0.5,-0.5) node[anchor=north]{$P_{fe}(t)$}
-- ++(0.5,0.5)-- ++(-0.25,0)to [out=90,in=0] ++(-0.25,0.5)-- ++(2,0)to [out=0,in=90]
++(0.2,-0.25)-- ++(-0.25,0)-- ++(0.5,-0.5) node[anchor=north]{$P_{cur}(t)$}
-- ++(0.5,0.5)-- ++(-0.25,0)to [out=90,in=0] ++(-0.25,0.5)-- ++(2,0)to [out=0,in=90]
++(0.2,-0.25)-- ++(-0.25,0)-- ++(0.5,-0.5) node[anchor=north]{Perdas por atrito}
-- ++(0.5,0.5)-- ++(-0.25,0)to [out=90,in=0] ++(-0.25,0.5)-- ++(1,0)to [out=0,in=90]
++(0.2,-0.25)-- ++(-0.25,0)-- ++(0.5,-0.5) node[anchor=north]{Outras perdas}
-- ++(0.5,0.5)-- ++(-0.25,0)to [out=90,in=0] ++(-0.25,0.5)-- ++(1,0)--
++(0,-0.5)-- ++(1.5,1.5) node[anchor=west]{$P_o(t)$} -- ++(-1.5,1.5)-- ++(0,-0.5)-- (0,3.25)-- ++(0,-3.25);
\draw (0.0,1.5) node[anchor=east]{$P(t)$};
\draw[thick, dashed] (4.0,0)--(4.0,3.75) node[anchor=south]{Entreferro};
\draw[thick, dashed] (6.5,0.25)--(6.5,3.75) node[anchor=south]{$P_e(t)$};
\end{tikzpicture}
\end{document}
答案2
你也可以沿着路径打开和关闭rounded corners
。优点是不需要知道路径的角度。
\documentclass[tikz,border=20pt]{standalone}
\usepackage{mathptmx}
\begin{document}
\begin{tikzpicture}
\shade[left color=black!10, right color=black!80]
(0,0)[rounded corners]-- ++(1,0)[sharp corners] --
++(0,-0.25) -- ++(-0.25,0) -- ++(0.5,-0.5) node[anchor=north]{$P_{cus}(t)$}
-- ++(0.5,0.5)-- ++(-0.25,0)[rounded corners] -- ++(0,0.5)--
++(1,0)[rounded corners=0]--
++(0,-0.25)-- ++(-0.25,0)-- ++(0.5,-0.5) node[anchor=north]{$P_{fe}(t)$} -- ++(0.5,0.5)
-- ++(-0.25,0)[rounded corners]-- ++(0,0.5)-- ++(2,0) [sharp corners]--
++(0,-0.25)-- ++(-0.25,0)-- ++(0.5,-0.5) node[anchor=north]{$P_{cur}(t)$}
-- ++(0.5,0.5)-- ++(-0.25,0)[rounded corners]-- ++(0,0.5)-- ++(2,0) [sharp corners]--
++(0,-0.25)-- ++(-0.25,0)-- ++(0.5,-0.5) node[anchor=north]{Perdas por atrito} -- ++(0.5,0.5)
-- ++(-0.25,0)[rounded corners]-- ++(0,0.5)-- ++(1,0)[sharp corners]--
++(0,-0.25)-- ++(-0.25,0)-- ++(0.5,-0.5) node[anchor=north]{Outras perdas} -- ++(0.5,0.5)
-- ++(-0.25,0)[rounded corners]-- ++(0,0.5)-- ++(1,0)[sharp corners]--
++(0,-0.5)-- ++(1.5,1.5) node[anchor=west]{$P_o(t)$} -- ++(-1.5,1.5)
[rounded corners]-- ++(0,-0.5)[sharp corners]
-- ++(-10.5,0)-- ++(0,-3.25);
\draw (0.0,1.5) node[anchor=east]{$P(t)$};
\draw[thick, dashed] (4.0,0)--(4.0,3.75) node[anchor=south]{Entreferro};
\draw[thick, dashed] (6.5,0.25)--(6.5,3.75) node[anchor=south]{$P_e(t)$};
\end{tikzpicture}
\end{document}