# pst-circ: figure and caption overlapping

I'm writing a thesis and need to get this problem solved. I just started to use pst-circ as an alternative to cirtuitikz (seemed to me like it has better documentation), however I'm kinda stuck with the caption overlapping partially the circuit.

I don't know if I should use \vspace{something}, but I was looking for a cleaner solution (if possible). I'm not really sure I used the correct encapsulation. Maybe I should use a minipage as well.

I used the following code:

\begin{figure}[H]
\begin{center}
\begin{pspicture}[showgrid=false](9,8)
\Cnode(0,0){P1} \psdot(P1) \nput[labelsep=0.25]{180}{P1}{R}
\Cnode(9,0){P2} \psdot(P2) \nput[labelsep=0.25]{0}{P2}{S}
\pnode(4,0){C}

\multidipole(P1)(C)
\coil{$L$}
\capacitor{$C$}.

\multidipole(P2)(C)
\coil{$L$}
\capacitor{$C$}.
\end{pspicture}

\caption{Filtre LC simple en configuration étoile}
\label{filtre_lc_etoile_simple}
\end{center}
\end{figure}


(ignore the text inside the caption: it doesn't make any sense at all, since this is just a truncated copy-paste from another part of the document)

I'm not sure this is really a pst-circ problem: it may be a regular figure problem (though using external PNG / PDF files as source I never got this behaviour), maybe because dimensions where specified and known.

I encapsulated between a figure because I wanted to add some caption to it.

Any suggestions?

-

You can use the shift= option for pspicture to change the baseline (default is set at the bottom of the box):

\documentclass{article}
\usepackage{pst-circ}

\begin{document}

\begin{figure}[H]
\centering
\begin{pspicture}[shift=0.5](9,8)
\Cnode(0,0){P1} \psdot(P1) \nput[labelsep=0.25]{180}{P1}{R}
\Cnode(9,0){P2} \psdot(P2) \nput[labelsep=0.25]{0}{P2}{S}
\pnode(4,0){C}

\multidipole(P1)(C)
\coil{$L$}
\capacitor{$C$}.

\multidipole(P2)(C)
\coil{$L$}
\capacitor{$C$}.
\end{pspicture}

\caption{Filtre LC simple en configuration étoile}
\label{filtre_lc_etoile_simple}
\end{figure}

\end{document}


On a side note, I used \centering instead of the center environment to avoid adding extra undesired vertical spacing.

-
Seems a good and easy solution. Sorry for my delayed reply ;) –  user51166 Apr 22 '12 at 8:03

Gonzalo's answer certainly works, however I would recommend that, in general, you take a different approach.

The general syntax for the pspicture environment is

\begin{pspicture}(xmin,ymin)(xmax,ymax)


but as you've demonstrated, you can leave off (xmin,ymin) and it will default to (0,0). This puts a single box of the given size in the document. The drawing itself will be done by postscript.

If you use \psgrid

\begin{pspicture}(9,8)
\psgrid
...


then you get

which highlights a few things

• ymin is clearly not small enough
• ymax is far too big

So, one solution is to use

\begin{pspicture}(-1,-1)(10,1)
\psgrid


which gives

and this seems a bit closer to what you want. Now that you're done constructing, you can remove \psgrid

Here's a complete MWE

\documentclass{article}
\usepackage{pst-circ}

\begin{document}

\begin{figure}[H]
\centering
\begin{pspicture}(-1,-1)(10,1)
\psgrid
\Cnode(0,0){P1} \psdot(P1) \nput[labelsep=0.25]{180}{P1}{R}
\Cnode(9,0){P2} \psdot(P2) \nput[labelsep=0.25]{0}{P2}{S}
\pnode(4,0){C}

\multidipole(P1)(C)
\coil{$L$}
\capacitor{$C$}.

\multidipole(P2)(C)
\coil{$L$}
\capacitor{$C$}.
\end{pspicture}

\caption{Filtre LC simple en configuration étoile}
\label{filtre_lc_etoile_simple}
\end{figure}

\end{document}

-
Thank you for your answer. I was hoping there was something which could be done automatically by latex, however your solution is not complicated either. Thanks again. –  user51166 Apr 22 '12 at 8:05