如何将两张 pspictures 对齐在一行上,将第三张 pspictures 对齐在第二行上

如何将两张 pspictures 对齐在一行上,将第三张 pspictures 对齐在第二行上

我怎样才能对齐这三个图片,使得前两个图片在同一行,而第三个图片在它们下面,左对齐?

这是我当前的代码:

\begin{figure}[ht!]
\psscalebox{1.0 1.0} % Change this value to rescale the drawing.
{
\begin{pspicture}(0,-2.425)(4.9971156,2.425)
\definecolor{colour0}{rgb}{1.0,0.0,0.2}
\psline[linecolor=colour0, linewidth=0.05, arrowsize=0.0529cm         3.28,arrowlength=1.44,arrowinset=0.0]{->}(0.09855774,0.0)(0.09855774,-1.6) (0.09855774,-0.8)
\psline[linecolor=colour0, linewidth=0.05](0.09855774,-1.6)(1.6985577,-1.6)(1.6985577,-0.8)
\psline[linecolor=colour0, linewidth=0.05](4.8985577,1.6)(3.2985578,1.6)(3.2985578,1.6)
\psline[linecolor=colour0, linewidth=0.05](3.2985578,-0.8)(3.2985578,-1.6)
\psline[linecolor=colour0, linewidth=0.05](3.2985578,-1.6)(4.8985577,-1.6)
\psline[linecolor=colour0, linewidth=0.05](3.2985578,1.6)(3.2985578,0.8)
\psline[linecolor=colour0, linewidth=0.05](1.6985577,0.8)(1.6985577,1.6)
\psline[linecolor=colour0, linewidth=0.05, arrowsize=0.0529cm 3.28,arrowlength=1.44,arrowinset=0.0]{->}(1.6985577,0.8)(3.2985578,0.8)(2.4985578,0.8)
\psline[linecolor=colour0, linewidth=0.05, arrowsize=0.0529cm 3.28,arrowlength=1.44,arrowinset=0.0]{->}(4.8985577,1.6)(4.8985577,0.0)(4.8985577,0.8)
\psline[linecolor=colour0, linewidth=0.05, arrowsize=0.0529cm 3.28,arrowlength=1.44,arrowinset=0.0]{->}(4.8985577,-1.6)(4.8985577,0.0)(4.8985577,-0.8)
\psline[linecolor=colour0, linewidth=0.05, arrowsize=0.0529cm 3.28,arrowlength=1.44,arrowinset=0.0]{->}(1.6985577,-0.8)(3.2985578,-0.8)(2.4985578,-0.8)
\psline[linecolor=black, linewidth=0.05](1.6985577,-1.6)(1.6985577,-2.4)
\psline[linecolor=black, linewidth=0.05](3.2985578,-1.6)(3.2985578,-2.4)
\psline[linecolor=black, linewidth=0.05](3.2985578,1.6)(3.2985578,2.4)
\psline[linecolor=black, linewidth=0.05](1.6985577,1.6)(1.6985577,2.4)
\psline[linecolor=black, linewidth=0.05](1.6985577,1.6)(0.09855774,1.6)
\psline[linecolor=black, linewidth=0.05, arrowsize=0.0529cm 3.28,arrowlength=1.44,arrowinset=0.0]{->}(3.2985578,-2.4)(1.6985577,-2.4)(2.4985578,-2.4)
\psline[linecolor=black, linewidth=0.05, arrowsize=0.0529cm 3.282,arrowlength=1.44,arrowinset=0.0]{->}(4.8985577,0.0)(0.09855774,0.0)(3.6985579,0.0)
\psline[linecolor=black, linewidth=0.05, arrowsize=0.0529cm 3.28,arrowlength=1.44,arrowinset=0.0]{->}(0.09855774,0.0)(0.09855774,1.6)(0.09855774,0.8)
\psline[linecolor=black, linewidth=0.05, arrowsize=0.0529cm 3.28,arrowlength=1.44,arrowinset=0.0]{->}(1.6985577,2.4)(3.2985578,2.4)(2.4985578,2.4)
\psdots[linecolor=black, dotsize=0.2](3.2985578,1.6)
\psdots[linecolor=black, dotsize=0.2](4.8985577,0.0)
\psdots[linecolor=black, dotsize=0.2](0.09855774,0.0)
\psdots[linecolor=black, dotsize=0.2](1.6985577,-1.6)
\psdots[linecolor=black, dotsize=0.2](3.2985578,-1.6)
\psdots[linecolor=black, dotsize=0.2](1.6985577,1.6)
\end{pspicture}
}

\psscalebox{1.0 1.0} % Change this value to rescale the drawing.
{
\begin{pspicture}(0,-3.145)(7.11,3.145)
\definecolor{colour0}{rgb}{1.0,0.0,0.2}
\psline[linecolor=colour0, linewidth=0.05, arrowsize=0.0529cm   3.28,arrowlength=1.44,arrowinset=0.0]{->}(1.6,0.055)(1.6,-1.545)(1.6,-0.745)
\psline[linecolor=colour0, linewidth=0.05](1.6,-1.545)(3.2,-1.545)(3.2,-0.745)
\psline[linecolor=colour0, linewidth=0.05](6.4,1.655)(4.8,1.655)(4.8,1.655)
\psline[linecolor=colour0, linewidth=0.05](4.8,-0.745)(4.8,-1.545)
\psline[linecolor=colour0, linewidth=0.05](4.8,-1.545)(6.4,-1.545)
\psline[linecolor=colour0, linewidth=0.05](4.8,1.655)(4.8,0.855)
\psline[linecolor=colour0, linewidth=0.05](3.2,0.855)(3.2,1.655)
\psline[linecolor=colour0, linewidth=0.05, arrowsize=0.0529cm 3.28,arrowlength=1.44,arrowinset=0.0]{->}(3.2,0.855)(4.8,0.855)(4.0,0.855)
\psline[linecolor=colour0, linewidth=0.05, arrowsize=0.0529cm 3.28,arrowlength=1.44,arrowinset=0.0]{->}(6.4,1.655)(6.4,0.055)(6.4,0.855)
\psline[linecolor=colour0, linewidth=0.05, arrowsize=0.0529cm 3.28,arrowlength=1.44,arrowinset=0.0]{->}(6.4,-1.545)(6.4,0.055)(6.4,-0.745)
\psline[linecolor=colour0, linewidth=0.05, arrowsize=0.0529cm 3.28,arrowlength=1.44,arrowinset=0.0]{->}(3.2,-0.745)(4.8,-0.745)(4.0,-0.745)
\psline[linecolor=black, linewidth=0.05](3.2,-1.545)(3.2,-2.345)
\psline[linecolor=black, linewidth=0.05](4.8,-1.545)(4.8,-2.345)
\psline[linecolor=black, linewidth=0.05](4.8,1.655)(4.8,2.455)
\psline[linecolor=black, linewidth=0.05](3.2,1.655)(3.2,2.455)
\psline[linecolor=black, linewidth=0.05](3.2,1.655)(1.6,1.655)
\psline[linecolor=black, linewidth=0.05, arrowsize=0.0529cm 3.28 ,arrowlength=1.44,arrowinset=0.0]{->}(4.8,-2.345)(3.2,-2.345)(4.0,-2.345)
\psline[linecolor=black, linewidth=0.05, arrowsize=0.0529cm 3.28 ,arrowlength=1.44,arrowinset=0.0]{->}(6.4,0.055)(1.6,0.055)(5.2,0.055)
\psline[linecolor=black, linewidth=0.05, arrowsize=0.0529cm 3.28 ,arrowlength=1.44,arrowinset=0.0]{->}(1.6,0.055)(1.6,1.655)(1.6,0.855)
\psline[linecolor=black, linewidth=0.05, arrowsize=0.0529cm 3.28 ,arrowlength=1.44,arrowinset=0.0]{->}(3.2,2.455)(4.8,2.455)(4.0,2.455)
\psdots[linecolor=black, dotsize=0.2](4.8,1.655)
\psdots[linecolor=black, dotsize=0.2](6.4,0.055)
\psdots[linecolor=black, dotsize=0.2](1.6,0.055)
\psdots[linecolor=black, dotsize=0.2](3.2,-1.545)
\psdots[linecolor=black, dotsize=0.2](4.8,-1.545)
\psdots[linecolor=black, dotsize=0.2](3.2,1.655)
\rput[bl](0.0,0.855){$I_1$=5 A}
\rput[bl](0.8,-0.745){$I_2$}
\rput[bl](3.6,-3.145){$I_4$=5 A}
\rput[bl](3.6,2.855){$I_7$=5 A}
\rput[bl](2.0,0.455){$I_9$=20 A}
\rput[bl](6.8,0.855){$I_6$}
\rput[bl](6.8,-0.745){$I_5$}
\rput[bl](3.6,-1.145){$I_3$}
\rput[bl](3.6,1.255){$I_8$}
\end{pspicture}
}



    \psscalebox{1.0 1.0} % Change this value to rescale the drawing.
{
\begin{pspicture}(0,-3.145)(9.14,3.145)
\definecolor{colour0}{rgb}{1.0,0.0,0.2}
\psline[linecolor=colour0, linewidth=0.05, arrowsize=0.05291cm 3.28,arrowlength=1.44,arrowinset=0.0]{->}(2.0,0.055)(2.0,-1.545)(2.0,-0.745)
\psline[linecolor=colour0, linewidth=0.05](2.0,-1.545)(3.6,-1.545)(3.6,-0.745)
\psline[linecolor=colour0, linewidth=0.05](6.8,1.655)(5.2,1.655)(5.2,1.655)
\psline[linecolor=colour0, linewidth=0.05](5.2,-0.745)(5.2,-1.545)
\psline[linecolor=colour0, linewidth=0.05](5.2,-1.545)(6.8,-1.545)
\psline[linecolor=colour0, linewidth=0.05](5.2,1.655)(5.2,0.855)
\psline[linecolor=colour0, linewidth=0.05](3.6,0.855)(3.6,1.655)
\psline[linecolor=colour0, linewidth=0.05, arrowsize=0.0529cm 3.28     ,arrowlength=1.44,arrowinset=0.0]{->}(3.6,0.855)(5.2,0.855)(4.4,0.855)
\psline[linecolor=colour0, linewidth=0.05, arrowsize=0.0529cm 3.28     ,arrowlength=1.44,arrowinset=0.0]{->}(6.8,1.655)(6.8,0.055)(6.8,0.855)
\psline[linecolor=colour0, linewidth=0.05, arrowsize=0.0529cm 3.28 ,arrowlength=1.44,arrowinset=0.0]{->}(6.8,-1.545)(6.8,0.055)(6.8,-0.745)
\psline[linecolor=colour0, linewidth=0.05, arrowsize=0.0529cm 3.28 ,arrowlength=1.44,arrowinset=0.0]{->}(3.6,-0.745)(5.2,-0.745)(4.4,-0.745)
\psline[linecolor=black, linewidth=0.05](3.6,-1.545)(3.6,-2.345)
\psline[linecolor=black, linewidth=0.05](5.2,-1.545)(5.2,-2.345)
\psline[linecolor=black, linewidth=0.05](5.2,1.655)(5.2,2.455)
\psline[linecolor=black, linewidth=0.05](3.6,1.655)(3.6,2.455)
\psline[linecolor=black, linewidth=0.05](3.6,1.655)(2.0,1.655)
\psline[linecolor=black, linewidth=0.05, arrowsize=0.0529cm 3.28 ,arrowlength=1.44,arrowinset=0.0]{->}(5.2,-2.345)(3.6,-2.345)(4.4,-2.345)
\psline[linecolor=black, linewidth=0.05, arrowsize=0.0529cm 3.28 ,arrowlength=1.44,arrowinset=0.0]{->}(6.8,0.055)(2.0,0.055)(5.6,0.055)
\psline[linecolor=black, linewidth=0.05, arrowsize=0.0529cm 3.28 ,arrowlength=1.44,arrowinset=0.0]{->}(2.0,0.055)(2.0,1.655)(2.0,0.855)
\psline[linecolor=black, linewidth=0.05, arrowsize=0.0529cm 3.28 ,arrowlength=1.44,arrowinset=0.0]{->}(3.6,2.455)(5.2,2.455)(4.4,2.455)
\psdots[linecolor=black, dotsize=0.2](5.2,1.655)
\psdots[linecolor=black, dotsize=0.2](6.8,0.055)
\psdots[linecolor=black, dotsize=0.2](2.0,0.055)
\psdots[linecolor=black, dotsize=0.2](3.6,-1.545)
\psdots[linecolor=black, dotsize=0.2](5.2,-1.545)
\psdots[linecolor=black, dotsize=0.2](3.6,1.655)
\rput[bl](0.0,-0.745){$U_2=-100V$}
\rput(4.0,-0.345){$U_3=-150V$}
\rput[bl](7.2,-0.745){$U_4=-100V$}
\rput[bl](7.2,0.455){$U_6=100V$}
\rput[bl](3.6,0.855){$U_8=50V$}
\rput[bl](4.0,2.855){$U_7$}
\rput[bl](4.0,-3.145){$U_4$}
\rput[bl](0.4,0.855){$U_1$}
\rput[bl](2.4,0.455){$U_9$}
\end{pspicture}
}
    \caption{Graful initial, cel de curenti si cel de tensiuni}
    \end{figure}

答案1

我编译了您的代码,并认为重写它会更简单,而不必使用提供的过多坐标值LatexDraw(7 位小数!)。对于不同图形的对齐,我使用了包subfigure中的环境subcaption

您可以相对轻松地根据自己的需要进行调整,但这\psscalebox并不实用,因为只需更改单位值即可。通过缩放的主要缺点\'(ps)scalebox是它还会缩放图形中的文本。有关此处使用的命令的任何详细信息,请参阅 的文档pst-node

\documentclass[pdf, a4paper, x11names]{article}
\usepackage{geometry}
\usepackage{pstricks-add}
\usepackage{subcaption}
\usepackage{siunitx}

\definecolor{colour0}{rgb}{1.0,0.0,0.2}

\begin{document}

\begin{figure}[!ht]
    \footnotesize
    \psset{unit=1.333,linewidth=0.05, arrowsize=0.0529cm 3.28, arrowlength=1.44, arrowinset=0,dotsize=0.2,
        colsep=1.5, rowsep=1.2, linearc=0.05, ArrowInsidePos =0.52}
    \begin{subfigure}{0.45\textwidth}
        \begin{pspicture}(-.5,-3)(5,5)
            \begin{psmatrix}%
                [name=A0] {} & [name=A1] & [name=A2] & [name=A3]\\
                [name=B0] & & & [name=B3] \\
                [name=C0] & [name=C1] & [name=C2] & [name=C3]
            \end{psmatrix}
            \psset{linecolor=colour0}
            \ncbar[angle=-90, armA=0.6, ArrowInside=->]{A2}{A1}
            \ncangle[angleA=90, angleB=180]{B3}{A2}\nbput[npos=1]{$I_1 =\SI{5}{\A}$}
            \ncangle[angleA=90, angleB=180]{B3}{C2}
            \ncbar[angle=90, armA=0.6]{C2}{C1}
            \ncangle[angleA=180, angleB=-90]{C1}{B0}
            %% Add arrows
            \psset{arrows=-, linestyle=none, ArrowInside=->, ArrowInsidePos =0.52}
            \ncline[offset = 0.6]{A2}{A1}
            \ncline[offset = -0.6]{C2}{C1}
            \ncline{B3}{A3}
            \ncline{B3}{C3}
            \ncline{C0}{B0}%
            %% Black lines
            \psset{linestyle=solid, linecolor=black, arrows=*-*, ArrowInside=->}%
            \ncbar[angle=90, armA=0.6]{A2}{A1}\nbput{\color{white}$ I_ 7$}
            \ncangle[nodesep=0pt, angleA=90, angleB=180]{B0}{A1}
            \ncline[ArrowInsidePos=0.8]{B0}{B3}
            \ncbar[angle=-90, armA=0.6]{C1}{C2}\nbput{\color{white}$ I_4 $}
            %% Add arrows
            \psset{arrows=-, linestyle=none}
            \ncline[offset = -0.6]{A2}{A1}
            \ncline[offset = 0.6]{C2}{C1}
            \ncline{A0}{B0}
        \end{pspicture}
        \caption{A first figure}\label{1st}
    \end{subfigure}
    %%%%%%%%%%%%%%%%%%%
    \hfill
    %%%%%%%%%%%%%%%%%%%
    \begin{subfigure}{0.45\textwidth}
        \begin{pspicture}(-.5,-3)(5,5)
            \begin{psmatrix}%
                [name=A0] {} & [name=A1] & [name=A2] & [name=A3]\\
                [name=B0] & & & [name=B3] \\
                [name=C0] & [name=C1] & [name=C2] & [name=C3]
                %%%%%%%%%%%%%%%%%%%%
                \psset{linecolor=colour0}
                \ncbar[angle=-90, armA=0.6, ArrowInside=->]{A2}{A1}\nbput[npos = 1.7]{$I_8$}
                \ncangle[angleA=90, angleB=180,]{B3}{A2}\nbput[npos=0.5]{$ I_6\quad U_1 $}
                \ncangle[angleA=90, angleB=180,]{B3}{C2}\naput[npos=0.5]{$ I_5\quad U_2=\SI{-100}{\V}$}
                \ncbar[angle=90, armA=0.6]{C2}{C1}\naput[npos=1.7]{$I_3$}
                \ncangle[angleA=180, angleB=-90]{C1}{B0}\naput{$ I_2 $}
                % Add arrows
                \psset{arrows=-, linestyle=none, ArrowInside=->, ArrowInsidePos=0.52}
                \ncline[offset = 0.6]{A2}{A1}
                \ncline[offset = -0.6]{C2}{C1}
                \ncline{B3}{A3}
                \ncline{B3}{C3}
                \ncline{C0}{B0}%
                % Black lines
                \psset{linestyle=solid, linecolor=black, arrows=*-*, ArrowInside=->}%
                \ncbar[angle=90, armA=0.6]{A2}{A1}\nbput{$ I_7=\SI{5}{\A} $}%
                \ncangle[angleA=180, angleB=90]{A1}{B0}\naput[npos=1.8]{$ I_9=\SI{20}{\A} $}
                \ncline[ArrowInsidePos=0.8]{B0}{B3}\nbput{ $U_3 =-\SI{150}{\V}$}
                \ncbar[angle=-90, armA=0.6]{C1}{C2}\nbput{$ I_4=\SI{5}{\A}$}
                % Add arrows
                \psset{arrows=-, linestyle=none}
                \ncline[offset = -0.6]{A2}{A1}
                \ncline[offset = -0.6]{C1}{C2}
                \ncline{A0}{B0}
            \end{psmatrix}
        \end{pspicture}
        \caption{A second figure}\label{2nd}
    \end{subfigure}
    %%%%%%%%%%%%%%%%%%%%%%%%%%%
    \\[2\baselineskip]
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%
    \begin{subfigure}{0.45\textwidth}
        \begin{pspicture}(-.5,-3)(5,5)
            \begin{psmatrix}%[mnode=dot]
                [name=A0] {} & [name=A1] & [name=A2] & [name=A3]\\
                [name=B0] & & & [name=B3] \\
                [name=C0] & [name=C1] & [name=C2] & [name=C3]
            \end{psmatrix}
            \psset{linecolor=colour0}
            \ncbar[angle=-90, armA=0.6, ArrowInside=->]{A2}{A1}\nbput{$U_8 = \SI{50}{\V}$}
            \ncangle[angleA=90, angleB=180,]{B3}{A2}\nbput[npos=0.5]{$U_6 =\SI{100}{\V}$}
            \ncangle[angleA=90, angleB=180,]{B3}{C2}\naput[npos=0.5]{$U_4$}
            \ncbar[angle=90, armA=0.6]{C1}{C2}
            \ncangle[angleA=180, angleB=-90]{C1}{B0}
            %% Add arrows
            \psset{arrows=-, linestyle=none, ArrowInside=->, ArrowInsidePos =0.52}
            \ncline[offset = 0.6]{A2}{A1}
            \ncline[offset = -0.6]{C2}{C1}
            \ncline{B3}{A3}
            \ncline{B3}{C3}
            \ncline{C0}{B0}%
            %% Black lines
            \psset{linestyle=solid, linecolor=black, arrows=*-*, ArrowInside=->}%
            \ncbar[angle=90, armA=0.6]{A2}{A1}\nbput{$U_7$}
            \ncangle[angleA=180, angleB=90]{A1}{B0}\naput[npos=1.8]{$U_9$}
            \ncline[ArrowInsidePos=0.8]{B0}{B3}
            \ncbar[angle=-90, armA=0.6]{C1}{C2}\nbput{$U_4$}
            %% Add arrows
            \psset{arrows=-, linestyle=none}
            \ncline[offset=-0.6]{A2}{A1}
            \ncline[offset= -0.6]{C1}{C2}
            \ncline{A0}{B0}
        \end{pspicture}
        \caption{A third figure}\label{3rd}
    \end{subfigure}
    \caption{Graful initial, cel de curenti si cel de tensiuni}
\end{figure}

\end{document} 

在此处输入图片描述

相关内容