我想要一张下面这张 PSTricks 绘图:
我可以毫无问题地绘制箭头,但我完全不知道如何绘制两个椭圆以适应不同的线宽。
箭头的绘制:
\documentclass{article}
\usepackage{pstricks}
\psset{
arrows = ->,
arrowsize = 10pt
}
\begin{document}
\begin{pspicture}(-5,-2.9)(4.5,2.9)
\psline[
linewidth = 3\pslinewidth,
linecolor = green
](-3.2,0)(-5,0)
\psset{linewidth = 2\pslinewidth}
\psline(-1,0)(-2.5,0)
\psline(-0.8,0.8)(-1.5,1.5)
\psline(0,1)(0,1.8)
\psline(1.3,0.7)(2,1.4)
\psline(1.3,-0.7)(2,-1.4)
\psline(0,-1)(0,-1.8)
\psline(-0.8,-0.8)(-1.5,-1.5)
\psline(2.95,0.5)(4.2,0.7)
\psline(3,0)(4.5,0)
\psline(2.95,-0.5)(4.2,-0.7)
\psset{linecolor = gray!50!white}
\psline(-2.5,2.5)(-1.8,1.8)
\psline(0,2.9)(0,2.1)
\psline(2.9,2.2)(2.1,1.5)
\psline(2.9,-2.2)(2.1,-1.5)
\psline(0,-2.9)(0,-2.1)
\psline(-2.5,-2.5)(-1.8,-1.8)
\end{pspicture}
\end{document}
更新
以下是我最终得到的结果:
\documentclass{article}
\usepackage{pstricks}
\begin{document}
\begin{figure}
\centering
\begin{pspicture}(-5,-2.9)(5,2.9)
\psset{
arrows = ->,
arrowsize = 10pt
}
{\psset{linecolor = red!50!white}
\psline[
linewidth = 3\pslinewidth
](-3.15,0)(-5,0)
\psline(3.45,0.4)(4.7,0.7)
\psline(3.5,0)(5,0)
\psline(3.45,-0.4)(4.7,-0.7)}
\psset{linewidth = 2\pslinewidth}
\psellipse[
fillstyle = solid,
fillcolor = black
](0,0)(3,2)
\psellipse[
linecolor = white,
fillstyle = solid,
fillcolor = white
](0.09,0)(2.9,1.9)
\psellipse[
fillstyle = solid,
fillcolor = black
](3.2,0)(0.2,0.5)
\psellipse[
linecolor = white,
fillstyle = solid,
fillcolor = white
](3.17,0)(0.17,0.4)
\psline(-1,0)(-2.7,0)
\psline(-0.8,0.8)(-1.5,1.5)
\psline(0,1)(0,1.8)
\psline(1.3,0.7)(1.93,1.35)
\psline(1.3,-0.7)(1.93,-1.35)
\psline(0,-1)(0,-1.8)
\psline(-0.8,-0.8)(-1.5,-1.5)
\psset{linecolor = gray!50!white}
\psline(-2.4,2.5)(-1.7,1.8)
\psline(0,2.9)(0,2.1)
\psline(2.9,2.3)(2.15,1.55)
\psline(2.9,-2.3)(2.15,-1.55)
\psline(0,-2.9)(0,-2.1)
\psline(-2.4,-2.5)(-1.7,-1.8)
\end{pspicture}
\caption{Newton's third law on a balloon.}
\label{fig:newton-balloon}
\end{figure}
\end{document}
答案1
一个 PSTricks 解决方案,仅供娱乐。我只为您提供了主要部分。其他部分太琐碎了。
\documentclass[pstricks,border=\dimexpr355pt/113]{standalone}
\begin{document}
\pspicture(8.7,6)
\pscustom[fillstyle=eofill,fillcolor=red,linestyle=none,linewidth=0]
{
\psellipse(4,3)(4,3)
\psellipse(4.2,3)(3.8,2.8)
\psellipse(8.45,3)(0.25,0.7)
\psellipse(8.43,3)(0.23,0.6)
}
\endpspicture
\end{document}
奖励1:渐变色
\documentclass[pstricks,border=\dimexpr355pt/113]{standalone}
\usepackage{pst-grad}
\newpsstyle{gradient}
{
fillstyle=gradient,
gradbegin=red,
gradend=yellow,
gradangle=30,
gradmidpoint=0.5,
}
\begin{document}
\pspicture(8.7,6)
\pscustom[style=gradient,linestyle=none,linewidth=0]
{
\code{/clip /eoclip load def}
\psellipse(4,3)(4,3)
\psellipse(4.2,3)(3.8,2.8)
\psellipse(8.45,3)(0.25,0.7)
\psellipse(8.43,3)(0.23,0.6)
}
\endpspicture
\end{document}
福利2:图片剪辑器
\documentclass[pstricks,border=\dimexpr355pt/113]{standalone}
\usepackage{graphicx}
\newsavebox\IBox
\savebox\IBox{\includegraphics[scale=3]{example-grid-100x100pt}}
\begin{document}
\pspicture(8.7,6)
\psclip{%
\pscustom[linestyle=none,linewidth=0]
{
\code{/clip /eoclip load def}
\psellipse(4,3)(4,3)
\psellipse(4.2,3)(3.8,2.8)
\psellipse(8.45,3)(0.25,0.7)
\psellipse(8.43,3)(0.23,0.6)
}}
\rput(4,3){\usebox\IBox}
\endpsclip
\endpspicture
\end{document}
答案2
我知道这是一个pstricks
问题,但我想提一下,tikz
可以使用来生成这些省略号。我不知道even odd rule
是否存在类似的方法。不过,这是代码,也许有人可以将其转换为。pstricks
tikz
pstricks
\documentclass[tikz,border=2mm]{standalone}
\begin{document}
\begin{tikzpicture}
\fill[even odd rule] circle[x radius=4.15,y radius=2.1]
(0.15,0) circle[x radius=4,y radius=2]
(4.8,0) circle[x radius=0.4,y radius=0.8]
(4.85,0) circle[x radius=0.45,y radius=0.9];
\path[every edge/.append style={very thick,-stealth}]
(-4.5,0) edge[ultra thick,green] ++ (-2,0)
foreach \Angle in {45,90,...,315}
{(\Angle:1 and 0.5) edge (\Angle:3.75 and 1.75)
\unless\ifnum\Angle=180\relax
(\Angle:6 and 3) edge[gray] (\Angle:4.5 and 2.25)
\fi}
foreach \Angle in {20,0,-20}
{(4,0) ++ (\Angle:1.5) edge ++ (\Angle:1)};
\end{tikzpicture}
\end{document}
答案3
\documentclass[pstricks,border=1mm]{standalone}
\begin{document}
\pspicture(8.7,6)
\psellipse[linewidth=3mm,linecolor=red](4,3)(4,3)
\psellipse*[origin={0.17,0},linecolor=white](4,3)(3.8,2.9)
\psellipse[linewidth=2mm,linecolor=red](8.45,3)(0.25,0.7)
\psellipse*[origin={-0.05,0},linecolor=white](8.45,3)(0.22,0.52)
\endpspicture
\end{document}