Re: [Matplotlib-users] Problem with matplotlib and pdflatex

2008-03-24 Thread Alex Coventry

> I believe I have fixed the problem in the latest svn versions, both on
> the maintenance branch and on the trunk. Please try the latest version

Thanks for your help, Jouni.  That seems to have fixed the problem.

Best,
Alex

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Problem with matplotlib and pdflatex

2008-03-22 Thread Jouni . Seppanen
Alex Coventry <[EMAIL PROTECTED]> writes:

> I'm trying to use some matplotlib-generated pdfs in a pdflatex document,
> and seeing some extremely weird and disruptive size effects.  

Could you be more specific about what the problem seems to be? I looked
at your pdf files, and it looks like pdflatex is taking your eight-inch
wide figure (including the margins) and scaling it to 6 in. The space
between the margins is about 4.8 in, so of course the figure doesn't
fit, and because it has empty margins on every side, it kind of looks
like it has been translated away from where it belongs. If this is not
what you are seeing, could you post a screenshot from your pdf viewer?

Do you mean to ask how you can make the figure take up exactly the space
between the margins in your document? In that case my recommendation is
to build up the figure to the correct width from the start, e.g.
figure(figsize=(4.8,4.8)) or whatever the correct size is, and avoid
doing any kind of resizing with \includegraphics. Create your axes
explicitly instead of relying on the default (which reserves ample
margins on every side in case you want to put a title on top, etc).
Start with something like axes([0.1,0.1,0.9,0.9]) -- the numbers are
left, bottom, width, height, so to remove the margin on the right make
sure left+width=1.0. You will have to tweak this to make just enough
room for your axis labels.

> If I generate postscript files with matplotlib and convert
> them to pdfs, I don't get this problem.

Probably some step in this pipeline recomputes the bounding box for the
figure from the ink on the page, so the margins disappear.

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Problem with matplotlib and pdflatex

2008-03-21 Thread Alex Coventry

I'm trying to use some matplotlib-generated pdfs in a pdflatex document,
and seeing some extremely weird and disruptive size effects.  The
resulting pdfs can be seen at

http://research.janelia.org/coventry/paper.pdf
http://research.janelia.org/coventry/paper-small.pdf

The first results from the code 

\begin{figure}
  \centering
  \subfigure[Prior distribution]{\label{fig:prior-graph}
\includegraphics[width=6in]{prior-example}
  }
  \subfigure[Posterior distribution]{\label{fig:posterior-graph}
\includegraphics[width=6in]{posterior-example}
  }
\end{figure}

and the second from the same code with "width=5cm".  The two pdfs I'm
trying to include are at 

http://research.janelia.org/coventry/prior-example.pdf and
http://research.janelia.org/coventry/posterior-example.pdf

It doesn't matter what order I include them in, I get the same size
effects.  If I generate postscript files with matplotlib and convert
them to pdfs, I don't get this problem.  So I have a workaround, but I
would like to know how to create usable pdfs directly, and thought
reporting this might be useful to matplotlib development.

Best,
Alex

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users