Graphics, Figures & TablesFigure alignment with PSTricks

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 with PSTricks

Post by coachbennett1981 »

I am having some formatting issues. I looked up the columnsep rule and then the addtolength from the forum, but my figure does not seem to change. I want the two graphs to in two columns with the x axes not touching. Any suggestions?

Best

Nick

Code: Select all

\documentclass[12pt]{exam}
\usepackage{multicol}
\usepackage{pstricks-add}
\begin{multicols}{2}
\addtolength{\columnsep}{-500pt}
\psset{unit=.35in}
\begin{pspicture}(0,-3)(5,3)
\psaxes{->}(0,0)(-4,-4)(5,4)[$x$,-90][$y$,180]
\psplot[plotstyle=curve,linecolor=blue,linewidth=1.5pt,arrows=<->]{-2}{3}{.45 x exp}
\end{pspicture}


\psset{unit=.35in}
\begin{pspicture}(0,-3)(5,3)
\psaxes{->}(0,0)(-4,-4)(5,4)[$x$,-90][$y$,180]
\psplot[plotstyle=curve,linecolor=blue,linewidth=1.5pt,arrows=<->]{-1.5}{3.5}{x x mul -2 x mul add}
\end{pspicture}

\end{multicols}

\end{document}
Last edited by coachbennett1981 on Tue May 18, 2010 12:26 pm, edited 1 time in total.

Recommended reading 2024:

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

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

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

Figure alignment with PSTricks

Post by localghost »

I wonder why the length \columnsep (default value 10pt) should have a negative value. As far as I know only positive values are valid for this length.

Code: Select all

\documentclass[12pt]{exam}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{geometry}
\usepackage{multicol}
\usepackage{pstricks-add}

\psset{unit=0.75cm}

\begin{document}
  \begin{multicols}{2}
    \begin{pspicture}(0,-3)(5,3)
      \psaxes{->}(0,0)(-4,-4)(5,4)[$x$,-90][$y$,180]
      \psplot[plotstyle=curve,linecolor=blue,linewidth=1.5pt,arrows=<->]{-2}{3}{.45 x exp}
    \end{pspicture}

    \begin{pspicture}(0,-3)(5,3)
      \psaxes{->}(0,0)(-4,-4)(5,4)[$x$,-90][$y$,180]
      \psplot[plotstyle=curve,linecolor=blue,linewidth=1.5pt,arrows=<->]{-1.5}{3.5}{x x mul -2 x mul add}
    \end{pspicture}
  \end{multicols}
\end{document}
The unit scale has been too high thus the graphs became to wide for one column. You can try to modify the page geometry to get wider columns.


Best regards
Thorsten
Post Reply