Re: [Matplotlib-users] Set sharex and sharey on the axes object

2014-05-07 Thread Eric Firing
On 2014/05/07 2:12 PM, Yuxiang Wang wrote:
> Dear all,
>
> I was wondering that, is there a method like axes.set_sharex(ax0) so I
> can directly set the sharex and sharey properties of an axes object?
> It seems that the only way to do this is at time of creation via
> fig.add_subplots(1, 2, 2, sharex=ax0). If I have already created the
> axes using the plt.subplots() method, this wouldn't work.
>
> Could anyone please help make sure that I am understanding this
> question correctly?
>

This is correct.  If you use plt.subplots with sharex and/or sharey, the 
sharing applies to all subplots.

Eric

> Thank you!
>
> Shawn


--
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
• 3 signs your SCM is hindering your productivity
• Requirements for releasing software faster
• Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Set sharex and sharey on the axes object

2014-05-07 Thread Yuxiang Wang
Dear all,

I was wondering that, is there a method like axes.set_sharex(ax0) so I
can directly set the sharex and sharey properties of an axes object?
It seems that the only way to do this is at time of creation via
fig.add_subplots(1, 2, 2, sharex=ax0). If I have already created the
axes using the plt.subplots() method, this wouldn't work.

Could anyone please help make sure that I am understanding this
question correctly?

Thank you!

Shawn

--
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
• 3 signs your SCM is hindering your productivity
• Requirements for releasing software faster
• Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplot crases because of XDG_CONFIG_HOME variable

2014-05-07 Thread Paul Tremblay
I've discovered the problem and a fix. $HOME is set to /home/ptremblay, but
/home/ptremblay does not exist. If I do:

import os
try:
import matplotlib
except AttributeError as msg:
os.environ['HOME'] = '/apollo/env/Ssdf/var/home_config/'
import matplotlib

Then I can import the library.


On Wed, May 7, 2014 at 11:50 AM, Paul Tremblay wrote:

> I am using our companies pacaking system. The version of matplotlib is
> 1.3.1, by the way.
>
>
> On Wed, May 7, 2014 at 11:32 AM, Paul Hobson  wrote:
>
>> How did you install matplotlib? I've had success using anaconda on cheap
>> $7/month web servers before
>> http://continuum.io/downloads
>>
>>
>> On Wed, May 7, 2014 at 7:20 AM, Paul Tremblay wrote:
>>
>>> I am using matplotllib as part of web server. matplotlib causes my
>>> server to crash with this error:
>>>
>>> File
>>> "/apollo/env/Ssdf/lib/python2.7/site-packages/matplotlib/__init__.py", line
>>> 597, in _get_configdir
>>> return _get_config_or_cache_dir(_get_xdg_config_dir())
>>>   File
>>> "/apollo/env/Ssdf/lib/python2.7/site-packages/matplotlib/__init__.py", line
>>> 534, in _get_xdg_config_dir
>>> return os.environ.get('XDG_CONFIG_HOME', os.path.join(get_home(),
>>> '.config'))
>>>   File
>>> "/apollo/env/Ssdf/bin/../../../package/local_1/Linux-2.6c2.5-x86_64/Python27/Python27-487.0-0/lib/python2.7/posixpath.py",
>>> line 77, in join
>>> elif path == '' or path.endswith('/'):
>>> : 'NoneType' object has no attribute
>>> 'endswith'
>>>
>>> I have no home directory on my server (and probably don't have the
>>> permissions to create one). What is the correct way to fix this problem?
>>>
>>> Thanks!
>>>
>>> Paul
>>>
>>>
>>>
>>> --
>>> Is your legacy SCM system holding you back? Join Perforce May 7 to find
>>> out:
>>> • 3 signs your SCM is hindering your productivity
>>> • Requirements for releasing software faster
>>> • Expert tips and advice for migrating your SCM now
>>> http://p.sf.net/sfu/perforce
>>> ___
>>> Matplotlib-users mailing list
>>> Matplotlib-users@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>>
>>>
>>
>
--
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
• 3 signs your SCM is hindering your productivity
• Requirements for releasing software faster
• Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] basic pgf test fails

2014-05-07 Thread Neal Becker
https://github.com/matplotlib/matplotlib/issues/3051



--
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
• 3 signs your SCM is hindering your productivity
• Requirements for releasing software faster
• Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplot crases because of XDG_CONFIG_HOME variable

2014-05-07 Thread Paul Tremblay
I am using our companies pacaking system. The version of matplotlib is
1.3.1, by the way.


On Wed, May 7, 2014 at 11:32 AM, Paul Hobson  wrote:

> How did you install matplotlib? I've had success using anaconda on cheap
> $7/month web servers before
> http://continuum.io/downloads
>
>
> On Wed, May 7, 2014 at 7:20 AM, Paul Tremblay wrote:
>
>> I am using matplotllib as part of web server. matplotlib causes my server
>> to crash with this error:
>>
>> File
>> "/apollo/env/Ssdf/lib/python2.7/site-packages/matplotlib/__init__.py", line
>> 597, in _get_configdir
>> return _get_config_or_cache_dir(_get_xdg_config_dir())
>>   File
>> "/apollo/env/Ssdf/lib/python2.7/site-packages/matplotlib/__init__.py", line
>> 534, in _get_xdg_config_dir
>> return os.environ.get('XDG_CONFIG_HOME', os.path.join(get_home(),
>> '.config'))
>>   File
>> "/apollo/env/Ssdf/bin/../../../package/local_1/Linux-2.6c2.5-x86_64/Python27/Python27-487.0-0/lib/python2.7/posixpath.py",
>> line 77, in join
>> elif path == '' or path.endswith('/'):
>> : 'NoneType' object has no attribute
>> 'endswith'
>>
>> I have no home directory on my server (and probably don't have the
>> permissions to create one). What is the correct way to fix this problem?
>>
>> Thanks!
>>
>> Paul
>>
>>
>>
>> --
>> Is your legacy SCM system holding you back? Join Perforce May 7 to find
>> out:
>> • 3 signs your SCM is hindering your productivity
>> • Requirements for releasing software faster
>> • Expert tips and advice for migrating your SCM now
>> http://p.sf.net/sfu/perforce
>> ___
>> Matplotlib-users mailing list
>> Matplotlib-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>>
>
--
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
• 3 signs your SCM is hindering your productivity
• Requirements for releasing software faster
• Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplot crases because of XDG_CONFIG_HOME variable

2014-05-07 Thread Paul Hobson
How did you install matplotlib? I've had success using anaconda on cheap
$7/month web servers before
http://continuum.io/downloads


On Wed, May 7, 2014 at 7:20 AM, Paul Tremblay wrote:

> I am using matplotllib as part of web server. matplotlib causes my server
> to crash with this error:
>
> File
> "/apollo/env/Ssdf/lib/python2.7/site-packages/matplotlib/__init__.py", line
> 597, in _get_configdir
> return _get_config_or_cache_dir(_get_xdg_config_dir())
>   File
> "/apollo/env/Ssdf/lib/python2.7/site-packages/matplotlib/__init__.py", line
> 534, in _get_xdg_config_dir
> return os.environ.get('XDG_CONFIG_HOME', os.path.join(get_home(),
> '.config'))
>   File
> "/apollo/env/Ssdf/bin/../../../package/local_1/Linux-2.6c2.5-x86_64/Python27/Python27-487.0-0/lib/python2.7/posixpath.py",
> line 77, in join
> elif path == '' or path.endswith('/'):
> : 'NoneType' object has no attribute
> 'endswith'
>
> I have no home directory on my server (and probably don't have the
> permissions to create one). What is the correct way to fix this problem?
>
> Thanks!
>
> Paul
>
>
>
> --
> Is your legacy SCM system holding you back? Join Perforce May 7 to find
> out:
> • 3 signs your SCM is hindering your productivity
> • Requirements for releasing software faster
> • Expert tips and advice for migrating your SCM now
> http://p.sf.net/sfu/perforce
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
--
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
• 3 signs your SCM is hindering your productivity
• Requirements for releasing software faster
• Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] matplot crases because of XDG_CONFIG_HOME variable

2014-05-07 Thread Paul Tremblay
I am using matplotllib as part of web server. matplotlib causes my server
to crash with this error:

File "/apollo/env/Ssdf/lib/python2.7/site-packages/matplotlib/__init__.py",
line 597, in _get_configdir
return _get_config_or_cache_dir(_get_xdg_config_dir())
  File
"/apollo/env/Ssdf/lib/python2.7/site-packages/matplotlib/__init__.py", line
534, in _get_xdg_config_dir
return os.environ.get('XDG_CONFIG_HOME', os.path.join(get_home(),
'.config'))
  File
"/apollo/env/Ssdf/bin/../../../package/local_1/Linux-2.6c2.5-x86_64/Python27/Python27-487.0-0/lib/python2.7/posixpath.py",
line 77, in join
elif path == '' or path.endswith('/'):
: 'NoneType' object has no attribute
'endswith'

I have no home directory on my server (and probably don't have the
permissions to create one). What is the correct way to fix this problem?

Thanks!

Paul
--
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
• 3 signs your SCM is hindering your productivity
• Requirements for releasing software faster
• Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] basic pgf test fails

2014-05-07 Thread Eric Firing
On 2014/05/07 2:34 AM, Neal Becker wrote:
> Neal Becker wrote:
>
>> I tried the simple example, but all examples I try choke on savefig
>> ('blah.pdf') This is fedora20 linux, with pretty modern, complete texlive.
>>
>> I tried rm'ing tex-cache
>>
>>  example.py
>> # -*- coding: utf-8 -*-
>>
>> import matplotlib as mpl
>> mpl.use("pgf")
>> pgf_with_rc_fonts = {
>>  "font.family": "serif",
>>  "font.serif": [],   # use latex default serif font
>>  "font.sans-serif": ["DejaVu Sans"], # use a specific sans-serif font
>> }
>> mpl.rcParams.update(pgf_with_rc_fonts)
>>
>> import matplotlib.pyplot as plt
>> plt.figure(figsize=(4.5,2.5))
>> plt.plot(range(5))
>> plt.text(0.5, 3., "serif")
>> plt.text(0.5, 2., "monospace", family="monospace")
>> plt.text(2.5, 2., "sans-serif", family="sans-serif")
>> plt.text(2.5, 1., "comic sans", family="Comic Sans MS")
>> plt.xlabel(u"µ is not $\\mu$")
>> plt.tight_layout(.5)
>> --
>>
>> python testpgf.py
>> /usr/lib64/python2.7/site-packages/matplotlib/__init__.py:758: UserWarning:
>> Found matplotlib configuration in ~/.matplotlib/. To conform with the XDG 
>> base
>> directory standard, this configuration location has been deprecated on Linux,
>> and the new location is now '/home/nbecker/.config'/matplotlib/. Please move
>> your configuration there to ensure that matplotlib will continue to find it 
>> in
>> the future.
>>_get_xdg_config_dir())
>> Traceback (most recent call last):
>>File "testpgf.py", line 20, in 
>>  plt.tight_layout(.5)
>>File "/usr/lib64/python2.7/site-packages/matplotlib/pyplot.py", line 1255,
>>in
>> tight_layout
>>  fig.tight_layout(pad=pad, h_pad=h_pad, w_pad=w_pad, rect=rect)
>>File "/usr/lib64/python2.7/site-packages/matplotlib/figure.py", line 1600,
>>in
>> tight_layout
>>  renderer = get_renderer(self)
>>File "/usr/lib64/python2.7/site-packages/matplotlib/tight_layout.py", line
>> 222, in get_renderer
>>  renderer = canvas.get_renderer()
>>File
>>"/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_pgf.py",
>> line 925, in get_renderer
>>  return RendererPgf(self.figure, None, dummy=True)
>>File
>>"/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_pgf.py",
>> line 409, in __init__
>>  self.latexManager = LatexManagerFactory.get_latex_manager()
>>File
>>"/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_pgf.py",
>> line 223, in get_latex_manager
>>  new_inst = LatexManager()
>>File
>>"/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_pgf.py",
>> line 305, in __init__
>>  cwd=self.tmpdir)
>>File "/usr/lib64/python2.7/subprocess.py", line 711, in __init__
>>  errread, errwrite)
>>File "/usr/lib64/python2.7/subprocess.py", line 1308, in _execute_child
>>  raise child_exception
>> OSError: [Errno 2] No such file or directory
>>
> Figured it out.  problem is xelatex was not installed.  Too bad the traceback
> can't be more clear on this.

This sounds like something that can be fixed quite easily in mpl, and 
that if not fixed is likely to trip up other people. Would you turn this 
into a github issue, please?  Or, a PR?

Thank you.

Eric


>
>
>
> --
> Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
> • 3 signs your SCM is hindering your productivity
> • Requirements for releasing software faster
> • Expert tips and advice for migrating your SCM now
> http://p.sf.net/sfu/perforce
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>


--
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
• 3 signs your SCM is hindering your productivity
• Requirements for releasing software faster
• Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] basic pgf test fails

2014-05-07 Thread Neal Becker
Neal Becker wrote:

> I tried the simple example, but all examples I try choke on savefig
> ('blah.pdf') This is fedora20 linux, with pretty modern, complete texlive.
> 
> I tried rm'ing tex-cache
> 
>  example.py
> # -*- coding: utf-8 -*-
> 
> import matplotlib as mpl
> mpl.use("pgf")
> pgf_with_rc_fonts = {
> "font.family": "serif",
> "font.serif": [],   # use latex default serif font
> "font.sans-serif": ["DejaVu Sans"], # use a specific sans-serif font
> }
> mpl.rcParams.update(pgf_with_rc_fonts)
> 
> import matplotlib.pyplot as plt
> plt.figure(figsize=(4.5,2.5))
> plt.plot(range(5))
> plt.text(0.5, 3., "serif")
> plt.text(0.5, 2., "monospace", family="monospace")
> plt.text(2.5, 2., "sans-serif", family="sans-serif")
> plt.text(2.5, 1., "comic sans", family="Comic Sans MS")
> plt.xlabel(u"µ is not $\\mu$")
> plt.tight_layout(.5)
> --
> 
> python testpgf.py
> /usr/lib64/python2.7/site-packages/matplotlib/__init__.py:758: UserWarning:
> Found matplotlib configuration in ~/.matplotlib/. To conform with the XDG base
> directory standard, this configuration location has been deprecated on Linux,
> and the new location is now '/home/nbecker/.config'/matplotlib/. Please move
> your configuration there to ensure that matplotlib will continue to find it in
> the future.
>   _get_xdg_config_dir())
> Traceback (most recent call last):
>   File "testpgf.py", line 20, in 
> plt.tight_layout(.5)
>   File "/usr/lib64/python2.7/site-packages/matplotlib/pyplot.py", line 1255,
>   in
> tight_layout
> fig.tight_layout(pad=pad, h_pad=h_pad, w_pad=w_pad, rect=rect)
>   File "/usr/lib64/python2.7/site-packages/matplotlib/figure.py", line 1600,
>   in
> tight_layout
> renderer = get_renderer(self)
>   File "/usr/lib64/python2.7/site-packages/matplotlib/tight_layout.py", line
> 222, in get_renderer
> renderer = canvas.get_renderer()
>   File
>   "/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_pgf.py",
> line 925, in get_renderer
> return RendererPgf(self.figure, None, dummy=True)
>   File
>   "/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_pgf.py",
> line 409, in __init__
> self.latexManager = LatexManagerFactory.get_latex_manager()
>   File
>   "/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_pgf.py",
> line 223, in get_latex_manager
> new_inst = LatexManager()
>   File
>   "/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_pgf.py",
> line 305, in __init__
> cwd=self.tmpdir)
>   File "/usr/lib64/python2.7/subprocess.py", line 711, in __init__
> errread, errwrite)
>   File "/usr/lib64/python2.7/subprocess.py", line 1308, in _execute_child
> raise child_exception
> OSError: [Errno 2] No such file or directory
> 
Figured it out.  problem is xelatex was not installed.  Too bad the traceback 
can't be more clear on this.



--
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
• 3 signs your SCM is hindering your productivity
• Requirements for releasing software faster
• Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users