Re: [Matplotlib-users] Choosing optimal figure width/height automatically

2013-10-21 Thread Joe Kington
I just realized that I replied to this off-list. Sending back out to the
entire list. (Sorry for the duplicate e-mail Christoph!)

On Oct 18, 2013 6:11 AM, Christoph Groth christ...@grothesque.org wrote:

 Joe, thank you very much for your reply.  So the figsize of a
 matplotlib plot is the physical size of the region between the axes
 where the data is shown?


No, your first assumption was correct. figsize refers to the size of the
whole figure.

What I meant to do in that example was abuse the fact that matplotlib will
happily add things beyond the figure boundaries. You can then abuse the
bbox_inches kwarg to savefig to show everything, while keeping the size
of the data area between the axes boundaries the same as the figsize.

My example there is actually completely wrong.  I meant to do this:

import numpy as np
import matplotlib.pyplot as plt

dpi = 80
data = np.random.random((100, 100))

height, width = np.array(data.shape, dtype=float) / dpi

fig = plt.figure(figsize=(width, height), dpi=dpi)
ax = fig.add_axes([0, 0, 1, 1])

ax.imshow(data, interpolation='none')
fig.savefig('test.png', bbox_inches='tight')

At any rate, I'm not quite sure if that's actually what you wanted, but
it's a useful trick in cases like this.
--
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register 
http://pubads.g.doubleclick.net/gampad/clk?id=60135031iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] 1.3 + xkcd + latex

2013-10-21 Thread Michael Droettboom

On 10/18/2013 12:58 PM, Paulo Meira wrote:

Hi, all,
It didn't work for me with mpl 1.3 but it does with 1.3.1 (openSuse 
12.3, python 2.7.3, 64-bit).


To install 1.3.1, I had to use the archive from SourceForge directly 
since only 1.3.0 is listed on pypi (I used pip) -- could that be the 
source of this issue for you?


That's my bad.  I've updated the PyPI entry.

Mike



Regards,
Paulo Meira
---
On Fri, Oct 18, 2013 at 11:51 AM, Neal Becker ndbeck...@gmail.com 
mailto:ndbeck...@gmail.com wrote:


I am using mpl 1.3, python 2.7.3, 64-bit linux (fedora 19)

Andrew Dawson wrote:

 For what it is worth I see behaviour identical to Neal. I'm using a
 development version of matplotlib (v1.4.x, sorry I don't know
the hash of
 the installed version) on 64-bit Linux (Ubuntu 12.04) and Python
2.7.3.
 That probably doesn't help much, except to show that this is not
specific
 to just Neal!

 Andrew


 On 18 October 2013 14:40, Michael Droettboom
 md...@stsci.edu mailto:md...@stsci.edu wrote:

 This is really puzzling.  What version of matplotlib are you
running,
 what platform, and what version of Python?  Your example works
just fine
 for me.

 Mike

 On 10/18/2013 08:40 AM, Neal Becker wrote:
  Neal Becker wrote:
 
  This example shows the error on my platform - the xlabel is not
 rendered with
  tex but instead the '$' are printed:
 
  import numpy as np
  import matplotlib.pyplot as plt
  plt.xkcd()
 
  fig = fig = plt.figure()
  ax = fig.add_subplot(111)
  plt.plot (np.arange (10), 2*np.arange(10))
  ax.set_xlabel ('$E_{s}/N_{0}$')
  plt.show()
 
 
  And without plt.xkcd() the tex is rendered correctly
 
 
 


--
  October Webinars: Code for Performance
  Free Intel webinars can help you accelerate application
performance.
  Explore tips for MPI, OpenMP, advanced profiling, and more.
Get the most
 from
  the latest Intel processors and coprocessors. See abstracts
and register
 
 

http://pubads.g.doubleclick.net/gampad/clk?id=60135031iu=/4140/ostg.clktrk
  ___
  Matplotlib-users mailing list
  Matplotlib-users@lists.sourceforge.net
mailto:Matplotlib-users@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/matplotlib-users


 --
 _
 |\/|o _|_  _. _ | | \.__  __|__|_|_  _  _ ._ _
 |  ||(_| |(_|(/_| |_/|(_)(/_|_ |_|_)(_)(_)| | |

 http://www.droettboom.com





--
 October Webinars: Code for Performance
 Free Intel webinars can help you accelerate application
performance.
 Explore tips for MPI, OpenMP, advanced profiling, and more. Get
the most
 from
 the latest Intel processors and coprocessors. See abstracts and
register 

http://pubads.g.doubleclick.net/gampad/clk?id=60135031iu=/4140/ostg.clktrk
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
mailto:Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users








--
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get
the most from
the latest Intel processors and coprocessors. See abstracts and
register 
http://pubads.g.doubleclick.net/gampad/clk?id=60135031iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
mailto:Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users




--
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register 
http://pubads.g.doubleclick.net/gampad/clk?id=60135031iu=/4140/ostg.clktrk


___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users



--
   _
|\/|o _|_  _. _ | | \.__  __|__|_|_  _  _ ._ _
|  ||(_| |(_|(/_| |_/|(_)(/_|_ |_|_)(_)(_)| | |

http://www.droettboom.com


Re: [Matplotlib-users] ANN: matplotlib 1.3.1

2013-10-21 Thread Michael Droettboom

On 10/18/2013 03:18 PM, Nelle Varoquaux wrote:

Hello,
Congratulations for this new minor release !
Someone mentionned on python-list that it's not available on pypi. I 
checked, and indeed it isn't.

Should we upload it there?
Thanks,
N


Sorry about that.  I just addressed that this morning.

Mike




On 10 October 2013 20:19, Michael Droettboom md...@stsci.edu 
mailto:md...@stsci.edu wrote:


I'm pleased to announce the release of matplotlib version 1.3.1.  This is a 
bugfix release.

It may be downloaded from here, or installed through the package manager of 
your choice (when available):

http://matplotlib.org/downloads

The changelog is copied below:

New in 1.3.1


1.3.1 is a bugfix release, primarily dealing with improved setup and
handling of dependencies, and correcting and enhancing the
documentation.

The following changes were made in 1.3.1 since 1.3.0.

Enhancements


- Added a context manager for creating multi-page pdfs (see
`matplotlib.backends.backend_pdf.PdfPages`).

- The WebAgg backend should no have lower latency over heterogeneous
Internet connections.

Bug fixes
`

- Histogram plots now contain the endline.

- Fixes to the Molleweide projection.

- Handling recent fonts from Microsoft and Macintosh-style fonts with
non-ascii metadata is improved.

- Hatching of fill between plots now works correctly in the PDF
backend.

- Tight bounding box support now works in the PGF backend.

- Transparent figures now display correctly in the Qt4Agg backend.

- Drawing lines from one subplot to another now works.

- Unit handling on masked arrays has been improved.

Setup and dependencies
``

- Now works with any version of pyparsing 1.5.6 or later, without displaying
hundreds of warnings.

- Now works with 64-bit versions of Ghostscript on MS-Windows.

- When installing from source into an environment without Numpy, Numpy
will first be downloaded and built and then used to build
matplotlib.

- Externally installed backends are now always imported using a
fully-qualified path to the module.

- Works with newer version of wxPython.

- Can now build with a PyCXX installed globally on the system from source.

- Better detection of Gtk3 dependencies.

Testing
```

- Tests should now work in non-English locales.

- PEP8 conformance tests now report on locations of issues.

Mike

-- 
_

|\/|o _|_  _. _ | | \.__  __|__|_|_  _  _ ._ _
|  ||(_| |(_|(/_| |_/|(_)(/_|_ |_|_)(_)(_)| | |

http://www.droettboom.com



--
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get
the most from
the latest Intel processors and coprocessors. See abstracts and
register 
http://pubads.g.doubleclick.net/gampad/clk?id=60134071iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
mailto:Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users





--
   _
|\/|o _|_  _. _ | | \.__  __|__|_|_  _  _ ._ _
|  ||(_| |(_|(/_| |_/|(_)(/_|_ |_|_)(_)(_)| | |

http://www.droettboom.com

--
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register 
http://pubads.g.doubleclick.net/gampad/clk?id=60135031iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users