Graphics, Figures & TablesFigure alignment

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
coachbennett1981
Posts: 274
Joined: Fri Feb 05, 2010 10:15 pm

Figure alignment

Post by coachbennett1981 »

Is there a way to align these four figures in two columns without adjusting the size of the box for \pspicture?

Thank you for your help
Nick

Code: Select all

\documentclass[12pt]{exam}
\usepackage{geometry}                % See geometry.pdf to learn the layout options. There are lots.
\geometry{letterpaper}                   % ... or a4paper or a5paper or ... 
%\geometry{landscape}                % Activate for for rotated page geometry
%\usepackage[parfill]{parskip}    % Activate to begin paragraphs with an empty line rather than an indent
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{multicol}
\usepackage{amsmath}
\usepackage{pstricks}
\usepackage{subfigure}
\usepackage{pst-plot}
\usepackage{pst-func}
\usepackage{pstricks-add}

\begin{document}

\section*{Match the graph with appropriate Label}

\psset{unit=.5cm}
\begin{pspicture}(0,-3)(5,6)
\psaxes[labels=none,ticks=none]{<->}(0,0)(-6,-6)(6,6)[$x$,-90][$y$,180]
\psplot[plotstyle=curve,linecolor=red, arrows=<->,linewidth=1.5pt]{-2}{2}{2 x exp}
\end{pspicture}

\begin{pspicture}(-14,-3)(5,-5)
\psaxes[labels=none,ticks=none]{<->}(0,0)(-6,-6)(6,6)[$x$,-90][$y$,180]
\psplot[algebraic,linecolor=red, arrows=<->,linewidth=1.5pt]{2.05}{7}{ln(x-2)/ln(2)}
\end{pspicture}

\begin{pspicture}(0,-3)(5,15)
\psaxes[labels=none,ticks=none]{<->}(0,0)(-6,-6)(6,6)[$x$,-90][$y$,180]
\psplot[plotstyle=curve,linecolor=red, arrows=<->,linewidth=1.5pt]{-2}{4}{x 2 exp 2 x mul sub}
\end{pspicture}

\begin{pspicture}(-14,0)(5,-15)
\psaxes[labels=none,ticks=none]{<->}(0,0)(-6,-6)(6,6)[$x$,-90][$y$,180]
\psplot[plotstyle=curve,linecolor=red, arrows=<->,linewidth=1.5pt]{2.4}{6}{3 x 2 sub div 3 add}
\psplot[plotstyle=curve,linecolor=red, arrows=<->,linewidth=1.5pt]{-4}{1.6}{3 x 2 sub div 3 add}
\end{pspicture}

\end{document}
Last edited by coachbennett1981 on Tue Jan 11, 2011 7:52 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Figure alignment

Post by localghost »

You should learn how to reserve the right amount of space for the pspicture environment.

Code: Select all

\documentclass[12pt,letterpaper]{exam}
\usepackage{geometry}
\usepackage{pst-plot,pstricks-add}

\begin{document}
  \section*{Match the graph with appropriate Label}
    \psset{unit=.5cm}
    \begin{pspicture}[showgrid=false](-6,-6)(7,6)
      \psaxes[labels=none,ticks=none]{<->}(0,0)(-6,-6)(6,6)[$x$,-90][$y$,180]
      \psplot[algebraic,linecolor=red,arrows=<->,linewidth=1.5pt]{-2}{2}{2^x}
    \end{pspicture}
    \begin{pspicture}[showgrid=false](-6,-6)(7,6)
      \psaxes[labels=none,ticks=none]{<->}(0,0)(-6,-6)(6,6)[$x$,-90][$y$,180]
      \psplot[algebraic,linecolor=red,arrows=<->,linewidth=1.5pt]{2.05}{7}{ln(x-2)/ln(2)}
    \end{pspicture}

    \noindent
    \begin{pspicture}[showgrid=false](-6,-6)(7,11)
      \psaxes[labels=none,ticks=none]{<->}(0,0)(-6,-6)(6,6)[$x$,-90][$y$,180]
      \psplot[algebraic,linecolor=red,arrows=<->,linewidth=1.5pt]{-2}{4}{x^2-2*x}
    \end{pspicture}
    \begin{pspicture}[showgrid=false](-6,-6)(7,11)
      \psaxes[labels=none,ticks=none]{<->}(0,0)(-6,-6)(6,6)[$x$,-90][$y$,180]
      \psplot[algebraic,linecolor=red,arrows=<->,linewidth=1.5pt]{2.4}{6}{3/(x-2)+3}
      \psplot[algebraic,linecolor=red,arrows=<->,linewidth=1.5pt]{-4}{1.6}{3/(x-2)+3}
    \end{pspicture}
\end{document}
And please get used to providing a minimal example cleaned up from superfluous packages.


Thorsten
coachbennett1981
Posts: 274
Joined: Fri Feb 05, 2010 10:15 pm

Re: Figure alignment

Post by coachbennett1981 »

Thanks for the help.
Post Reply