我的尝试-
\documentclass{article}
\usepackage[usenames,dvipsnames]{pstricks}
\usepackage{pstricks-add}
\usepackage{epsfig}
\usepackage{pst-grad} % For gradients
\usepackage{pst-plot} % For axes
\usepackage[space]{grffile} % For spaces in paths
\usepackage{etoolbox} % For spaces in paths
\makeatletter % For spaces in paths
\patchcmd\Gread@eps{\@inputcheck#1 }{\@inputcheck"#1"\relax}{}{}
\makeatother
\begin{figure}[t]
\begin{center}
\psscalebox{0.5 0.5} % Change this value to rescale the drawing.
{
\begin{pspicture}(0,-5.677559)(12.57659,2.6669903)
\psrotate(2.7260337, 0.3329967){-38.651867}{\psellipse[linecolor=black, linewidth=0.04, dimen=outer](2.7260337,0.33299673)(3.3083334,1.3883333)}
\psrotate(1.1277003, 1.5757744){7.4958577}{\psdots[linecolor=black, dotsize=0.8378179](1.1277003,1.5757744)}
\psdots[linecolor=black, dotsize=0.8](2.585478,0.40244114)
\psdots[linecolor=black, dotsize=0.8](4.1499224,-0.8420033)
\psellipse[linecolor=black, linewidth=0.04, dimen=outer](6.994367,-0.80867)(3.6977777,1.2588888)
\psdots[linecolor=black, dotsize=0.8](6.8521447,-0.7708922)
\psdots[linecolor=black, dotsize=0.8](9.056589,-0.69978106)
\psellipse[linecolor=black, linewidth=0.04, dimen=outer](6.9232564,-2.6731143)(1.2444445,3.0044444)
\psdots[linecolor=black, dotsize=0.8](6.745478,-2.619781)
\psdots[linecolor=black, dotsize=0.8](6.7810335,-4.1131144)
\psellipse[linecolor=black, linewidth=0.04, dimen=outer](9.234367,-4.2197814)(3.3422222,1.0311111)
\psdots[linecolor=black, dotsize=0.8](9.234367,-4.219781)
\psdots[linecolor=black, dotsize=0.8](11.225478,-4.219781)
\end{pspicture}
}
\end{center}
\label{dot}
\end{figure}
但是它没有给出任何结果。如果可能的话,有人可以解释一下或给出示例代码吗?我也可以使用 tikz。
答案1
欢迎来到 TeX.SE!!!
这可以在 Ti 中轻松完成钾Z\pic
为带有三个点的椭圆定义一个。我们可以添加一个参数,将一个点移到\pic
一个点或另一个点,然后定位就很简单了。
像这样:
\documentclass[tikz,border=2mm]{standalone}
\tikzset
{%
pics/my ellipse/.style={% #1 --> shift to node (1,2,3)
code={%
\begin{scope}[shift={(1.5*#1-3,0)}]
\draw (0,0) ellipse (2.5cm and 0.75cm);
\foreach\i in {1,2,3}
\fill (1.5*\i-3,0) circle (0.5) node (-\i) {};
\end{scope}
}},
pics/my ellipse/.default={2},
}
\begin{document}
\begin{tikzpicture}
\pic (A) at (0,0) {my ellipse};
\pic[rotate= 90] (B) at (A-2) {my ellipse=1};
\pic (C) at (B-1) {my ellipse=3};
\pic[rotate=300] (D) at (A-1) {my ellipse=1};
\end{tikzpicture}
\end{document}
答案2
使用 lualatex 运行直接获取 pdf:
\documentclass{article}
\usepackage[usenames,dvipsnames]{pstricks}
\def\EllipseAndDots(#1)#2{%
\rput{#2}(#1){\psellipse(0,0)(2.75,1)\psdots[dotsize=0.8](-1.5,0)(0,0)(1.5,0)}}
\begin{document}
\begin{pspicture}[showgrid=false](2,-5)(11.5,2.5)
\EllipseAndDots(7,-0.75){0}%
\EllipseAndDots(7,-2.25){90}%
\EllipseAndDots(8.5,-3.75){0}%
\EllipseAndDots(4.44,0.31){135}%
\end{pspicture}
\end{document}
或者使用更简单的坐标:
\begin{pspicture}[showgrid=true](-5,-5)(5,3)
\EllipseAndDots(0,0){0}%
\EllipseAndDots(0,-1.5){90}%
\EllipseAndDots(1.5,-3){0}%
\EllipseAndDots(-2.56,1.06){135}%
\end{pspicture}
1.06 = 0.75*sqrt(2)
(余弦)