[pstricks] Two plots with common axis in one subfigure

Herbert Voss Herbert.Voss at FU-Berlin.DE
Thu Apr 23 17:04:01 CEST 2009


Joel J. Adamson <adamsonj at email.unc.edu> schrieb:

> 
> Here it is:
> 
> 1,2,3,4,5,6
> 0.633691323, 0.233122010, 0.085760795, 0.031549633, 0.011606461, 0.004269779
> 
> I've gotten things to work well using the subfig package, but I will
> take additional suggestions.

use minipages and seperate pspicture environments, makes live easier ...

Herbert

\documentclass[preprint]{aastex}
\usepackage{pst-plot}
\usepackage{pst-func}
\usepackage{pst-bar}
\usepackage{filecontents}
\begin{filecontents*}{data.txt}
 1,2,3,4,5,6
0.633691323, 0.233122010, 0.085760795, 0.031549633, 0.011606461, 0.004269779
\end{filecontents*}

\begin{document}
\begin{figure}
\sffamily
\caption{(a) Two competing mating success functions of
    male age.  Males that mature at $\alpha_1$ mature at the same rate
    as males that mature at age $\alpha_2$, producing higher mean
    mating success in offspring of $\alpha_1$-males
(b)}\label{fig:bimaturism}
\medskip
\begin{minipage}[t]{0.46\linewidth}
 (a)\label{fig:bimaturism-a}\\
 \begin{pspicture}(-0.5,-0.5)(8,4.5)
   \psset{yunit=2cm,xunit=1}
   \rput[b]{0}(0.5,0){\rput[b]{90}(-0.5,1){Mating Success}
   \psaxes[labels = none, ticks = none](6,2)
   \psline{-}(1.5,0)(4,2)
   \psline[linestyle = dashed]{-}(3.5,0)(6,2)
   \rput(1.5,-0.25){$\alpha_1$}
   \rput(3.5,-0.25){$\alpha_2$}}
 \end{pspicture}\\
 \begin{pspicture}(-1,-0.5)(7,1)
   \rput[b]{90}(-0.5,0.4){P\{age = x\}}
   \readpsbardata{\mydata}{data.txt}
   \psbarchart[chartstyle = cluster,
      barcolsep=0,barsep=0,barstyle={gray},showpoints=false]{\mydata}
 \end{pspicture}
\end{minipage}\hfill
\begin{minipage}[t]{0.53\linewidth}
  (b)\label{fig:bimaturism-b}\\
 \begin{pspicture}(-0.5,-0.5)(8,4.5)
   \psset{yunit = 8cm}
   \rput{90}(-0.5,0.25){Frequency}
   \rput{0}(4,-0.0625){Breeding Value of Mating Success}
   \psaxes[labels=none,ticks=none](5,0.5)
   \psGauss[mue=1.5, sigma=1.5]{0}{8}
   \psGauss[linestyle = dashed, mue = 0.5, sigma = 1]{0}{8}
 \end{pspicture}
\end{minipage}
\end{figure}

\end{document}




More information about the PSTricks mailing list