[pstricks] Two plots with common axis in one subfigure

Joel J. Adamson <adamsonj@email.unc.edu> adamsonj at email.unc.edu
Tue Apr 21 18:01:20 CEST 2009

>>>>> "Michael" == Michael Sharpe <msharpe at ucsd.edu> writes:

    > If you use \psframebox around each pspicture, you can see how the
    > bounding boxes are aligned. (See code below.) In your example,
    > they have different horizontal sizes. If you want them vertically
    > aligned, make the pspicture widths the same. If you want to have
    > the labels on the top picture not run into the picture below,
    > decrease the top pspicture ymin value.

Thanks for getting back to me: I figured out a way to do it, but I will
definitely take your suggestions to make it even better.

Here's my current solution:

% \usepackage[round]{natbib}
% \usepackage{palatino}
% \usepackage{helvet}
% line numbers:



  \centering\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 for panel (b)

    {    \psset{yunit=2cm,xunit=1}

      % panel a:

      % mating success as a function of age
        % y axis label
        \rput[b]{90}(-0.5,1){Mating Success}
        % axes
        \psaxes[labels = none, ticks = none](6,2)
        % first line: early--fast-developing males
        % second line: late-and-fast-developing males
        \psline[linestyle = dashed]{-}(3.5,0)(6,2)
        % ages at maturity
        % early:
        % later:
      % age distribution
        % y axis label
        \rput[b]{90}(-0.5,0.4){P\{age = x\}}
        % age distribution:
        \psbarchart[chartstyle = cluster,
        barcolsep = 0,
        barsep = 0,
        barstyle = {gray},
        showpoints = false]{\mydata}
        % id like to get rid of the axis numbers

    % panel b

    % label for panel (b)
      % label

      {\psset{yunit = 8cm}
        % y-axis label
        % x-axis label
        \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}


Joel J. Adamson	-- http://www.unc.edu/~adamsonj
University of North Carolina at Chapel Hill
CB #3280, Coker Hall
Chapel Hill, NC 27599-3280

More information about the PSTricks mailing list