2

\documentclass[a4paper, 12pt, oneside]{article}

\usepackage{pst-all}
\usepackage{pstricks}
\usepackage{tikz}
\begin{center}
\begin{figure}

%\bpsp(3,2.5)
%\psgrid[subgriddiv=1,griddots=10,gridlabels=10pt](-2,0)(8,3)
\vspace{3cm}
\rput(5.7,0.25){
\psline(0,1)(2,1)
\psline[linestyle=dashed](2,1)(3,1)
\psline(3,1)(4,1)
\psdot(0,1)
\psdot(1,1)
\psdot(2,1)
\psdot(3,1)
\psdot(4,1)
\pscurve[linestyle=dotted](5.3,1.59)(5.45,1.3)(5.4,1.04)
\pscurve[linestyle=dotted](5.3,.45)(5.45,.71)(5.4,.98)
\psline(4,1)(5,0)
\psline(4,1)(5,2)
\psline(5.4,1)(4,1)
\psline(-1,2)(0,1)(-1,0)
\psdot(-1,2)
\psdot(-1,0)
\psdot(5.4,1)
\psline(5.3,.4)(4,1)(5.3,1.6)
\psline(-1.3,1.5)(0,1)(-1.3,.5)
\psdot(-1.3,1.5)
\psdot(-1.3,.5)
\pscurve[linestyle=dotted](-1.1,2)(-1.5,1)(-1.1,0)
\psdot(5.3,1.6)
\psdot(5.3,.4)
\psdot(5,0)
\psdot(5,2)
\rput(0.1,.8){$u_0$}
\rput(1,.8){$u_1$}
\rput(2,.8){$u_2$}
\rput(3.8,.8){$u_{k-s-t}$}
\rput[l](-3.5,1){$s$ vertices $\Bigg\{$}
\rput[l](5.6,1){$\Bigg\} t$ vertices}
}
%epsp
\caption{The graph $\mathcal{P}(k,s,t)$}\label{pkst}

\end{figure}
\end{center}

I am trying to scale the size of the figure. How we can do that?

  • Just a question: are the series of dots at both ends supposed to be on a circle? – Bernard Oct 13 '19 at 15:25
  • You might need \psscalebox. – Money Oriented Programmer Oct 13 '19 at 15:57
2

No need for scaling. Just use the correct image size for pspicture:

\documentclass[a4paper, 12pt, oneside]{article}
\usepackage{pst-all}
\usepackage{tikz}
\begin{document}

\begin{figure}
\centering
\begin{pspicture}[showgrid=false](-3,0)(7.5,2)
  \psline{*-*}(0,1)(2,1)\psdot(1,1)
  \psline[linestyle=dashed]{-*}(2,1)(3,1)
  \psline{-*}(3,1)(4,1)
  \psarc[linestyle=dotted](0,1){1.5}{135}{225}
  \psarc[linestyle=dotted](4,1){1.5}{-45}{45}
  \rput(0,1){\psforeach{\iA}{135,157.5,205.5,225}{\psline{-*}(1.5;\iA)}}
  \rput(4,1){\psforeach{\iA}{-45,-22.5,0,22.5,45}{\psline{-*}(1.5;\iA)}}
  \uput{10pt}[-90](0,1){$u_0$}
  \uput{10pt}[-90](1,1){$u_1$}
  \uput{10pt}[-90](2,1){$u_2$}
  \uput*{10pt}[-90](4,1){$u_{k-s-t}$}
  \rput[r](-1.5,1){$s$ vertices $\Bigg\{$}
  \rput[l](5.6,1){$\Bigg\} t$ vertices}
\end{pspicture}
\caption{The graph $\mathcal{P}(k,s,t)$}\label{pkst}
\end{figure}

\end{document}

enter image description here

  • +1 for \psforeach... – justonly Oct 14 '19 at 9:37
2

You can resize a pspicture, without resizing the text – which leads to inconsistent font sizes, using \psset{unit=...} at the beginning (the default unit is 1cm; I chose here unit=0.8cm). Here is an example. I took the opportunity to simplify your code, with a systematic use of psnodes, and the adjunction of the pst-eucl package/

    \documentclass[a4paper,, oneside]{article}

    \usepackage{pst-all, pst-eucl}

    \begin{document}

    \begin{figure}
    \psset{unit=0.8cm}
    \centering
    \begin{pspicture}(-3.5,-1.3)(7.5,1.3)
    \pstGeonode[PointName={u_0,u_1,u_2,none, u_{k-s-t},none}, PosAngle=-90](0,0){U0}(1,0){U1}(2,0){U2}(3,0){U3}(4,0){U4}(5.4,0){B0}
    \psline(U0)(U2)\psline[linestyle=dashed, dash=3pt 2pt](U2)(U3)\psline(U3)(B0)
    \foreach \ang/\i in {-50/1,-30/2,30/3,50/4}{\dotnode[PointName=none](-1.4;\ang){A\i}\AtoB(A\i)(U4){B\i} \psline(A\i)\psline[arrows=-*](U4)(B\i)}
    \pstArcOAB[linestyle=dotted]{U0}{A1}{A4}
    \pstArcOAB[linestyle=dotted]{U4}{B2}{B3}
    \pnodes[-0.8em, 0](A2){C2}(A3){C3}
    \pnodes[0.8em, 0](B2){D2}(B3){D3}
    \psset{braceWidth=1pt, braceWidthInner=3pt, braceWidthOuter=3pt}
    \psbrace[ref=rC, nodesepA=-2pt](C2)(C3){$s$ vertices}
    \psbrace[ref=lC, nodesepA= 2pt](D2)(D3){$t$ vertices}
    \end{pspicture}
    \caption{The graph $\mathcal{P}(k,s,t)$}\label{pkst}
    \end{figure}

    \end{document} 

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.