Re: [Matplotlib-users] plot() not using alpha value from RGBA tuple

2011-08-15 Thread Eric Firing
On 07/25/2011 08:21 AM, Ben Breslauer wrote:
> I think that I have found the problem here.  Line2D.draw() (and I
> presume other Artist subclasses) calls
>
> gc.set_foreground(self._color)
> ...
> gc.set_alpha(self._alpha)
>
> self._color is defined by the color kwarg, whether it be a hex value,
> 3-tuple, 4-tuple, or something else.  self._alpha is defined by the
> alpha kwarg, but if the alpha kwarg is None, it is not overwritten with
> color[3].  Therefore, using color=(R,G,B,A) does not set alpha
> correctly.  I'm not sure the best (i.e. most matplotlib-like) way to
> change this so that the A value gets used iff alpha is None, but I've
> attached a patch that does it one way (diff'ed against the github
> master, commit 67b1cd650f574f9c53ce).  I know the patch is less than
> ideal, as it adds kwarg-specific handling into a place where none had
> previously been done, and it's also in a for loop. Maybe it would be
> better to do the checking along with the scalex and scaley pops?


Alpha handling is a real can of worms; it has gotten better, but as you 
note, there are still problems.  Unfortunately, I don't think your 
proposed solution will work in general, because self._color could be a 
4-letter string, like "gray", in which case alpha would be set to "y", 
and that would not be good at all.  I suspect the right place to solve 
the problem is down in the GraphicsContext--although I thought I had 
already straightened that out some time ago.

As Ben notes, you should file a bug report.
Given that the handling of colors and alpha is inherently tricky (and 
backend-dependent--ps doesn't support alpha at all), solving the problem 
well is going to take a bit of time and care, most likely--and testing 
to make sure that a fix in one place doesn't cause a bug in another.  I 
think we should leave it alone until after the next release.

Eric

>
>
> Separately, I noticed that
> backend_bases.GraphicsContextBase.set_foreground claims to only expect
> an RGB definition, and not an RGBA definition.  As such, I think that it
> should call
>
> self._rgb = colors.colorConverter.to_rgb(fg)
>
> instead of
>
> self._rgb = colors.colorConverter.to_rgba(fg)
>
> since that will make self._rgb a 3-tuple instead of a 4-tuple.
>
> Ben
>
> On Sat, Jul 23, 2011 at 3:13 PM, Ben Breslauer  > wrote:
>
> Hi,
>
> I'm trying to fade some data, using alpha values, that I am plotting
> with Axes.plot().  I can recreate this problem with 1 line of
> pylab.plot.  If I use
>
> pylab.plot([1,2,3],[1,4,9], color=(1,0,0,.2), linewidth=7)
>
> then I get the equivalent of
>
> pylab.plot([1,2,3],[1,4,9], color=(1,0,0), linewidth=7)
>
> i.e. it does not use the alpha value.  However, if instead I use
>
> pylab.plot([1,2,3],[1,4,9], color=(1,0,0), linewidth=7, alpha=.2)
>
> then the line is faded out appropriately.  The plot documentation
> indicates that RGBA tuples should be valid, so I'm wondering if this
> is a bug.  Maybe alpha is defaulting to 1 or None and then not being
> overwritten if color is a 4-tuple?
>
> I'm using Arch Linux with kernel 2.6.39, matplotlib 1.0.1 from the
> Arch repo, and the Qt4 backend.  My installed Qt version is 4.7.3,
> and I am using KDE 4.6.5.  Below is verbose-debug output.  Thanks
> for any help!
>
> Ben
>
>
> $HOME=/home/ben
> CONFIGDIR=/home/ben/.matplotlib
> matplotlib data path
> /usr/lib/python2.7/site-packages/matplotlib/mpl-data
> loaded rc file
> /usr/lib/python2.7/site-packages/matplotlib/mpl-data/matplotlibrc
> matplotlib version 1.0.1
> verbose.level debug
> interactive is False
> units is False
> platform is linux2
> loaded modules: ['heapq', 'numpy.core.info
> ', 'distutils', 'numpy.lib.format',
> 'functools', 'pylab', '_bisect', 'subprocess', 'sysconfig', 'gc',
> 'matplotlib.tempfile', 'distutils.sysconfig', 'ctypes._endian',
> 'encodings.encodings', 'pyparsing', 'matplotlib.colors',
> 'numpy.core.numerictypes', 'numpy.testing.sys',
> 'numpy.lib.__future__', 'numpy.fft.types', 'numpy.ma.cPickle',
> 'struct', 'numpy.matrixlib.defmatrix', 'numpy.random.info
> ', 'tempfile', 'numpy.compat.types',
> 'pprint', 'numpy.linalg', 'matplotlib.threading',
> 'numpy.core.machar', 'numpy.testing.types', 'numpy.testing',
> 'collections', 'numpy.polynomial.sys', 'unittest.sys',
> 'numpy.core.umath', 'unittest.main', 'distutils.types',
> 'numpy.testing.operator', 'numpy.core.scalarmath', 'numpy.ma.sys',
> 'zipimport', 'string', 'matplotlib.subprocess', 'numpy.testing.os',
> 'unittest.functools', 'numpy.lib.arraysetops',
> 'numpy.testing.unittest', 'numpy.lib.math', 'encodings.utf_8',
> 'matplotlib.__future__', 'unittest.types', 'unittest.util',
> 'numpy.testing.re ', 'numpy.version',
> 'numpy.lib.re 

Re: [Matplotlib-users] plot() not using alpha value from RGBA tuple

2011-08-15 Thread Benjamin Root
On Monday, August 15, 2011, Ben Breslauer  wrote:
> Hi,
>
> Has anyone else noticed this behavior?  For the devs, do you prefer a
github bug to the SF list?
>
> Ben

I have not personally observed this, but usually, people don't specify rgba
tuples for plot.  I think the lack of response is due to our focus on larger
bugs right now for the upcoming release.  Therefore, it would probably be
best to file a bug report with your patch so that we have a record of it.

The fuller patch might be more involved (consider scatter and other
functions).  Plus, we would likely need to consider what to do if both an
rgba tuple and alpha were specified,

As a rule of thumb, if we don't respond on list, file a bug report.

Thanks for bringing this to our attention!
Ben Root
--
uberSVN's rich system and user administration capabilities and model 
configuration take the hassle out of deploying and managing Subversion and 
the tools developers use with it. Learn more about uberSVN and get a free 
download at:  http://p.sf.net/sfu/wandisco-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] plot() not using alpha value from RGBA tuple

2011-08-15 Thread Ben Breslauer
Hi,

Has anyone else noticed this behavior?  For the devs, do you prefer a github
bug to the SF list?

Ben

On Mon, Jul 25, 2011 at 2:21 PM, Ben Breslauer  wrote:

> I think that I have found the problem here.  Line2D.draw() (and I presume
> other Artist subclasses) calls
>
> gc.set_foreground(self._color)
> ...
> gc.set_alpha(self._alpha)
>
> self._color is defined by the color kwarg, whether it be a hex value,
> 3-tuple, 4-tuple, or something else.  self._alpha is defined by the alpha
> kwarg, but if the alpha kwarg is None, it is not overwritten with color[3].
> Therefore, using color=(R,G,B,A) does not set alpha correctly.  I'm not sure
> the best (i.e. most matplotlib-like) way to change this so that the A value
> gets used iff alpha is None, but I've attached a patch that does it one way
> (diff'ed against the github master, commit 67b1cd650f574f9c53ce).  I know
> the patch is less than ideal, as it adds kwarg-specific handling into a
> place where none had previously been done, and it's also in a for loop.
> Maybe it would be better to do the checking along with the scalex and scaley
> pops?
>
>
> Separately, I noticed that backend_bases.GraphicsContextBase.set_foreground
> claims to only expect an RGB definition, and not an RGBA definition.  As
> such, I think that it should call
>
> self._rgb = colors.colorConverter.to_rgb(fg)
>
> instead of
>
> self._rgb = colors.colorConverter.to_rgba(fg)
>
> since that will make self._rgb a 3-tuple instead of a 4-tuple.
>
> Ben
>
>
> On Sat, Jul 23, 2011 at 3:13 PM, Ben Breslauer wrote:
>
>> Hi,
>>
>> I'm trying to fade some data, using alpha values, that I am plotting with
>> Axes.plot().  I can recreate this problem with 1 line of pylab.plot.  If I
>> use
>>
>> pylab.plot([1,2,3],[1,4,9], color=(1,0,0,.2), linewidth=7)
>>
>> then I get the equivalent of
>>
>> pylab.plot([1,2,3],[1,4,9], color=(1,0,0), linewidth=7)
>>
>> i.e. it does not use the alpha value.  However, if instead I use
>>
>> pylab.plot([1,2,3],[1,4,9], color=(1,0,0), linewidth=7, alpha=.2)
>>
>> then the line is faded out appropriately.  The plot documentation
>> indicates that RGBA tuples should be valid, so I'm wondering if this is a
>> bug.  Maybe alpha is defaulting to 1 or None and then not being overwritten
>> if color is a 4-tuple?
>>
>> I'm using Arch Linux with kernel 2.6.39, matplotlib 1.0.1 from the Arch
>> repo, and the Qt4 backend.  My installed Qt version is 4.7.3, and I am using
>> KDE 4.6.5.  Below is verbose-debug output.  Thanks for any help!
>>
>> Ben
>>
>>
>> $HOME=/home/ben
>> CONFIGDIR=/home/ben/.matplotlib
>> matplotlib data path /usr/lib/python2.7/site-packages/matplotlib/mpl-data
>> loaded rc file
>> /usr/lib/python2.7/site-packages/matplotlib/mpl-data/matplotlibrc
>> matplotlib version 1.0.1
>> verbose.level debug
>> interactive is False
>> units is False
>> platform is linux2
>> loaded modules: ['heapq', 'numpy.core.info', 'distutils',
>> 'numpy.lib.format', 'functools', 'pylab', '_bisect', 'subprocess',
>> 'sysconfig', 'gc', 'matplotlib.tempfile', 'distutils.sysconfig',
>> 'ctypes._endian', 'encodings.encodings', 'pyparsing', 'matplotlib.colors',
>> 'numpy.core.numerictypes', 'numpy.testing.sys', 'numpy.lib.__future__',
>> 'numpy.fft.types', 'numpy.ma.cPickle', 'struct',
>> 'numpy.matrixlib.defmatrix', 'numpy.random.info', 'tempfile',
>> 'numpy.compat.types', 'pprint', 'numpy.linalg', 'matplotlib.threading',
>> 'numpy.core.machar', 'numpy.testing.types', 'numpy.testing', 'collections',
>> 'numpy.polynomial.sys', 'unittest.sys', 'numpy.core.umath', 'unittest.main',
>> 'distutils.types', 'numpy.testing.operator', 'numpy.core.scalarmath',
>> 'numpy.ma.sys', 'zipimport', 'string', 'matplotlib.subprocess',
>> 'numpy.testing.os', 'unittest.functools', 'numpy.lib.arraysetops',
>> 'numpy.testing.unittest', 'numpy.lib.math', 'encodings.utf_8',
>> 'matplotlib.__future__', 'unittest.types', 'unittest.util', '
>> numpy.testing.re', 'numpy.version', 'numpy.lib.re', 'distutils.re',
>> 'numpy.matrixlib.sys', 'ctypes.os', 'numpy.core.os', 'numpy.lib.type_check',
>> 'numpy.compat.sys', 'unittest.StringIO', 'bisect', 'numpy.core._internal',
>> 'signal', 'numpy.lib.types', 'numpy.lib._datasource', 'random',
>> 'numpy.lib.__builtin__', 'numpy.fft.fftpack_lite', 'matplotlib.cbook',
>> 'textwrap', 'numpy.core.multiarray', 'numpy.polynomial.string',
>> 'distutils.version', 'cStringIO', 'numpy.polynomial', 'numpy.numpy',
>> 'matplotlib.StringIO', 'unittest.time', 'locale', 'numpy.add_newdocs',
>> 'unittest.difflib', 'numpy.core.getlimits', 'base64', '_ssl',
>> 'numpy.lib.sys', 'encodings', 'numpy.ma.itertools', 'unittest.pprint', '
>> unittest.re', 'abc', 'numpy.matrixlib', 'numpy.ctypes',
>> 'numpy.testing.decorators', 'matplotlib.warnings', 'rfc822',
>> 'numpy.lib.npyio', 'numpy.lib.numpy', 'matplotlib.sys', 're',
>> 'numpy.lib._compiled_base', 'numpy.polynomial.legendre', 'threading', 'new',
>> 'numpy.ma.warnings', 'numpy.random.mtrand', 'urllib2', 'matplotlib.cPickle',
>> 'math', 'numpy

[Matplotlib-users] Calling all Mac OSX users!

2011-08-15 Thread Benjamin Root
The mpl developers are getting very close to the long-awaited v1.1.0 release
of matplotlib.  Before we do so, we are doing some final checking of the
documentation to make sure that all critical pieces of information iss
correct and up to date.

In checking over the instructions for building and installing matplotlib on
MacOSX, I have found two separate sets of instructions.  On the install
page, there is a reference to a README.txt file in "release/osx".  This file
is there, but it seems to refer to other files that no longer exists.
Meanwhile, there is an un-referenced file in the top directory called
README.osx that seems a lot more current.

Because I do not have a Mac that I can use for development, I would like to
ask the community for help in determining the correct set of instructions
and to eliminate cruft.  I think it would also be useful to point users to
any relevant instructions for installing/building numpy on Macs.  I would
also like to make  sure we are current with information on installing on a
stock Lion install.

Please feel free to respond on this list, or better, make a branch on github
and submit pull requests to help us improve these documents.

Thanks!
Ben Root
--
uberSVN's rich system and user administration capabilities and model 
configuration take the hassle out of deploying and managing Subversion and 
the tools developers use with it. Learn more about uberSVN and get a free 
download at:  http://p.sf.net/sfu/wandisco-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib backends - WXAgg vs. WX

2011-08-15 Thread Vlastimil Brom
2011/8/15 Michael Droettboom :
> On 08/14/2011 11:28 AM, Vlastimil Brom wrote:
>> ...
>> Is there maybe some mechanism available in matplotlib, which would
>> select the appropriate font for the given characters? (Like in wx or,
>> even more powerful in tk?) Or is it the expected way to set the
>> suitable font individually, as only the font list in rcParams are
>> tried sequentially - regardless of the character support?
> That's correct: matplotlib doesn't currently do this.  It renders a
> particular string of text with a single font and does not do font
> substitution for characters that are not in that font.  The best
> practice is to use a font that contains the full set of characters, such
> as Arial or Deja Vu as you've discovered.
>
> There a lot of other i18n shortcomings to the way matplotlib supports
> text (such as a lack of bidi support).  That's a large wheel to
> reinvent, so the solution would involve using a third-party text layout
> library such as pango, but I know there is licensing friction against
> that.  It may be worth revisiting that at some point.
>
> Mike
>
>
Thanks for the confirmation, I'll stick with this apporoach, as I
didn't manage to fix the code for wx backend on the newest version
(cf. above). Given the status of the non-Agg backends it might be more
appropriate.

Regards,
   vbr

--
uberSVN's rich system and user administration capabilities and model 
configuration take the hassle out of deploying and managing Subversion and 
the tools developers use with it. Learn more about uberSVN and get a free 
download at:  http://p.sf.net/sfu/wandisco-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Error with PDF output with usetex

2011-08-15 Thread Jeff Klukas
On Mon, Aug 15, 2011 at 10:00 PM, Damon McDougall
 wrote:
> Hi Jeff,
>
> I am able to run the tex_demo.py with no problems and I can create
>
> output files using the Agg backend.  When I try to use the PDF
>
> backend, however, I get an error which stems from dviread.py (pasted
>
> below).  Any thoughts on what could be going wrong?
>
> Thanks!
>
> Jeff
>
> Hi Jeff,
>
> How did you install matplotlib? From source yourself?
>
> No, I'm using the Enthought Python Distribution (EPD64).
>
> And when you installed matplotlib, did it see that you had dvipng installed?
> FYI, you can do
> which dvipng
> to return the path where dvipng lives (if it is in your path already) or you
> can do
> locate dvipng
> to do a search for the binary if it isn't already in your path.
> P.S. You forgot to reply-all so everyone can see your response.

$ which dvipng
/usr/texbin/dvipng

I don't remember any complaints while running the EPD installer.
Would there be a way to check this?  Is the problem definitely related
to an inability to find dvipng, or could there be other possibilities?

Thanks,
Jeff

--
uberSVN's rich system and user administration capabilities and model 
configuration take the hassle out of deploying and managing Subversion and 
the tools developers use with it. Learn more about uberSVN and get a free 
download at:  http://p.sf.net/sfu/wandisco-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Error with PDF output with usetex

2011-08-15 Thread Damon McDougall
>> Hi Jeff,
>> 
>> I am able to run the tex_demo.py with no problems and I can create
>> output files using the Agg backend.  When I try to use the PDF
>> backend, however, I get an error which stems from dviread.py (pasted
>> below).  Any thoughts on what could be going wrong?
>> 
>> Thanks!
>> Jeff
>> 
>> Hi Jeff,
>> How did you install matplotlib? From source yourself?
> 
> No, I'm using the Enthought Python Distribution (EPD64).

And when you installed matplotlib, did it see that you had dvipng installed?

FYI, you can do

which dvipng

to return the path where dvipng lives (if it is in your path already) or you 
can do

locate dvipng

to do a search for the binary if it isn't already in your path.

P.S. You forgot to reply-all so everyone can see your response.

Damon McDougall
d.mcdoug...@warwick.ac.uk
http://damon.is-a-geek.com
B2.39
Mathematics Institute
Coventry
West Midlands
CV4 7AL


--
uberSVN's rich system and user administration capabilities and model 
configuration take the hassle out of deploying and managing Subversion and 
the tools developers use with it. Learn more about uberSVN and get a free 
download at:  http://p.sf.net/sfu/wandisco-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] determining of a line segment is a Line2D

2011-08-15 Thread Mathew Yeates
Hi
Is there a simple way to do the following

l1=Line2D(xdata=[1,2,3],ydata=[4,5,6])

l2=Line2D(xdata = [1].ydata=[3])

if l2 in l1 #error, Line2D not iterable


-Mathew

--
uberSVN's rich system and user administration capabilities and model 
configuration take the hassle out of deploying and managing Subversion and 
the tools developers use with it. Learn more about uberSVN and get a free 
download at:  http://p.sf.net/sfu/wandisco-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Error with PDF output with usetex

2011-08-15 Thread Jeff Klukas
Hello all,

I am running Mac OS X 10.7 Lion with matplotlib 1.0.1 and the MacTex
2011 distrubution.

I am able to run the tex_demo.py with no problems and I can create
output files using the Agg backend.  When I try to use the PDF
backend, however, I get an error which stems from dviread.py (pasted
below).  Any thoughts on what could be going wrong?

Thanks!
Jeff

|| Jeff Klukas
|| Research Assistant (Physics), University of Wisconsin
|| jeff.klukas@gmail | jeffyklukas@aim | jeffklukas@skype
|| http://hep.wisc.edu/~jklukas/



Traceback (most recent call last):
  File "tex_demo.py", line 32, in 
savefig('tex_demo')
  File 
"/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/matplotlib/pyplot.py",
line 363, in savefig
return fig.savefig(*args, **kwargs)
  File 
"/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/matplotlib/figure.py",
line 1084, in savefig
self.canvas.print_figure(*args, **kwargs)
  File 
"/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/matplotlib/backend_bases.py",
line 1923, in print_figure
**kwargs)
  File 
"/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/matplotlib/backends/backend_pdf.py",
line 2156, in print_pdf
self.figure.draw(renderer)
  File 
"/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/matplotlib/artist.py",
line 55, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
  File 
"/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/matplotlib/figure.py",
line 798, in draw
func(*args)
  File 
"/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/matplotlib/artist.py",
line 55, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
  File 
"/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/matplotlib/axes.py",
line 1946, in draw
a.draw(renderer)
  File 
"/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/matplotlib/artist.py",
line 55, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
  File 
"/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/matplotlib/axis.py",
line 1017, in draw
tick.draw(renderer)
  File 
"/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/matplotlib/artist.py",
line 55, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
  File 
"/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/matplotlib/axis.py",
line 234, in draw
self.label1.draw(renderer)
  File 
"/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/matplotlib/artist.py",
line 55, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
  File 
"/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/matplotlib/text.py",
line 571, in draw
self._fontproperties, angle)
  File 
"/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/matplotlib/backends/backend_pdf.py",
line 1549, in draw_tex
psfont = self.tex_font_mapping(dvifont.texname)
  File 
"/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/matplotlib/backends/backend_pdf.py",
line 1365, in tex_font_mapping
dviread.PsfontsMap(dviread.find_tex_file('pdftex.map'))
  File 
"/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/matplotlib/dviread.py",
line 668, in __init__
self._parse(file)
  File 
"/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/matplotlib/dviread.py",
line 701, in _parse
self._register(words)
  File 
"/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/matplotlib/dviread.py",
line 727, in _register
assert encoding is None
AssertionError

--
uberSVN's rich system and user administration capabilities and model 
configuration take the hassle out of deploying and managing Subversion and 
the tools developers use with it. Learn more about uberSVN and get a free 
download at:  http://p.sf.net/sfu/wandisco-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Forcing the size of a figure

2011-08-15 Thread Stan West
From: David Just [mailto:just.da...@mayo.edu] 
Sent: Friday, August 12, 2011 11:05
 
Now that I'm pre-building all my enlarged interpolated images to scroll
through,  I'm having trouble forcing the figure/FigureCanvas to be the size I
want.

I'm trying: 
fig.set_size_inches(768 / 72.0, 768 / 72.0),  but it ends up the same size as
the default plot.

If the issue is that the GUI window is not changing size, try adding
"forward=True" to the set_size_inches call.

--
uberSVN's rich system and user administration capabilities and model 
configuration take the hassle out of deploying and managing Subversion and 
the tools developers use with it. Learn more about uberSVN and get a free 
download at:  http://p.sf.net/sfu/wandisco-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Font family ['cmb10'] not found

2011-08-15 Thread Michael Droettboom
It looks like it isn't finding the Computer Modern Bakoma fonts.  They 
don't seem to be included in the Fedora Package (see here: 
http://koji.fedoraproject.org/koji/buildinfo?buildID=230966) and the 
package does not depend on those fonts.  Some of them are packaged in 
the lyx-fonts package, so installing that may help.  But basically this 
is a packaging bug -- the package should either include the fonts or 
depend on the fonts.  It might be a good idea to file a bug against the 
python-matplotlib package in the Fedora bug tracker.

Mike

On 08/15/2011 07:05 AM, Neal Becker wrote:
> Fedora f15.  What am I missing that causes this?
>
> /usr/lib64/python2.7/site-packages/matplotlib/font_manager.py:1242: 
> UserWarning:
> findfont: Font family ['cmb10'] not found. Falling back to Bitstream Vera Sans
>(prop.get_family(), self.defaultFamily[fontext]))
> /usr/lib64/python2.7/site-packages/matplotlib/font_manager.py:1252: 
> UserWarning:
> findfont: Could not match :family=Bitstream Vera
> Sans:style=normal:variant=normal:weight=normal:stretch=normal:size=12. 
> Returning
> /usr/share/fonts/texlive-gfsdidot/GFSDidotBold.otf
>UserWarning)
> /usr/lib64/python2.7/site-packages/matplotlib/font_manager.py:1242: 
> UserWarning:
> findfont: Font family ['cmtt10'] not found. Falling back to Bitstream Vera 
> Sans
>(prop.get_family(), self.defaultFamily[fontext]))
> /usr/lib64/python2.7/site-packages/matplotlib/font_manager.py:1242: 
> UserWarning:
> findfont: Font family ['cmss10'] not found. Falling back to Bitstream Vera 
> Sans
>(prop.get_family(), self.defaultFamily[fontext]))
>
>
> --
> uberSVN's rich system and user administration capabilities and model
> configuration take the hassle out of deploying and managing Subversion and
> the tools developers use with it. Learn more about uberSVN and get a free
> download at:  http://p.sf.net/sfu/wandisco-dev2dev
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
uberSVN's rich system and user administration capabilities and model 
configuration take the hassle out of deploying and managing Subversion and 
the tools developers use with it. Learn more about uberSVN and get a free 
download at:  http://p.sf.net/sfu/wandisco-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib backends - WXAgg vs. WX

2011-08-15 Thread Michael Droettboom
On 08/14/2011 11:28 AM, Vlastimil Brom wrote:
> 
>
> Regarding wxagg, it seems, that the suggestion about unsuitable fonts
> being used was correct;
> after setting the font to Arial, adapted from:
> http://matplotlib.sourceforge.net/examples/api/font_family_rc.html
> all the characters in the title are displayed ok.
>
> 
> #! Python
> # -*- coding: utf-8 -*-
>
> import wxversion
> wxversion.select('2.9.2') # 2.9.2.1
> import wx
>
> # setting the font to Arial - the title is displayed completely;
> # with the default font only the "latin-1" characters are shown
> from matplotlib import rcParams
> rcParams['font.family'] = 'sans-serif'
> rcParams['font.sans-serif'] = ['Arial'] + rcParams['font.sans-serif']
> #
>
> import matplotlib
> matplotlib.use('WXAgg')
> import pylab
>
> pylab.plot(range(3), range(3))
> pylab.title(u"abcd áčďéěíňóřšťúůýž äöüß ê αβγδ абвгд אבגד xyz")
> pylab.show()
>
> 
>   (using python 2.7.2, MPL 1.0.1; Win 7, Czech)
>
> Is there maybe some machanism available in matplotlib, which would
> select the appropriate font for the given characters? (Like in wx or,
> even more powerful in tk?) Or is it the expected way to set the
> suitable font individually, as only the font list in rcParams are
> tried sequentially - regardless of the character support?
That's correct: matplotlib doesn't currently do this.  It renders a 
particular string of text with a single font and does not do font 
substitution for characters that are not in that font.  The best 
practice is to use a font that contains the full set of characters, such 
as Arial or Deja Vu as you've discovered.

There a lot of other i18n shortcomings to the way matplotlib supports 
text (such as a lack of bidi support).  That's a large wheel to 
reinvent, so the solution would involve using a third-party text layout 
library such as pango, but I know there is licensing friction against 
that.  It may be worth revisiting that at some point.

Mike

--
uberSVN's rich system and user administration capabilities and model 
configuration take the hassle out of deploying and managing Subversion and 
the tools developers use with it. Learn more about uberSVN and get a free 
download at:  http://p.sf.net/sfu/wandisco-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Font family ['cmb10'] not found

2011-08-15 Thread Neal Becker
Looks like this is fixed by:

mathtext.fontset: stix

Neal Becker wrote:

> Fedora f15.  What am I missing that causes this?
> 
> /usr/lib64/python2.7/site-packages/matplotlib/font_manager.py:1242:
> UserWarning: findfont: Font family ['cmb10'] not found. Falling back to
> Bitstream Vera Sans
>   (prop.get_family(), self.defaultFamily[fontext]))
> /usr/lib64/python2.7/site-packages/matplotlib/font_manager.py:1252:
> UserWarning: findfont: Could not match :family=Bitstream Vera
> Sans:style=normal:variant=normal:weight=normal:stretch=normal:size=12.
> Returning /usr/share/fonts/texlive-gfsdidot/GFSDidotBold.otf
>   UserWarning)
> /usr/lib64/python2.7/site-packages/matplotlib/font_manager.py:1242:
> UserWarning: findfont: Font family ['cmtt10'] not found. Falling back to
> Bitstream Vera Sans
>   (prop.get_family(), self.defaultFamily[fontext]))
> /usr/lib64/python2.7/site-packages/matplotlib/font_manager.py:1242:
> UserWarning: findfont: Font family ['cmss10'] not found. Falling back to
> Bitstream Vera Sans
>   (prop.get_family(), self.defaultFamily[fontext]))
> 
> 
> --
> uberSVN's rich system and user administration capabilities and model
> configuration take the hassle out of deploying and managing Subversion and
> the tools developers use with it. Learn more about uberSVN and get a free
> download at:  http://p.sf.net/sfu/wandisco-dev2dev



--
uberSVN's rich system and user administration capabilities and model 
configuration take the hassle out of deploying and managing Subversion and 
the tools developers use with it. Learn more about uberSVN and get a free 
download at:  http://p.sf.net/sfu/wandisco-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Font family ['cmb10'] not found

2011-08-15 Thread Neal Becker
Fedora f15.  What am I missing that causes this?

/usr/lib64/python2.7/site-packages/matplotlib/font_manager.py:1242: 
UserWarning: 
findfont: Font family ['cmb10'] not found. Falling back to Bitstream Vera Sans
  (prop.get_family(), self.defaultFamily[fontext]))
/usr/lib64/python2.7/site-packages/matplotlib/font_manager.py:1252: 
UserWarning: 
findfont: Could not match :family=Bitstream Vera 
Sans:style=normal:variant=normal:weight=normal:stretch=normal:size=12. 
Returning 
/usr/share/fonts/texlive-gfsdidot/GFSDidotBold.otf
  UserWarning)
/usr/lib64/python2.7/site-packages/matplotlib/font_manager.py:1242: 
UserWarning: 
findfont: Font family ['cmtt10'] not found. Falling back to Bitstream Vera Sans
  (prop.get_family(), self.defaultFamily[fontext]))
/usr/lib64/python2.7/site-packages/matplotlib/font_manager.py:1242: 
UserWarning: 
findfont: Font family ['cmss10'] not found. Falling back to Bitstream Vera Sans
  (prop.get_family(), self.defaultFamily[fontext]))


--
uberSVN's rich system and user administration capabilities and model 
configuration take the hassle out of deploying and managing Subversion and 
the tools developers use with it. Learn more about uberSVN and get a free 
download at:  http://p.sf.net/sfu/wandisco-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users