Re: [Matplotlib-users] Multiple lines of xtick_labels

2014-08-15 Thread Thomas Caswell
Use the `pad` property which sets how far the tick labels are from the axis.

ax1.tick_params(axis='x',which='minor',bottom='off',top='off', pad=25)

iirc, the units on pad are font-points

Tom

On Fri, Aug 15, 2014 at 5:21 PM, Sterling Smith smit...@fusion.gat.com wrote:
 How about prepending '\n' to your minor labels?

 On Aug 15, 2014, at 1:38PM, Ted To wrote:

 Hi,

 I'm trying to set two lines of xtick_labels But I can't figure out how
 to get them on separate lines.  These are for errorbars where I have two
 variables for each of four categories.  Using the following code, I'm
 able to create the attached figure.  How does one move the minor
 xtick_labels to a 2nd line?  A minor problem that maybe someone knows
 the answer to is, how do I increase the width of the x axis so that
 there is some space before and after the first and last ticks?
 (ax1.set_xlim(-.5,7.5) does not seem to work.)

 Many thanks,
 Ted

 fig,ax1=plt.subplots()
 ax1.errorbar(wageAllTypes.index,wageAllTypes['mean'],yerr=wageAllTypes['sd'],fmt='bo')
 xticks=[0,1,2,3,4,5,6,7]
 xticks_minor=[.5,2.5,4.5,6.5]
 ax1.set_xticks(xticks)
 ax1.set_xticks(xticks_minor, minor=True)
 ax1.set_xticklabels(['All Jobs','Job 1','Job 2','Job 3'],minor=True)
 ax1.set_xticklabels([r'$w$',r'$\xi$',r'$w$',r'$\xi$',r'$w$',r'$\xi$',r'$w$',r'$\xi$]')

 ax1.tick_params(axis='x',which='major')
 ax1.tick_params(axis='x',which='minor',bottom='off',top='off')
 ax1.set_ylabel(r'$\ln w$',ha='right',rotation='horizontal')

 ax2 = ax1.twinx()
 ax2.errorbar(xiAllTypes.index,xiAllTypes['mean'],yerr=xiAllTypes['sd'],fmt='ro')
 ax2.set_ylabel(r'$\xi$',ha='left',rotation='horizontal')
 figure_1.png--
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


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



-- 
Thomas Caswell
tcasw...@gmail.com

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


Re: [Matplotlib-users] pick_event after zooming/panning stops working.

2014-08-21 Thread Thomas Caswell
On Thu, Aug 21, 2014 at 9:44 AM, Michael Kaufman kaufma...@ornl.gov wrote:

# plot axvlines here... etc.

global cids

# remove any previous connections
for i in cids:
   gcf().canvas.mpl_disconnect(i)
cids = []

cids.append(gcf().canvas.mpl_connect('pick_event',self.pick))
cids.append(gcf().canvas.mpl_connect('button_press_event',self.click))

draw()

 def pick(self, event):
thisline = event.artist
xdata, ydata = thisline.get_data()
print xdata[0]

 def click(self, event):
print clicked


See this minimal example

```
import matplotlib.pyplot as plt
fig, ax = plt.subplots()

ax.axvline(.5, picker=6)
ax.plot(range(3))
cids = []

plt.draw()

def pick(event):
   thisline = event.artist
   xdata, ydata = thisline.get_data()
   print xdata[0]

def click(event):
   print clicked


cids.append(fig.canvas.mpl_connect('pick_event', pick))
cids.append(fig.canvas.mpl_connect('button_press_event', click))

```

If you turn the zoom/pan tool off the picker works again.  I suspect
that there is some logic underneath those tools that are snarfing
events when the are turned on to avoid messy conflicts.  There is some
work going on (MEP22 iirc) to update the toolbar and make our tool
handling saner.

Tom
-- 
Thomas Caswell
tcasw...@gmail.com

--
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] matplotlib v1.4.0 released

2014-08-26 Thread Thomas Caswell
We are pleased to announce the release of matplotlib 1.4.0!

This release has contributions from ~170 authors
(http://matplotlib.org/users/github_stats.html).

This release contains many bug fixes as will as a number of new
features.  For the full list see
http://matplotlib.org/users/whats_new.html#new-in-matplotlib-1-4.
Some highlights are:

  - style module : experimental package to make managing the style of
matplotlib figures easier
  - nbagg : interactive figures in ipython notebooks backed by the AGG renderer
  - full python 3 support (including cairo backends)
  - Qt5 support (for python 3 only)
  - violin plots and 3D quiver plots (projects done for a course at
University of Toronto, Scarborough)
  - new box plot interface (as bxp)

The release can be installed via pip (but requires local compilation)

Tarballs are available at:
  - 
http://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-1.4.0/matplotlib-1.4.0.tar.gz
  - https://github.com/matplotlib/matplotlib/archive/v1.4.0.tar.gz
  - https://pypi.python.org/packages/source/m/matplotlib/matplotlib-1.4.0.tar.gz

Windows install binaries and wheels are available (thanks to Christoph
Gohlke) at 
http://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-1.4.0/
.

Mac OSX wheels are available (thanks to Matthew Brett) from
http://wheels.scikit-image.org .


The Matplotlib Team

--
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] 1.4 install on Windows 8.1 with pip gives bad hash

2014-08-27 Thread Thomas Caswell
Is the hash it reports reproducible?  My first guess at what is going
on here is that the hash is doing it's job correctly and reporting
that your file became corupted  during download.  Try again at it
should work.

Tom

On Wed, Aug 27, 2014 at 5:55 AM, Werner werner...@gmx.ch wrote:
 Just FYI,

 I tried to install with pip but got the following error.

 C:\Python34\Scriptspip install -U matplotlib
 Downloading/unpacking matplotlib
Hash of the package
 https://pypi.python.org/packages/source/m/matplotlib/matplotlib-1.4.0.tar.gz#md5=1daf7f2123d94745f
 eac1a30b210940c (from https://pypi.python.org/simple/matplotlib/)
 (b3547692387bce383d7a001a8e03ce87) doesn't match the e
 xpected hash 1daf7f2123d94745feac1a30b210940c!
 Cleaning up...

 Werner

 P.S.
 I installed using the .exe installer without problems.

 --
 Slashdot TV.
 Video for Nerds.  Stuff that matters.
 http://tv.slashdot.org/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users



-- 
Thomas Caswell
tcasw...@gmail.com

--
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Basemap shiftgrid

2014-08-27 Thread Thomas Caswell
Is this related to https://github.com/matplotlib/basemap/issues/163 ?

On Wed, Aug 27, 2014 at 5:41 AM, ChaoYue chaoyue...@gmail.com wrote:
 Hi Michelle,

 I might not fully understand your problem, could you have a look at this
 thread and see if it helps?

 http://matplotlib.1069221.n5.nabble.com/Fwd-Strange-behaviour-on-plotting-data-on-Ronbinson-projection-using-Basemap-td43222.html#a43233

 Cheers,

 Chao


 On Wed, Aug 27, 2014 at 9:58 AM, mmc [via matplotlib] [hidden email]
 wrote:

 Hi All,

 I am having problems plotting data in Basemap. I have tried some of the
 different projections such as Robinson and Equidistant Cylindrical, however
 kept running into the error

 WARNING: x coordinate not monotonically increasing - contour plot
 may not be what you expect.  If it looks odd, your can either
 adjust the map projection region to be consistent with your data, or
 (if your data is on a global lat/lon grid) use the shiftgrid
 function to adjust the data to be consistent with the map projection
 region (see examples/contour_demo.py).


 Having read some other forums, I see that it is due to the fact that the
 longitude is based on 0-360 rather that -180 to 180. I have been trying to
 rectify this with shiftgrid.

 I have used shiftgrid and have moved my longitudes to -180 to 180 however
 I keep running up with the error:


 ValueError: lon0 outside of range of lonsin


 I also manage to get one plot out, which has the right projection I want
 (I am looking over the Atlantic) however the data isnt shifting in line with
 the longitudes. Would anyone know why this is the case?

 I have am using shiftgrid as below and the Basemap projection of
 Equidistant cylindrical (I have also tried Robinson however end up with
 similar result of data not moving in line with the longitude)

 MSLP = aso_mslp.data
 MSLP_background = np.mean(MSLP, axis = 0)

 # shifting grid to run from -180 to 180 rather than 0-360
 MSLP_background,lon = shiftgrid(180., MSLP_background, lon,
 start=False)

 #setting the map in order to plot the data
 map = Basemap(projection ='cyl', llcrnrlat=-90, urcrnrlat=90,
 llcrnrlon=-180, urcrnrlon=180, resolution='c')

 Thanks
 Michelle

 
 If you reply to this email, your message will be added to the discussion
 below:
 http://matplotlib.1069221.n5.nabble.com/Basemap-shiftgrid-tp43851.html
 To start a new topic under matplotlib - users, email [hidden email]
 To unsubscribe from matplotlib, click here.
 NAML




 --
 please visit:
 http://www.globalcarbonatlas.org/
 ***
 Chao YUE
 Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
 UMR 1572 CEA-CNRS-UVSQ
 Batiment 712 - Pe 119
 91191 GIF Sur YVETTE Cedex
 Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16
 

 
 View this message in context: Re: Basemap shiftgrid

 Sent from the matplotlib - users mailing list archive at Nabble.com.

 --
 Slashdot TV.
 Video for Nerds.  Stuff that matters.
 http://tv.slashdot.org/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users




-- 
Thomas Caswell
tcasw...@gmail.com

--
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] 1.4 install on Windows 8.1 with pip gives bad hash

2014-08-27 Thread Thomas Caswell
Didn't know you could do that

I have (I think) uploaded all of the wheels we have to pypi.  I don't
have a windows or mac machine to test on, can anyone provide feed back
if it worked as intended?

Tom

On Wed, Aug 27, 2014 at 12:20 PM, Christoph Gohlke cgoh...@uci.edu wrote:
 Somewhat related to this: are the Windows and Mac wheels going to be
 uploaded to PyPI so pip doesn't try to install/build from the source
 distribution by default?

 Christoph

 On 8/27/2014 5:33 AM, Thomas Caswell wrote:
 Is the hash it reports reproducible?  My first guess at what is going
 on here is that the hash is doing it's job correctly and reporting
 that your file became corupted  during download.  Try again at it
 should work.

 Tom

 On Wed, Aug 27, 2014 at 5:55 AM, Werner werner...@gmx.ch wrote:
 Just FYI,

 I tried to install with pip but got the following error.

 C:\Python34\Scriptspip install -U matplotlib
 Downloading/unpacking matplotlib
 Hash of the package
 https://pypi.python.org/packages/source/m/matplotlib/matplotlib-1.4.0.tar.gz#md5=1daf7f2123d94745f
 eac1a30b210940c (from https://pypi.python.org/simple/matplotlib/)
 (b3547692387bce383d7a001a8e03ce87) doesn't match the e
 xpected hash 1daf7f2123d94745feac1a30b210940c!
 Cleaning up...

 Werner

 P.S.
 I installed using the .exe installer without problems.

 --
 Slashdot TV.
 Video for Nerds.  Stuff that matters.
 http://tv.slashdot.org/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users




 --
 Slashdot TV.
 Video for Nerds.  Stuff that matters.
 http://tv.slashdot.org/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users



-- 
Thomas Caswell
tcasw...@gmail.com

--
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] violin plot

2014-08-28 Thread Thomas Caswell
We also welcome PRs!  Adding that feature should be pretty straight
forward.

Iirc it should be a matter of adding an extra key to the dictionary and a
conditional to draw the lines if those keys exist.

Tom
On Aug 27, 2014 4:57 PM, Arnaldo Russo arnaldoru...@gmail.com wrote:

 Hi Neal,
 I don't know if you need exclusively matplotlib tools to apply your violin
 plot, but seaborn package [1, 2] do this very well.
 I hope you enjoy it!
 Cheers,
 Arnaldo.

 [1]
 http://web.stanford.edu/~mwaskom/software/seaborn/examples/violinplots.html
 [2] https://github.com/mwaskom/seaborn


 ---
 *Arnaldo D'Amaral Pereira Granja Russo*
 Lab. de Estudos dos Oceanos e Clima
 Instituto de Oceanografia - FURG




 2014-08-27 12:15 GMT-03:00 Neal Becker ndbeck...@gmail.com:

 I'm pleased to see violinplot added to mpl-1.4.  One question.  I might
 like to
 annotate with some statistic.  Like boxplot can show quantiles.  I might
 like to
 show either quantiles, or some other statistic (3 sigma) on my violinplot.
 After all, violinplot is advertised as an improved boxplot, but it seems
 to be
 missing this feature.

 --
 -- Those who don't understand recursion are doomed to repeat it



 --
 Slashdot TV.
 Video for Nerds.  Stuff that matters.
 http://tv.slashdot.org/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users




 --
 Slashdot TV.
 Video for Nerds.  Stuff that matters.
 http://tv.slashdot.org/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Error in atexit._run_exitfuncs

2014-09-15 Thread Thomas Caswell
Can you provide a minimal example that will trigger the bug?

From the description you have given we don't have enough information
to diagnose the problem.

Ben thinks this is related to some long-standing issues, if you could
help us track them down it would be greatly appreciated.

Tom

On Mon, Sep 15, 2014 at 7:19 AM, keithbriggs keith.bri...@bt.com wrote:
 I am still getting this error, this time with matplotlib.pyplot.matshow, and
 I do not get any plot.   This bug really needs to be fixed!



 --
 View this message in context: 
 http://matplotlib.1069221.n5.nabble.com/Error-in-atexit-run-exitfuncs-tp43566p43947.html
 Sent from the matplotlib - users mailing list archive at Nabble.com.

 --
 Want excitement?
 Manually upgrade your production database.
 When you want reliability, choose Perforce
 Perforce version control. Predictably reliable.
 http://pubads.g.doubleclick.net/gampad/clk?id=157508191iu=/4140/ostg.clktrk
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users



-- 
Thomas Caswell
tcasw...@gmail.com

--
Want excitement?
Manually upgrade your production database.
When you want reliability, choose Perforce
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Error in atexit._run_exitfuncs

2014-09-15 Thread Thomas Caswell
What versions of things are you using (python, mpl, gtk, gtk's python
bindings, and cairo) and how did you install them?

Can you also include the full backtrace?

On Mon, Sep 15, 2014 at 8:28 AM,  keith.bri...@bt.com wrote:
 How's this for minimal?

 from matplotlib import pyplot as plt
 plt.matshow([[0.0]])

 It crashes with the FigureManagerGTK3Cairo error.
 Keith


 -Original Message-
 From: Thomas Caswell [mailto:tcasw...@gmail.com]
 Sent: 15 September 2014 13:23
 To: Briggs,KM,Keith,TUB2 R
 Cc: matplotlib-users@lists.sourceforge.net
 Subject: Re: [Matplotlib-users] Error in atexit._run_exitfuncs

 Can you provide a minimal example that will trigger the bug?

 From the description you have given we don't have enough information to 
 diagnose the problem.

 Ben thinks this is related to some long-standing issues, if you could help us 
 track them down it would be greatly appreciated.

 Tom

 On Mon, Sep 15, 2014 at 7:19 AM, keithbriggs keith.bri...@bt.com wrote:
 I am still getting this error, this time with matplotlib.pyplot.matshow, and
 I do not get any plot.   This bug really needs to be fixed!



 --
 View this message in context:
 http://matplotlib.1069221.n5.nabble.com/Error-in-atexit-run-exitfuncs-
 tp43566p43947.html Sent from the matplotlib - users mailing list
 archive at Nabble.com.

 --
 
 Want excitement?
 Manually upgrade your production database.
 When you want reliability, choose Perforce Perforce version control.
 Predictably reliable.
 http://pubads.g.doubleclick.net/gampad/clk?id=157508191iu=/4140/ostg.
 clktrk ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users



 --
 Thomas Caswell
 tcasw...@gmail.com



-- 
Thomas Caswell
tcasw...@gmail.com

--
Want excitement?
Manually upgrade your production database.
When you want reliability, choose Perforce
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] FW: traceback when import matplotlib.pyplot twice

2014-10-10 Thread Thomas Caswell
Something is going really sideways on your system as `Gcf` is the
class that the static method is a member of.  If you have the method
to call it, then you have the class defined.

My guess is there is some race condition is the cleanup-at-exit code
where the system is cleaning up the class object before this function
is getting run.

I suspect a better fix is to change all of the staticmethods - classmethods

Tom

On Fri, Oct 10, 2014 at 1:38 PM, Mark Janikas mjani...@esri.com wrote:
 Thanks for pointer on the None…. Just got the future warning in my code when
 comparing a numpy array param in a class of mine that defaults to None.
 That should be solved differently… but I have plenty of other params that
 default to None and I will change them accordingly….



 Back to the traceback… it occurs on matplotlib 1.3 AND 1.4



 TY,



 MJ



 From: ben.v.r...@gmail.com [mailto:ben.v.r...@gmail.com] On Behalf Of
 Benjamin Root
 Sent: Wednesday, October 8, 2014 6:20 PM
 To: Mark Janikas
 Cc: Matplotlib Users
 Subject: Re: [Matplotlib-users] FW: traceback when import matplotlib.pyplot
 twice



 Which version of matplotlib and which backend?

 Also, don't use == or != when comparing to None. Use is and is not.

 Ben Root


 --
 Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
 Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
 Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
 Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
 http://p.sf.net/sfu/Zoho
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users




-- 
Thomas Caswell
tcasw...@gmail.com

--
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://p.sf.net/sfu/Zoho
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Quiver 3D ValueError

2014-10-10 Thread Thomas Caswell
You need 1.4.0 as the 3D quiver code is not in 1.3.1.

On Fri, Oct 10, 2014 at 5:02 PM, Thomas Proctor
theproctona...@gmail.com wrote:
 I'm trying to generate a 3D quiver plot.  When I try running the sample
 available at
 http://matplotlib.org/mpl_examples/mplot3d/quiver3d_demo.py
 I get a ValueError: too many values to unpack error.  I'm using matplotlib
 1.3.1 (the version available on the Ubuntu repositories).

 Does anyone know what's up with this?  I'm assuming that this sample will
 work if I had the right version, can anyone tell me what version I would
 need?

 Thanks!



 --
 Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
 Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
 Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
 Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
 http://p.sf.net/sfu/Zoho
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users




-- 
Thomas Caswell
tcasw...@gmail.com

--
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://p.sf.net/sfu/Zoho
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] FW: traceback when import matplotlib.pyplot twice

2014-10-11 Thread Thomas Caswell
See https://github.com/matplotlib/matplotlib/pull/3638

That might help to make sure that things tear them selves down in the
right order.

Tom

On Sat, Oct 11, 2014 at 10:12 AM, Phil Elson pelson@gmail.com wrote:

 On 10 October 2014 19:10, Thomas Caswell tcasw...@gmail.com wrote:

 I suspect a better fix is to change all of the staticmethods -
 classmethods



 +1



-- 
Thomas Caswell
tcasw...@gmail.com

--
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://p.sf.net/sfu/Zoho
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] v1.4.1rc1

2014-10-14 Thread Thomas Caswell
I am happy to announce that I have tagged a release candidate for
1.4.1.  This is a bug-fix release which fixes most of the bug that
popped up in 1.4.0 including:

 - setup.py does not die when freetype is not installed
 - reverts the changes to interactive plotting so `ion` will work as expected
 - sundry unicode fixes (looking up user folders, importing
seaborn/pandas/networkx with macosx backend
 - fixed boxplot regressions

The tarball is available from github, sourceforge and can be install via

   pip install matplotlib==1.4.1rc1

Tom



-- 
Thomas Caswell
tcasw...@gmail.com

--
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] [matplotlib-devel] v1.4.1rc1

2014-10-16 Thread Thomas Caswell
Awesome, thanks!

On Thu, Oct 16, 2014 at 8:14 AM, Sandro Tosi mo...@debian.org wrote:
 Hi!
 I just uploaded mpl 1.4.1-rc1 in Debian, so it can geta  bit of
 exposure even on the weird HW we still support.

 Cheers,
 Sandro

 On Tue, Oct 14, 2014 at 5:40 PM, Thomas Caswell tcasw...@gmail.com wrote:
 I am happy to announce that I have tagged a release candidate for
 1.4.1.  This is a bug-fix release which fixes most of the bug that
 popped up in 1.4.0 including:

  - setup.py does not die when freetype is not installed
  - reverts the changes to interactive plotting so `ion` will work as expected
  - sundry unicode fixes (looking up user folders, importing
 seaborn/pandas/networkx with macosx backend
  - fixed boxplot regressions

 The tarball is available from github, sourceforge and can be install via

pip install matplotlib==1.4.1rc1

 Tom



 --
 Thomas Caswell
 tcasw...@gmail.com

 --
 Comprehensive Server Monitoring with Site24x7.
 Monitor 10 servers for $9/Month.
 Get alerted through email, SMS, voice calls or mobile push notifications.
 Take corrective actions from your mobile device.
 http://p.sf.net/sfu/Zoho
 ___
 Matplotlib-devel mailing list
 matplotlib-de...@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-devel



 --
 Sandro Tosi (aka morph, morpheus, matrixhasu)
 My website: http://matrixhasu.altervista.org/
 Me at Debian: http://wiki.debian.org/SandroTosi



-- 
Thomas Caswell
tcasw...@gmail.com

--
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Matplotlib import fail

2014-10-16 Thread Thomas Caswell
Tobais,

In the future please send all messages like this to the user mailing list (cc'd)

Try using the 1.4.1rc1 release candidate, there are windows installers
on sourceforge.  If that does not work, please open a new github
issue.

Tom

On Thu, Oct 16, 2014 at 2:43 PM, Tobias Landwehr dolly-klonsc...@gmx.de wrote:
 Greetings Thomas,

 I am sorry to disturb you, but I found on github, that you could've already
 provided a solution to my problem almost three weeks ago. I couldn't really
 understand the way how to solve the prob, which is the reason I decided to
 write you.

 I am currently working with Python 2.7.2 and want to import the matplotlib.
 Problems arise obviously since my username-folder contains a non-ascii sign
 (german Ä). I would prefer to not setup a second user and the user's folder
 shouldn't/can't be renamed.

 If you could find some time to deal with the problem over the weekend or
 give me a hint, how to solve it, I would be really grateful. Below you'll
 find the fail report.

 Many thanks in advance, Tobias

 Traceback (most recent call last):
   File C:\Python27\workspace\ITT\src\itt\statistics\block01\LandCover.py,
 line 7, in module
 import matplotlib.pyplot as plt
   File C:\Python27\lib\site-packages\matplotlib\__init__.py, line 1048, in
 module
 rcParams = rc_params()
   File C:\Python27\lib\site-packages\matplotlib\__init__.py, line 897, in
 rc_params
 fname = matplotlib_fname()
   File C:\Python27\lib\site-packages\matplotlib\__init__.py, line 759, in
 matplotlib_fname
 configdir = _get_configdir()
   File C:\Python27\lib\site-packages\matplotlib\__init__.py, line 630, in
 _get_configdir
 return _get_config_or_cache_dir(_get_xdg_config_dir())
   File C:\Python27\lib\site-packages\matplotlib\__init__.py, line 555, in
 _get_xdg_config_dir
 path = get_home()
   File C:\Python27\lib\site-packages\matplotlib\__init__.py, line 323, in
 wrapper
 ret = func(*args, **kwargs)
   File C:\Python27\lib\site-packages\matplotlib\__init__.py, line 509, in
 _get_home
 path = os.path.expanduser(~)
   File C:\Python27\lib\ntpath.py, line 310, in expanduser
 return userhome + path[i:]
 UnicodeDecodeError: 'ascii' codec can't decode byte 0x84 in position 16:
 ordinal not in range(128)




-- 
Thomas Caswell
tcasw...@gmail.com

--
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] _backend_gdk.c:43:10: error: ‘PyArrayObject’ has no member named ‘strides’

2014-10-17 Thread Thomas Caswell
What OS and what branch are you using?

Can you roll back to one commit before the most recent merge?
https://github.com/matplotlib/matplotlib/pull/3547 updated the numpy
api.  If that fixes it, please make a new issue on github reporting
the problem.



Tom

On Fri, Oct 17, 2014 at 12:42 PM, Nils Wagner nils...@googlemail.com wrote:
 Hi all,

 I cannot build matplotlib from git

 src/_backend_gdk.c: In function ‘pixbuf_get_pixels_array’:
 src/_backend_gdk.c:43:10: error: ‘PyArrayObject’ has no member named
 ‘strides’
 src/_backend_gdk.c:46:10: error: ‘PyArrayObject’ has no member named ‘base’
 error: command '/usr/bin/gcc' failed with exit status 1


 --
 Comprehensive Server Monitoring with Site24x7.
 Monitor 10 servers for $9/Month.
 Get alerted through email, SMS, voice calls or mobile push notifications.
 Take corrective actions from your mobile device.
 http://p.sf.net/sfu/Zoho
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users




-- 
Thomas Caswell
tcasw...@gmail.com

--
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] _backend_gdk.c:43:10: error: ‘PyArrayObject’ has no member named ‘strides’

2014-10-17 Thread Thomas Caswell
Please try with commit 7f71233d55683b1c1bda1b365b61f912f8a154df

What version of numpy are you using, we only support 1.6+

Tom

On Fri, Oct 17, 2014 at 1:35 PM, Nils Wagner nils...@googlemail.com wrote:
 I am using

 commit 0f4a68d3b75ae5ef192b1c90d876e18ff9de86c5
 Merge: 7f71233 b279c15
 Author: Thomas A Caswell tcasw...@gmail.com
 Date:   Fri Oct 17 10:45:39 2014 -0400

 on opensuse12.3


 On Fri, Oct 17, 2014 at 7:14 PM, Thomas Caswell tcasw...@gmail.com wrote:

 What OS and what branch are you using?

 Can you roll back to one commit before the most recent merge?
 https://github.com/matplotlib/matplotlib/pull/3547 updated the numpy
 api.  If that fixes it, please make a new issue on github reporting
 the problem.



 Tom

 On Fri, Oct 17, 2014 at 12:42 PM, Nils Wagner nils...@googlemail.com
 wrote:
  Hi all,
 
  I cannot build matplotlib from git
 
  src/_backend_gdk.c: In function ‘pixbuf_get_pixels_array’:
  src/_backend_gdk.c:43:10: error: ‘PyArrayObject’ has no member named
  ‘strides’
  src/_backend_gdk.c:46:10: error: ‘PyArrayObject’ has no member named
  ‘base’
  error: command '/usr/bin/gcc' failed with exit status 1
 
 
 
  --
  Comprehensive Server Monitoring with Site24x7.
  Monitor 10 servers for $9/Month.
  Get alerted through email, SMS, voice calls or mobile push
  notifications.
  Take corrective actions from your mobile device.
  http://p.sf.net/sfu/Zoho
  ___
  Matplotlib-users mailing list
  Matplotlib-users@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/matplotlib-users
 



 --
 Thomas Caswell
 tcasw...@gmail.com





-- 
Thomas Caswell
tcasw...@gmail.com

--
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] matplotlib v1.4.1 released

2014-10-18 Thread Thomas Caswell
Hello,

We are pleased to announce the release of matplotlib 1.4.1.

This is a bug-fix release for the 1.4 series.

 - reverts the changes to interactive plotting so ion will work as
before in all cases fixed boxplot regressions
 - fixes for finding freetype and libpng
 - sundry unicode fixes (looking up user folders, importing
seaborn/pandas/networkx with macosx backend)
 - nbagg works with python 3 + new font awesome
 - fixed saving dialogue in QT5

Source tarballs are available on sourceforge, github, and pypi.  In
addition wheels for both mac and windows are available on both pypi
and source forge and windows executable installers are available on
source forge.

http://matplotlib.org/downloads.html

https://pypi.python.org/pypi/matplotlib/1.4.1

The matplotlib dev team

--
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] matplotlib v1.4.2

2014-10-25 Thread Thomas Caswell
Hot on the tails of v1.4.1, we have a v1.4.2 due to an error in the boxplot
api in pyplot.py

The only changes between 1.4.1 and 1.4.2 are:

 - corrected boxplot in pyplot.py
 - added extra paths to default search paths for freetype

Tom

-- 
Thomas Caswell
tcasw...@gmail.com
--
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Equivalent of d3's step-after interpolation?

2014-10-30 Thread Thomas Caswell
https://stackoverflow.com/questions/12841847/step-function-in-matplotlib/12846384#12846384
is a much better example of how to control the step function.

On Thu, Oct 30, 2014 at 1:01 PM, Pierre Haessig
pierre.haes...@crans.org wrote:
 You might also be interested in
 http://stackoverflow.com/questions/15188005/linestyle-in-matplotlib-step-function
 which details the `drawstyle` parameters. It can be set to 'steps-post'
 for example.

 The only case I was not able to cover with this parameter are the
 fill_between plots, because they do not use Line objects...

 --
 Pierre

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



-- 
Thomas Caswell
tcasw...@gmail.com

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


[Matplotlib-users] Fwd: tex rendering broken?

2014-11-03 Thread Thomas Caswell
Forwarding message to list that should have gone there initialy for
archiving.

-- Forwarded message --
From: Thomas Caswell tcasw...@gmail.com
Date: Mon, Nov 3, 2014 at 7:50 AM
Subject: Re: [Matplotlib-users] tex rendering broken?
To: Martin Wiebusch mwiebusc...@gmail.com


My first guess is that there is that some thing wrong with your latex
installation as the images on the website are regenerated as part of
building the documentation.

I can not reproduce this problem on a 1.4.2 installation on my computer.
Try cleaning out the tex.cache folder in either or both of
matplotlib.get_cachedir() or matplotlib.get_configdir().

Tom


On Mon, Nov 3, 2014, 06:24 Martin Wiebusch mwiebusc...@gmail.com wrote:

 I just downgraded to matplotlib 1.1.1 and now everything works. Looks
 like a regression to me.

 On Fri, 2014-10-31 at 15:53 +, Martin Wiebusch wrote:
  I am having trouble executing the example for typesetting labels with
  latex from http://matplotlib.org/users/usetex.html. Copying the standard
  example, tex_demo.py, to a file and executing it gives the following
  output:
 
  Traceback (most recent call last):
File scratch.py, line 21, in module
  plt.savefig('tex_demo')
File /usr/lib/pymodules/python2.7/matplotlib/pyplot.py, line 561, in
  savefig
  return fig.savefig(*args, **kwargs)
File /usr/lib/pymodules/python2.7/matplotlib/figure.py, line 1421,
  in savefig
  self.canvas.print_figure(*args, **kwargs)
File /usr/lib/pymodules/python2.7/matplotlib/backend_bases.py, line
  2220, in print_figure
  **kwargs)
File
  /usr/lib/pymodules/python2.7/matplotlib/backends/backend_agg.py, line
  505, in print_png
  FigureCanvasAgg.draw(self)
File
  /usr/lib/pymodules/python2.7/matplotlib/backends/backend_agg.py, line
  451, in draw
  self.figure.draw(self.renderer)
File /usr/lib/pymodules/python2.7/matplotlib/artist.py, line 55, in
  draw_wrapper
  draw(artist, renderer, *args, **kwargs)
File /usr/lib/pymodules/python2.7/matplotlib/figure.py, line 1034,
  in draw
  func(*args)
File /usr/lib/pymodules/python2.7/matplotlib/artist.py, line 55, in
  draw_wrapper
  draw(artist, renderer, *args, **kwargs)
File /usr/lib/pymodules/python2.7/matplotlib/axes.py, line 2086, in
  draw
  a.draw(renderer)
File /usr/lib/pymodules/python2.7/matplotlib/artist.py, line 55, in
  draw_wrapper
  draw(artist, renderer, *args, **kwargs)
File /usr/lib/pymodules/python2.7/matplotlib/axis.py, line 1105, in
  draw
  self.label.draw(renderer)
File /usr/lib/pymodules/python2.7/matplotlib/artist.py, line 55, in
  draw_wrapper
  draw(artist, renderer, *args, **kwargs)
File /usr/lib/pymodules/python2.7/matplotlib/text.py, line 594, in
  draw
  self._fontproperties, angle, mtext=self)
File
  /usr/lib/pymodules/python2.7/matplotlib/backends/backend_agg.py, line
  241, in draw_tex
  self._renderer.draw_text_image(Z, x, y, angle, gc)
  OverflowError: cannot convert float infinity to integer
 
  My system is
 
  Linux mwlaptop 3.16.0-24-generic #32-Ubuntu SMP Tue Oct 28 13:07:32 UTC
  2014 x86_64 x86_64 x86_64 GNU/Linux
 
  My matplotlib version is 1.3.1, and I am using standard packages from my
  Ubuntu 14.10 distribution.
 
 



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




-- 
Thomas Caswell
tcasw...@gmail.com
--
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Fwd: tex rendering broken?

2014-11-03 Thread Thomas Caswell
Forwarding message to list that should have gone there initialy for
archiving.

-- Forwarded message --
From: Martin Wiebusch mwiebusc...@gmail.com
Date: Mon, Nov 3, 2014 at 8:26 AM
Subject: Re: [Matplotlib-users] tex rendering broken?
To: Thomas Caswell tcasw...@gmail.com


On Mon, 2014-11-03 at 07:50 -0500, Thomas Caswell wrote:
 I can not reproduce this problem on a 1.4.2 installation on my
 computer.  Try cleaning out the tex.cache folder in either or both of

 matplotlib.get_cachedir() or matplotlib.get_configdir().

Thanks. Clearing the cache directory did the trick. It might be a good
idea to mention matplotlib.get_cachedir() and matplotlib.get_configdir()
explicitly under 'Troubleshooting' on the web page. Currently there is a
link which points you to matplotlib.get_configdir() (which was empty in
my case) but not matplotlib.get_cachedir().

Best regards,
Martin.






-- 
Thomas Caswell
tcasw...@gmail.com
--
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Defaults?

2014-11-07 Thread Thomas Caswell
The style module (extracted from mpltools) is now part of the library and
was one of the major features added in the 1.4 series.

See http://matplotlib.org/users/style_sheets.html

Tom

On Fri Nov 07 2014 at 11:05:58 AM Adam Hughes hughesada...@gmail.com
wrote:

 I use a config file in ipython notebooks that sets some parameters of the
 ipython notebook and then sets the matplotlib defaults.


 http://nbviewer.ipython.org/github/hugadams/pyuvvis/blob/master/examples/Notebooks/NBCONFIG.ipynb

 Then I use in all subsequent analysis in the ipython notebook:


 http://nbviewer.ipython.org/urls/raw.github.com/hugadams/pyuvvis/master/examples/Notebooks/basic_units.ipynb

 On Fri, Nov 7, 2014 at 10:15 AM, Sebastian Berg 
 sebast...@sipsolutions.net wrote:

 Hey,

 just something I was wondering about today. I commonly want to change
 certain things about my plots. For example I like a serif/larger fonts,
 and everyone knows that jet is an awful default colour map almost
 always...

 It could be neat to have some more default rc's or so that can be
 loaded easily. I mean I could just create one for myself, but having
 some examples of what can be done and being able to switch that could be
 neat. Such as some defaults that are better for printing, maybe in
 matplotlib or really just on a website which shows some example plot for
 uploaded RCs.

 Anyway, just rambling :), I am not planning to really think about it
 much. And maybe some things even exist and I am not aware of it.

 Regards,

 Sebastian


 --

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


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

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


Re: [Matplotlib-users] Problem with event handling in matplotlib in tkinter

2014-11-07 Thread Thomas Caswell
The old-style classes are because mpl pre-dates new-style classes.  On
master all classes now inherit from object (as of about 3 weeks ago
https://github.com/matplotlib/matplotlib/pull/3662)



On Fri Nov 07 2014 at 2:02:15 PM Brendan Barnwell brenb...@brenbarn.net
wrote:

 On 2014-11-07 09:37, Benjamin Root wrote:
  Figured it out! The instance of Test() isn't being retained anywhere, so
  when it goes out of scope, the garbage collector eventually gets it. The
  fact that it works in py3k is likely a coincidence as the garbage
  collector would eventually have cleaned it up at some point. I don't
  know the scoping/garbage collection rules for lambdas, so I am guessing
  that they persist as they are part of the code as opposed to a
  de-reference-able (is that even a word?). Just save the instance of Test
  as a member variable of App, and you should be good to go!

 This note in cbook.py (which handles the callback registry)
 explains
 it. . . sort of:

 In practice, one should always disconnect all callbacks when they
 are no longer needed to avoid dangling references (and thus memory
 leaks).  However, real code in matplotlib rarely does so, and due
 to its design, it is rather difficult to place this kind of code.
 To get around this, and prevent this class of memory leaks, we
 instead store weak references to bound methods only, so when the
 destination object needs to die, the CallbackRegistry won't keep
 it alive.  The Python stdlib weakref module can not create weak
 references to bound methods directly, so we need to create a proxy
 object to handle weak references to bound methods (or regular free
 functions).  This technique was shared by Peter Parente on his
 `Mindtrove blog
 http://mindtrove.info/articles/python-weak-references/`_.

 Definitely a hidden trap!

 Also, speaking of the dangers of classes not inheriting from
 object, I
 noticed that CallbackRegistry in cbook.py is also an old-style class
 (doesn't inherit from object).  I then did a search and found numerous
 old-style classes throughout MPL.  Is there any reason for this?

 --
 Brendan Barnwell
 Do not follow where the path may lead.  Go, instead, where there is no
 path, and leave a trail.
 --author unknown

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

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


Re: [Matplotlib-users] Problem with event handling in matplotlib in tkinter

2014-11-07 Thread Thomas Caswell
I am also beginning to like the idea of hanging all of these things off of
FigureManager objects.  We have them around, but they are really only used
in pyplot (which is a shame) and seems a natural place to put all of these
aggregation type objects (list of animations, the toolbar stuff, the
navigation stuff, the blit-manager object I want to pull in from
scikit-image, etc).

@Federico, tell me if I am being dumb about this.

Tom

On Fri Nov 07 2014 at 2:05:29 PM Thomas Caswell tcasw...@gmail.com wrote:

 The old-style classes are because mpl pre-dates new-style classes.  On
 master all classes now inherit from object (as of about 3 weeks ago
 https://github.com/matplotlib/matplotlib/pull/3662)



 On Fri Nov 07 2014 at 2:02:15 PM Brendan Barnwell brenb...@brenbarn.net
 wrote:

 On 2014-11-07 09:37, Benjamin Root wrote:
  Figured it out! The instance of Test() isn't being retained anywhere, so
  when it goes out of scope, the garbage collector eventually gets it. The
  fact that it works in py3k is likely a coincidence as the garbage
  collector would eventually have cleaned it up at some point. I don't
  know the scoping/garbage collection rules for lambdas, so I am guessing
  that they persist as they are part of the code as opposed to a
  de-reference-able (is that even a word?). Just save the instance of Test
  as a member variable of App, and you should be good to go!

 This note in cbook.py (which handles the callback registry)
 explains
 it. . . sort of:

 In practice, one should always disconnect all callbacks when they
 are no longer needed to avoid dangling references (and thus memory
 leaks).  However, real code in matplotlib rarely does so, and due
 to its design, it is rather difficult to place this kind of code.
 To get around this, and prevent this class of memory leaks, we
 instead store weak references to bound methods only, so when the
 destination object needs to die, the CallbackRegistry won't keep
 it alive.  The Python stdlib weakref module can not create weak
 references to bound methods directly, so we need to create a proxy
 object to handle weak references to bound methods (or regular free
 functions).  This technique was shared by Peter Parente on his
 `Mindtrove blog
 http://mindtrove.info/articles/python-weak-references/`_.

 Definitely a hidden trap!

 Also, speaking of the dangers of classes not inheriting from
 object, I
 noticed that CallbackRegistry in cbook.py is also an old-style class
 (doesn't inherit from object).  I then did a search and found numerous
 old-style classes throughout MPL.  Is there any reason for this?

 --
 Brendan Barnwell
 Do not follow where the path may lead.  Go, instead, where there is no
 path, and leave a trail.
 --author unknown

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


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


Re: [Matplotlib-users] axes3d.get_test_data; where else is test data?

2014-11-07 Thread Thomas Caswell
Take a look at matplotlib.cbook.get_sample_data.

That said, I don't think an _axes_ object should have such a function and
axes3d.get_test_data() should be removed.

Tom

On Thu Nov 06 2014 at 11:40:18 AM Adam Hughes hughesada...@gmail.com
wrote:

 Hi,

 I recently noticed the method:

 axes3d.get_test_data()

 I was curious if other test/sample data is available somewhere in
 matplotlib, for demo purposes?  Or if this is the only sample dataset in
 the library?  Not just for 3dplots but for any plot type...  Sorry if I'm
 overlooking the obvious...
 
 --
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

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


Re: [Matplotlib-users] Setting a user defined color for each marker of a Line2D

2014-11-13 Thread Thomas Caswell
If you want each marker to be a different color you have to use scatter.
You can pass scatter a sequence of colors (see
http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.scatter) so you
don't have to go through making a custom colormap.

Tom

On Thu Nov 13 2014 at 9:01:42 AM V. Armando Solé s...@esrf.fr wrote:

 Hello,

 I am trying to plot a line assigning a user specified color to each
 marker. The idea is that if I have n points x, n ppoints y, I was
 expecting to be able to provide n markeredgecolors or n markerfacecolors
 as a (npoints, 4) array of RGBA values. However that does not seem to be
 possible (or I have failed to find it).

 The closest thing to that functionality I have found is based on
 creating a colormap with as many entries as points to be plotted:

 http://stackoverflow.com/questions/16834861/create-own-
 colormap-using-matplotlib-and-plot-color-scale

 and that only seems to work with scatter plots.

 Any hint about how to generate a Line2D object with a user specified set
 of colors (therefore not needing to create and use a colormap)?

 Thanks for your time,

 Armando


 
 --
 Comprehensive Server Monitoring with Site24x7.
 Monitor 10 servers for $9/Month.
 Get alerted through email, SMS, voice calls or mobile push notifications.
 Take corrective actions from your mobile device.
 http://pubads.g.doubleclick.net/gampad/clk?id=154624111;
 iu=/4140/ostg.clktrk
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://pubads.g.doubleclick.net/gampad/clk?id=154624111iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Control of the display of the navigation toolbar --- how?

2014-11-13 Thread Thomas Caswell
Also note that there is an rcparams context manager (
http://matplotlib.org/api/matplotlib_configuration_api.html#matplotlib.rc_context)
that will take care of the boiler plate of temporarily changing an rcparam.



On Wed Nov 12 2014 at 10:52:03 PM Sterling Smith smit...@fusion.gat.com
wrote:

 Virgil,

 Glad to hear you got it to work.  You are right that you have to set
 rcParams before the corresponding element is created (in this case the
 figure) for the rcParams to affect that creation.

 -Sterling

 On Nov 12, 2014, at 4:00PM, Virgil Stokes wrote:

  On 12-Nov-14 22:20, Sterling Smith wrote:
  Virgil,
 
  Presumably you set up some callback function that is called when you
 click on the first figure, and which creates the second figure.  Can't you
 change rcParams['toolbar'] in that callback function?  Does it not have any
 effect?
 
  -Sterling
 
  On Nov 12, 2014, at 12:50PM, Virgil Stokes wrote:
 
  I would like to be able to control when there is and there is not a
 navigation toolbar for figures. For example, suppose I have created a
 figure in which I do not wish to have a toolbar. I have used the following
 statement for this:
 
  mpl.rcParams['toolbar'] = 'None'
 
  which works fine. This figure (without a navigation toolbar) contains
 some points in it that are used to display more figures (each with an image
 in it). That is, when one of the points is clicked on with a mouse, a new
 figure is created with a PNG image in it. I wish to have a navigation
 toolbar in all these figures containing images.
 
  How can I place navigation toolbars in these figures with PNG images?
  
 --
  Comprehensive Server Monitoring with Site24x7.
  Monitor 10 servers for $9/Month.
  Get alerted through email, SMS, voice calls or mobile push
 notifications.
  Take corrective actions from your mobile device.
  http://pubads.g.doubleclick.net/gampad/clk?id=154624111;
 iu=/4140/ostg.clktrk___
  Matplotlib-users mailing list
  Matplotlib-users@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/matplotlib-users
  OK Sterling!
  I now have it --- I needed to do the following when displaying the
 figures containing the images:
 
  mpl.rcParams['toolbar'] = 'toolbar2' # to restore toolbar
   f, ax = plt.subplots(figsize=(5,4)) # for images
 
  It was important to have this order in the statements; i.e., the mpl
 before the figure was defined.
  Thanks for the help


 
 --
 Comprehensive Server Monitoring with Site24x7.
 Monitor 10 servers for $9/Month.
 Get alerted through email, SMS, voice calls or mobile push notifications.
 Take corrective actions from your mobile device.
 http://pubads.g.doubleclick.net/gampad/clk?id=154624111;
 iu=/4140/ostg.clktrk
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://pubads.g.doubleclick.net/gampad/clk?id=154624111iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Can not display 3D plot !

2014-11-18 Thread Thomas Caswell
Did you try in a conda venv?  These look like (globally!) installed version
of things which means your python session can still be picking up old/stale
versions of other imports.  See Paul Hobson's email.

Tom

On Thu Nov 13 2014 at 4:58:11 PM Geoffrey Mégardon 
geoffrey.megar...@gmail.com wrote:

 That returns:
 C:\Anaconda\lib\site-packages\matplotlib\__init__.pyc
 C:\Anaconda\lib\site-packages\mpl_toolkits\mplot3d\__init__.pyc

 On 13 November 2014 16:40, Benjamin Root ben.r...@ou.edu wrote:

 No OpenGL. The 3d graphics all goes through the same layering engine as
 the 2D plots. They aren't real 3D plots but rather what I like to call
 2.1D plots. A single point of a 3D element is chosen to determine how to
 layer it with everything else. So, it is very easy to get visualization
 artifacts, especially with polygons.

 Do this from python:

 import matplotlib
 import mpl_toolkits.mplot3d
 print matplotlib.__file__
 print mpl_toolkits.mplot3d.__file__

 And tell us what that returns.

 Cheers!
 Ben Root



 On Thu, Nov 13, 2014 at 3:49 PM, Paul Hobson pmhob...@gmail.com wrote:

 No clue about that. BTW, I'll i was suggestion was to create a new conda
 enviorment:
  conda create --name=mpl3dtest matplotlib ipython-notebook python=3.4
 ...
  activate mpl3dtest
  ipython notebook
  [test out 3d plotting]



 On Thu, Nov 13, 2014 at 12:44 PM, Geoffrey Mégardon 
 geoffrey.megar...@gmail.com wrote:

 I uninstall and reinstall Anaconda.
 That still does not work :/
 Is it possible there is like OpenGL problem, graphic card driver
 problem, or something linked to  displaying 3d?

 On 13 November 2014 13:32, Paul Hobson pmhob...@gmail.com wrote:

 Does a fresh conda environment help?

 On Wed, Nov 12, 2014 at 5:38 PM, Geoffrey Mégardon 
 geoffrey.megar...@gmail.com wrote:

 Yes, I may forget to tell, but this code is 100% working, it work on
 other installations I have. So the problem is not in the code.

 It is just that on my current laptop, I don't know why, this code,
 which tries to display a 3d plot, leads to a crash.
 Note that 2D plots work fine on their side.

 I have an other PC on windows 8.1, and everything work fine on it, I
 installed the same Anaconda 64-bit version.

 So it is something to do with my environment, but it is not linked to
 the OS itself, and it is linked with 3D displaying only I would say.

 Any idea? :)


 On 12 November 2014 18:44, Jerzy Karczmarczuk 
 jerzy.karczmarc...@unicaen.fr wrote:


 Le 13/11/2014 00:13, Geoffrey Mégardon a écrit :

 ...

 But to create the 3D axes, to draw in it, and then to show the
 figure, that crashes:
  from mpl_toolkits.mplot3d import axes3d
 import matplotlib
 matplotlib.use(agg)
 import matplotlib.pyplot as plt

 fig = plt.figure()
 ax = fig.add_subplot(111, projection='3d')
 X, Y, Z = axes3d.get_test_data(0.05)
 cset = ax.contour(X, Y, Z)
 ax.clabel(cset, fontsize=9, inline=1)

 plt.show()


 Basically on iPython QT console I would get an error like:
 Kernel died, restarting

Perhaps it is your environment, not Matplotlib.
 A copy-paste of this program run without problems on my system.
 Anaconda 64 bits, IPython console (within Spyder).
 But *Windows 7*, not 8.

 Jerzy Karczmarczuk


 --
 Comprehensive Server Monitoring with Site24x7.
 Monitor 10 servers for $9/Month.
 Get alerted through email, SMS, voice calls or mobile push
 notifications.
 Take corrective actions from your mobile device.

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




 --
 --
 MEGARDON Geoffrey


 --
 Comprehensive Server Monitoring with Site24x7.
 Monitor 10 servers for $9/Month.
 Get alerted through email, SMS, voice calls or mobile push
 notifications.
 Take corrective actions from your mobile device.

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





 --
 --
 MEGARDON Geoffrey




 --
 Comprehensive Server Monitoring with Site24x7.
 Monitor 10 servers for $9/Month.
 Get alerted through email, SMS, voice calls or mobile push notifications.
 Take corrective actions from your mobile device.

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





 --
 --
 MEGARDON Geoffrey
  

Re: [Matplotlib-users] How to plot other than rectangular grid?

2014-11-20 Thread Thomas Caswell
There are also triangular mesh plotting (I think tricolormesh is the
function name).

The really brute force solution is to use poly collection and draw what
ever shape you want.

Tom
--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration  more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] line segments in a scatter plot

2014-12-11 Thread Thomas Caswell
I would just call use `plot` and keep track of the Line2D objects returned.

On Thu Dec 11 2014 at 10:40:05 AM Nils Wagner nils...@googlemail.com
wrote:

 Hi Ben,

 I have attached a sample scatter plot. The task is to add lines to the
 scatter plot.

 Nils


 On Thu, Dec 11, 2014 at 3:47 PM, Benjamin Root ben.r...@ou.edu wrote:

 Nils,

 Perhaps the rectangle selector might be of use? It defaults to a draw
 mode of 'box', but you can set it to line so that it looks like a ruler
 widget.
 http://matplotlib.org/api/widgets_api.html#matplotlib.
 widgets.RectangleSelector

 I can imagine that you could set up a selector callback that could then
 query the data on the graph to snap the final line to the nearest points
 on the graph, creating a Line2D object on the fly. Is that what you are
 looking for?

 Cheers!
 Ben Root



 On Thu, Dec 11, 2014 at 8:47 AM, Nils Wagner nils...@googlemail.com
 wrote:

 Hi all,

 how can I create line segments between consecutive selected points of a
 scatter plot in an interactive manner ? It should be possible to create
 several unclosed polygonal lines. Each polygonal line might have
 a different color.

 A small example is appreciated.

 Thanks in advance.





 --
 View this message in context: http://matplotlib.1069221.n5.
 nabble.com/line-segments-in-a-scatter-plot-tp44602.html
 Sent from the matplotlib - users mailing list archive at Nabble.com.

 
 --
 Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
 from Actuate! Instantly Supercharge Your Business Reports and Dashboards
 with Interactivity, Sharing, Native Excel Exports, App Integration  more
 Get technology previously reserved for billion-dollar corporations, FREE
 http://pubads.g.doubleclick.net/gampad/clk?id=164703151;
 iu=/4140/ostg.clktrk
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


 
 --
 Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
 from Actuate! Instantly Supercharge Your Business Reports and Dashboards
 with Interactivity, Sharing, Native Excel Exports, App Integration  more
 Get technology previously reserved for billion-dollar corporations, FREE
 http://pubads.g.doubleclick.net/gampad/clk?id=164703151iu=/
 4140/ostg.clktrk___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration  more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Is it planned to add copy/paste curves possibility in matplotlib ?

2014-12-11 Thread Thomas Caswell
glue does a lot of fancy interactive stuff, they might have something like
that.

From a reproducible computing PoV that functionality is a bit of a problem
until we have a way to serialize figures.

It is looking more and more like that is what I will be doing over the
holidays

Tom


On Thu Dec 11 2014 at 11:39:29 AM Benjamin Root ben.r...@ou.edu wrote:

 Plans? No. This is the first I have ever heard of such a feature. You
 could always add a feature request for it (this is a community-developed
 tool). It might even fold in nicely with the MEP22 work going on to
 refactor our interactivity and make it easier to add tools.

 Keep in mind that Matplotlib is not the end-all-be-all of plotting in
 Python. There are a bunch of other tools that build off of matplotlib to
 add more features and functionality. A bunch off the top of my head are:
 bokeh, seaborn, mpldatacursor. There are a few others, but their names
 aren't coming to me right now.

 Cheers!
 Ben Root


 On Thu, Dec 11, 2014 at 11:28 AM, Julien Hillairet 
 julien.hillai...@gmail.com wrote:

 Dear all,

 We're, at our lab, trying to (slowly) make the transition from a famous
 (but expansive) numerical software to Python.

 The most recurring remark made against the use of Python/Matplotlib
 instead of this famous software is the fact that one cannot male simple
 click/copy/paste of a curve from a figure into another.

 I guess this heavily depends of the backend used, or of the OS. So my
 question is probably naive, but anyway :
 is there a plan to add an interactive way to select one or more curves
 from a matplotlib figure and to copy/paste them into a another figure ?

 It is, I think, a killing feature for many beginners/average users who
 used to work with matlab (oups, I've said it).

 Best regards,

 Julien



 
 --
 Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
 from Actuate! Instantly Supercharge Your Business Reports and Dashboards
 with Interactivity, Sharing, Native Excel Exports, App Integration  more
 Get technology previously reserved for billion-dollar corporations, FREE
 http://pubads.g.doubleclick.net/gampad/clk?id=164703151;
 iu=/4140/ostg.clktrk
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

 
 --
 Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
 from Actuate! Instantly Supercharge Your Business Reports and Dashboards
 with Interactivity, Sharing, Native Excel Exports, App Integration  more
 Get technology previously reserved for billion-dollar corporations, FREE
 http://pubads.g.doubleclick.net/gampad/clk?id=164703151iu=/
 4140/ostg.clktrk___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration  more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Include \hline on table inside figure

2015-01-23 Thread Thomas Caswell
Have you looked at using the mpl tables?
http://matplotlib.org/examples/pylab_examples/table_demo.html

Tom
On Fri Jan 23 2015 at 1:15:09 PM Arnaldo Russo arnaldoru...@gmail.com
wrote:

 Hi,

 I'm dealing with this issue but no clues I have found!
 When I use simple matplotlib engine, my plot does not render the correct
 font (which I have set to Arial) but it renders the \hline and specif
 spaces in the table inserted inside the figure area [Fig 1]
 http://imgur.com/J1A01h5.

 In the second try, using Xelatex engine (made possible by mpl.use('pgf')
 ), I get correct Arial font but my table inside becomes a mess [Fig 2]
 http://imgur.com/4TckUyb.

 Does anyone knows what is the difference between the two codes [Code]
 https://gist.github.com/arnaldorusso/e542b04245560300d4f7, and how
 should I get a figure with Arial font and a table inside the figure area?

 It's strange when I have to deal with latex codes and matplotlib... In a
 simple plot (whitout LaTeX elements) I'd have set simply: font.family:
 [sans-serif] and font.sans-serif: [Arial].

 Is there a way to include tables inside a figure with another approach
 (e.g. whithout using LaTeX)?

 At least but not less important: The figures in their different part of
 the [Code] https://gist.github.com/arnaldorusso/e542b04245560300d4f7,
 must be executed in different session. If I run everything in a simple
 console, I really dont know which parameter is maintained, but Arial is not
 used (in the second plot).


 [Fig 1] http://imgur.com/J1A01h5
 [Fig 2] http://imgur.com/4TckUyb
 [Code] https://gist.github.com/arnaldorusso/e542b04245560300d4f7

 Thank you all!

 Cheers,
 Arnaldo.

  
 --
 New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
 GigeNET is offering a free month of service with a new server in Ashburn.
 Choose from 2 high performing configs, both with 100TB of bandwidth.
 Higher redundancy.Lower latency.Increased capacity.Completely compliant.
 http://p.sf.net/sfu/gigenet___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Marker Edge Width Bug

2015-02-04 Thread Thomas Caswell
This should be fixed in 1.4.3 (which currently has a release candidate out
and barring calamities will be released this weekend).

On Wed Feb 04 2015 at 9:44:54 AM Aston630 gael.grissonnanc...@gmail.com
wrote:

 Hi,

 I recently updated Matplotlib from 1.3.1 to 1.4.2, and I observe now a bug
 that is: when I plot points, meaning 'markers', if I use markeredgewidth =
 0, in order to remove the edge of the marker, it was working very well on
 1.3.1 version, but now the points are just gone on the Matplotlib window!
 But hold it, when I print the figure pdf, the points are there as before...

 Here is the code I use :

 plt.setp(line, ls =, c = color, lw = 2, marker = o, mfc = color, ms =
 7,
 mec = color, mew= 2)  # set properties

 Thank you very much for you help



 --
 View this message in context: http://matplotlib.1069221.n5.
 nabble.com/Marker-Edge-Width-Bug-tp44800.html
 Sent from the matplotlib - users mailing list archive at Nabble.com.

 
 --
 Dive into the World of Parallel Programming. The Go Parallel Website,
 sponsored by Intel and developed in partnership with Slashdot Media, is
 your
 hub for all things parallel software development, from weekly thought
 leadership blogs to news, videos, case studies, tutorials and more. Take a
 look and join the conversation now. http://goparallel.sourceforge.net/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Do animations work in Notebook on Mac?

2015-02-02 Thread Thomas Caswell
The nbagg UAT has an animation example:
https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/backends/web_backend/nbagg_uat.ipynb
that should work on 1.4.2.

Tom

On Mon Feb 02 2015 at 11:17:15 AM Benjamin Root ben.r...@ou.edu wrote:

 There have been many fixes to the nbagg backend that I think are lined up
 for the upcoming 1.4.3 release (the release candidate was tagged
 yesterday). Perhaps it has been fixed there? What version did you upgrade
 from?

 Cheers!
 Ben Root


 On Mon, Feb 2, 2015 at 10:42 AM, Mark Bakker mark...@gmail.com wrote:

 Hello List,

 I could swear that animations used to work inside a Notebook using the
 nbagg backend on my Mac.

 But they seem not to do anything anymore. Just updated to mpl 1.4.2 and
 am running IPython 2.3.1.

 Can anybody get the basic example to work: http://matplotlib.org/1.
 4.2/examples/animation/basic_example.html

 Thanks,

 Mark

 
 --
 Dive into the World of Parallel Programming. The Go Parallel Website,
 sponsored by Intel and developed in partnership with Slashdot Media, is
 your
 hub for all things parallel software development, from weekly thought
 leadership blogs to news, videos, case studies, tutorials and more. Take a
 look and join the conversation now. http://goparallel.sourceforge.net/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


 
 --
 Dive into the World of Parallel Programming. The Go Parallel Website,
 sponsored by Intel and developed in partnership with Slashdot Media, is
 your
 hub for all things parallel software development, from weekly thought
 leadership blogs to news, videos, case studies, tutorials and more. Take a
 look and join the conversation now. http://goparallel.sourceforge.net/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Matplotlib backend nbagg does not show figure in iPython Notebook

2015-02-07 Thread Thomas Caswell
See https://github.com/ipython/ipython/issues/7351 and
https://github.com/matplotlib/matplotlib/pull/4002

On Sat Feb 07 2015 at 4:15:26 PM Benjamin Root ben.r...@ou.edu wrote:

 Hmm, that should work. I notice that you are using the beta 3.0 ipython
 release. Perhaps something is broken in the beta? Could you try downgrading
 ipython (and the notebook server, they are separate packages, I think)?

 Ben Root

 P.S. - Do Reply-All so that your responses stay on the mailing list.


 On Sat, Feb 7, 2015 at 2:02 PM, FJ fjan...@yahoo.com wrote:

 I'm running the ipython server on a remote linux machine and using chrome
 browser on my windows 7 desktop.

 I start the notebook with :

 ipython notebook --ip 0.0.0.0

 I've tried this both inside and out of a virtualenv  virtual environment
 with same results.

 thanks.

   --
  *From:* Benjamin Root ben.r...@ou.edu
 *To:* fjanoos fjan...@yahoo.com
 *Cc:* Matplotlib Users matplotlib-users@lists.sourceforge.net
 *Sent:* Saturday, February 7, 2015 9:24 AM
 *Subject:* Re: [Matplotlib-users] Matplotlib backend nbagg does not show
 figure in iPython Notebook


 How did you start ipython?

 On Sat, Feb 7, 2015 at 2:27 AM, fjanoos fjan...@yahoo.com wrote:

 hi Benjamin

 This sequence in a new notebook:

 %matplotlib nbagg
 import matplotlib as mpl
 import matplotlib.pyplot as plt
 plt.plot(range(100))

 also results in exactly the same result - the figure placeholder (not
 sure what the exact term is) but no figure inside it.

 Regards.






   --
  *From:* Benjamin Root-2 [via matplotlib] [hidden email]
 *To:* fjanoos [hidden email]
 *Sent:* Thursday, February 5, 2015 9:45 PM
 *Subject:* Re: Matplotlib backend nbagg does not show figure in iPython
 Notebook

 Selecting a backend must be first before any other matplotlib actions.
 Typically, ipython magics (the %matplotlib commands) are kept at the top
 anyway.
 I hope that clears it up.
 Ben Root
 On Feb 5, 2015 5:22 PM, fjanoos [hidden email] wrote:

 Hello,

 I'm running the following configuration
 Python 2.7.6 (default, Feb  5 2015, 00:21:43)
 IPython 3.0.0-b1
 matplotlib '1.4.2'
 The version of the notebook server is 3.0.0-b1-ee6223a.
 This is running on linux 3.16.0-0.bpo.4-amd64 #1 SMP Debian
 3.16.7-ckt2-1~bpo70+1 (2014-12-08) x86_64 GNU/Linux

 I set up matplotlib as follows:
 import matplotlib as mpl
 import matplotlib.pyplot as plt
 %matplotlib nbagg


 Then running this command:
  plt.plot(range(100))
 only displays a box (with resize, zoom, pan, etc controls)  - but does not
 show the figure itself (see figure).
 http://matplotlib.1069221.n5.nabble.com/file/n44812/Untitled.png
 Also, when I click on any part of the figure, I get a slew of the
 following
 message on stderr:
 [IPKernelApp] ERROR | No such comm: 29281512bed24f259572bc6f0ea8d249


 On the other hand,
  plt.plot(range(100))
  plt.show()
 shows nothing at all.

 However, this
 %matplotlib inline
 plt.plot(range(100))
 displays the figure as expected.

 What is going on ? How can I enable the new notebook backend for
 matplotlib
 ?

 Thanks.




 --
 View this message in context:
 http://matplotlib.1069221.n5.nabble.com/Matplotlib-backend-nbagg-does-not-show-figure-in-iPython-Notebook-tp44812.html
 Sent from the matplotlib - users mailing list archive at Nabble.com.


 --
 Dive into the World of Parallel Programming. The Go Parallel Website,
 sponsored by Intel and developed in partnership with Slashdot Media, is
 your
 hub for all things parallel software development, from weekly thought
 leadership blogs to news, videos, case studies, tutorials and more. Take a
 look and join the conversation now. http://goparallel.sourceforge.net/
 ___
 Matplotlib-users mailing list
 [hidden email]
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


 --

 Dive into the World of Parallel Programming. The Go Parallel Website,
 sponsored by Intel and developed in partnership with Slashdot Media, is
 your
 hub for all things parallel software development, from weekly thought
 leadership blogs to news, videos, case studies, tutorials and more. Take
 a
 look and join the conversation now. http://goparallel.sourceforge.net/
 ___
 Matplotlib-users mailing list
 [hidden email]
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


 --
  If you reply to this email, your message will be added to the
 discussion below:

 http://matplotlib.1069221.n5.nabble.com/Matplotlib-backend-nbagg-does-not-show-figure-in-iPython-Notebook-tp44812p44813.html
  To unsubscribe from Matplotlib backend nbagg does not show figure in
 iPython Notebook, click here.
 NAML
 

Re: [Matplotlib-users] [matplotlib-devel] v1.4.3rc1

2015-02-07 Thread Thomas Caswell
Sandro,

Well, creating the tarball on GH is a lot easier for us as it happens
automatically!  I don't want to unilaterally change policy so I will create
the files on SF.

If you want to tracking GH for debian instead of SF I don't think that
would be a bad idea, but I don't know how much of a hassle that would be
for you.

Tom

On Sat Feb 07 2015 at 4:14:36 PM Sandro Tosi mo...@debian.org wrote:

 On Sat, Feb 7, 2015 at 9:05 PM, Thomas Caswell tcasw...@gmail.com wrote:
  Sandro,
 
  Can you use the tarball from github
  (https://github.com/matplotlib/matplotlib/archive/v1.4.3rc1.tar.gz ?)

 Sure I can, but since all the previous release (even RC) were done one
 SF, we have our tools to monitor and download new releases pointing to
 SF: do you plan to switch to GH for releasing tarballs too?

 Cheers,
 --
 Sandro Tosi (aka morph, morpheus, matrixhasu)
 My website: http://matrixhasu.altervista.org/
 Me at Debian: http://wiki.debian.org/SandroTosi

--
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] [matplotlib-devel] v1.4.3rc1

2015-02-07 Thread Thomas Caswell
Sandro,

Can you use the tarball from github (
https://github.com/matplotlib/matplotlib/archive/v1.4.3rc1.tar.gz ?)

Tom

On Sat Feb 07 2015 at 4:01:01 PM Sandro Tosi mo...@debian.org wrote:

 Hi Thomas,

 On Mon, Feb 2, 2015 at 5:37 AM, Thomas Caswell tcasw...@gmail.com wrote:
  Evening all,
 
  I have tagged the first release candidate for v1.4.3
  (https://github.com/matplotlib/matplotlib/releases/tag/v1.4.3rc1).
 ...
  Please kick the tires and give it a try!  If there are no major issues,
 the
  plan is to target 1.4.3 for next weekend.

 could you also release a tarball on SF, so I can start updating the
 debian package and give it a spin on our distro?

 Cheers,
 --
 Sandro Tosi (aka morph, morpheus, matrixhasu)
 My website: http://matrixhasu.altervista.org/
 Me at Debian: http://wiki.debian.org/SandroTosi

--
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Matplotlib backend nbagg does not show figure in iPython Notebook

2015-02-07 Thread Thomas Caswell
Yes, I think that if you want to use ipython 3.0 you need to use mpl 1.4.3
or master.

Tom

On Sat Feb 07 2015 at 4:21:19 PM Benjamin Root ben.r...@ou.edu wrote:

 So, the user needs to use 1.4.3?

 On Sat, Feb 7, 2015 at 4:17 PM, Thomas Caswell tcasw...@gmail.com wrote:

 See https://github.com/ipython/ipython/issues/7351 and
 https://github.com/matplotlib/matplotlib/pull/4002

 On Sat Feb 07 2015 at 4:15:26 PM Benjamin Root ben.r...@ou.edu wrote:

 Hmm, that should work. I notice that you are using the beta 3.0 ipython
 release. Perhaps something is broken in the beta? Could you try downgrading
 ipython (and the notebook server, they are separate packages, I think)?

 Ben Root

 P.S. - Do Reply-All so that your responses stay on the mailing list.


 On Sat, Feb 7, 2015 at 2:02 PM, FJ fjan...@yahoo.com wrote:

 I'm running the ipython server on a remote linux machine and using
 chrome browser on my windows 7 desktop.

 I start the notebook with :

 ipython notebook --ip 0.0.0.0

 I've tried this both inside and out of a virtualenv  virtual
 environment with same results.

 thanks.

   --
  *From:* Benjamin Root ben.r...@ou.edu
 *To:* fjanoos fjan...@yahoo.com
 *Cc:* Matplotlib Users matplotlib-users@lists.sourceforge.net
 *Sent:* Saturday, February 7, 2015 9:24 AM
 *Subject:* Re: [Matplotlib-users] Matplotlib backend nbagg does not
 show figure in iPython Notebook


 How did you start ipython?

 On Sat, Feb 7, 2015 at 2:27 AM, fjanoos fjan...@yahoo.com wrote:

 hi Benjamin

 This sequence in a new notebook:

 %matplotlib nbagg
 import matplotlib as mpl
 import matplotlib.pyplot as plt
 plt.plot(range(100))

 also results in exactly the same result - the figure placeholder (not
 sure what the exact term is) but no figure inside it.

 Regards.






   --
  *From:* Benjamin Root-2 [via matplotlib] [hidden email]
 *To:* fjanoos [hidden email]
 *Sent:* Thursday, February 5, 2015 9:45 PM
 *Subject:* Re: Matplotlib backend nbagg does not show figure in
 iPython Notebook

 Selecting a backend must be first before any other matplotlib actions.
 Typically, ipython magics (the %matplotlib commands) are kept at the top
 anyway.
 I hope that clears it up.
 Ben Root
 On Feb 5, 2015 5:22 PM, fjanoos [hidden email] wrote:

 Hello,

 I'm running the following configuration
 Python 2.7.6 (default, Feb  5 2015, 00:21:43)
 IPython 3.0.0-b1
 matplotlib '1.4.2'
 The version of the notebook server is 3.0.0-b1-ee6223a.
 This is running on linux 3.16.0-0.bpo.4-amd64 #1 SMP Debian
 3.16.7-ckt2-1~bpo70+1 (2014-12-08) x86_64 GNU/Linux

 I set up matplotlib as follows:
 import matplotlib as mpl
 import matplotlib.pyplot as plt
 %matplotlib nbagg


 Then running this command:
  plt.plot(range(100))
 only displays a box (with resize, zoom, pan, etc controls)  - but does
 not
 show the figure itself (see figure).
 http://matplotlib.1069221.n5.nabble.com/file/n44812/Untitled.png
 Also, when I click on any part of the figure, I get a slew of the
 following
 message on stderr:
 [IPKernelApp] ERROR | No such comm: 29281512bed24f259572bc6f0ea8d249


 On the other hand,
  plt.plot(range(100))
  plt.show()
 shows nothing at all.

 However, this
 %matplotlib inline
 plt.plot(range(100))
 displays the figure as expected.

 What is going on ? How can I enable the new notebook backend for
 matplotlib
 ?

 Thanks.




 --
 View this message in context:
 http://matplotlib.1069221.n5.nabble.com/Matplotlib-backend-nbagg-does-not-show-figure-in-iPython-Notebook-tp44812.html
 Sent from the matplotlib - users mailing list archive at Nabble.com.


 --
 Dive into the World of Parallel Programming. The Go Parallel Website,
 sponsored by Intel and developed in partnership with Slashdot Media, is
 your
 hub for all things parallel software development, from weekly thought
 leadership blogs to news, videos, case studies, tutorials and more.
 Take a
 look and join the conversation now. http://goparallel.sourceforge.net/
 ___
 Matplotlib-users mailing list
 [hidden email]
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


 --

 Dive into the World of Parallel Programming. The Go Parallel Website,
 sponsored by Intel and developed in partnership with Slashdot Media, is
 your
 hub for all things parallel software development, from weekly thought
 leadership blogs to news, videos, case studies, tutorials and more.
 Take a
 look and join the conversation now. http://goparallel.sourceforge.net/
 ___
 Matplotlib-users mailing list
 [hidden email]
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


 --
  If you reply to this email, your message will be added to the
 discussion below:

 http://matplotlib.1069221.n5

Re: [Matplotlib-users] Fwd: Keep list of figures or plots and flip through list using UI

2015-02-18 Thread Thomas Caswell
Probably in the embedding examples.

There was an effort to start a mpl specific cook book a while a ago based
around a wx/glade example but I have lost track of where that is.

Tom

On Wed, Feb 18, 2015, 12:49 Ryan Nelson rnelsonc...@gmail.com wrote:

 Tom et al.,

 I don't know about this exact application... However, a couple of months
 ago, I asked on the Scipy mailing list about updating the Scipy cookbook
 page for Qt/Matplotlib (
 http://wiki.scipy.org/Cookbook/Matplotlib/Qt_with_IPython_and_Designer),
 but I never got a response. The cookbook example is terribly out of date,
 so I worked out a pretty simple example that essentially reproduces the Qt
 backend plotting window. See my post (
 http://mail.scipy.org/pipermail/scipy-dev/2014-December/020258.html) for
 an initial version of the code. I may have updated it since that time. If
 you are asking for an example for the MPL docs, I would be happy to write
 my example up with some picts, if you could tell me where the most
 appropriate place in the documentation would be for such an addition.

 (However, it sounds like Creator will supersede Designer for Qt5 so...)

 Ryan

 On Wed, Feb 18, 2015 at 12:31 PM, Thomas Caswell tcasw...@gmail.com
 wrote:

 A good tutorial on how to make mpl play nice with QtDesigner would be a
 useful thing to have in the documentation.  It would be appreciated if you
 could take a crack at writing that up.

 Tom

 -- Forwarded message -
 From: tenspd137 . dcday...@gmail.com
 Date: Wed Feb 18 2015 at 12:25:10 PM
 Subject: Re: [Matplotlib-users] Keep list of figures or plots and flip
 through list using UI
 To: Thomas Caswell tcasw...@gmail.com


 Funny thing - shortly after I wrote you - I figured it out.  I have a
 GUI/Dialog I created with designer that has a push button which cycles
 between two plots I stored in a list.  If you would like to see my
 code, I would be more than happy to share.  It isn't fabulous, but it
 show the mechanics.  I will also take a look at what you just posted
 above.

 Much appreciated!

 -C




 On Wed, Feb 18, 2015 at 10:19 AM, Thomas Caswell tcasw...@gmail.com
 wrote:
  Please ping the mailing list again (I cc'd the list on this).
 
  See
  https://github.com/tacaswell/leidenfrost/blob/master/
 leidenfrost/gui/reader_gui.py#L636
  (sorry for the code quality, this is a bespoked gui I wrote as part of
 my
  PhD work, you might be the second person to ever read this code) for a
 Qt
  object that wraps up a `Figure` in a nice-embedded way.  Using this
 directly
  you can keep a list of these objects around and show/hide them using
  standard Qt methods.  Modifying this a bit you could make this class
 based
  on a standard Qt widget, embed them all in a main window/what have you
 and
  then again use standard Qt methods to show/hide individual plots as you
  wish.
 
  Tom
 
 
  On Wed Feb 18 2015 at 12:00:27 PM tenspd137 . dcday...@gmail.com
 wrote:
 
  Sorry for digging this back up, but I can't seem to get this to work.
  I looked at glue as you suggested, but the page says it only supports
  python 2.7.  As for the Qt examples I can find, all I see how to do is
  to feed a single plot widget different data sets - but nothing on
  dynamically changing the underlying widget and redrawing.  Would you
  maybe take a look at my code and tell me what it is I am missing?  If
  so, I'll send it to you.
 
  Much appreciated.
 
  -C
 
  On Tue, Feb 10, 2015 at 6:48 PM, tenspd137 . dcday...@gmail.com
 wrote:
   No problem - thanks for the reply.  I tried your suggestion of
 keeping
   a widget for each plot, but I couldn't get the main window to refresh
   correctly - maybe I was doing something wrong.  I'll give it another
   try as soon as I get a chance.  In the meantime, I'll check out glue
   as well - it looks pretty cool.
  
   I might bug you one more time if I can't figure it out, but I am not
   in a hurry and I probably just overlooked something. :)
  
   Thanks and much appreciated!
  
   -C
  
   On Tue, Feb 10, 2015 at 2:44 PM, Thomas Caswell tcasw...@gmail.com
   wrote:
   Sorry this didn't get a response for so long.
  
   The core of the embedding in Qt is at QWidget which contains the
   canvas.
   Anything you want to do with a QWidget you can do with the canvas.
   Independently you need to maintain the mpl level plotting objects
 (the
   Figure, Axes, and Artist objects) (well, you don't _need_ to, you
 can
   get to
   them through the canvas object, but to keep your self sane I highly
   recommend keeping track of the mpl objects your self, this linkage
 is
   there
   so that GUI generated draw commands can trigger a re-rendering of
 the
   figure).
  
   I would just have a widget for each of the plots you want to have
 and
   then
   cycle which one is visible in the main window, that is probably a
 lot
   easier
   than trying to attach and detach canvases from Figures.
  
   I would also take a look at glue
   http://www.glueviz.org/en/stable

[Matplotlib-users] Fwd: Keep list of figures or plots and flip through list using UI

2015-02-18 Thread Thomas Caswell
A good tutorial on how to make mpl play nice with QtDesigner would be a
useful thing to have in the documentation.  It would be appreciated if you
could take a crack at writing that up.

Tom

-- Forwarded message -
From: tenspd137 . dcday...@gmail.com
Date: Wed Feb 18 2015 at 12:25:10 PM
Subject: Re: [Matplotlib-users] Keep list of figures or plots and flip
through list using UI
To: Thomas Caswell tcasw...@gmail.com


Funny thing - shortly after I wrote you - I figured it out.  I have a
GUI/Dialog I created with designer that has a push button which cycles
between two plots I stored in a list.  If you would like to see my
code, I would be more than happy to share.  It isn't fabulous, but it
show the mechanics.  I will also take a look at what you just posted
above.

Much appreciated!

-C



On Wed, Feb 18, 2015 at 10:19 AM, Thomas Caswell tcasw...@gmail.com wrote:
 Please ping the mailing list again (I cc'd the list on this).

 See
 https://github.com/tacaswell/leidenfrost/blob/master/
leidenfrost/gui/reader_gui.py#L636
 (sorry for the code quality, this is a bespoked gui I wrote as part of my
 PhD work, you might be the second person to ever read this code) for a Qt
 object that wraps up a `Figure` in a nice-embedded way.  Using this
directly
 you can keep a list of these objects around and show/hide them using
 standard Qt methods.  Modifying this a bit you could make this class based
 on a standard Qt widget, embed them all in a main window/what have you and
 then again use standard Qt methods to show/hide individual plots as you
 wish.

 Tom


 On Wed Feb 18 2015 at 12:00:27 PM tenspd137 . dcday...@gmail.com wrote:

 Sorry for digging this back up, but I can't seem to get this to work.
 I looked at glue as you suggested, but the page says it only supports
 python 2.7.  As for the Qt examples I can find, all I see how to do is
 to feed a single plot widget different data sets - but nothing on
 dynamically changing the underlying widget and redrawing.  Would you
 maybe take a look at my code and tell me what it is I am missing?  If
 so, I'll send it to you.

 Much appreciated.

 -C

 On Tue, Feb 10, 2015 at 6:48 PM, tenspd137 . dcday...@gmail.com wrote:
  No problem - thanks for the reply.  I tried your suggestion of keeping
  a widget for each plot, but I couldn't get the main window to refresh
  correctly - maybe I was doing something wrong.  I'll give it another
  try as soon as I get a chance.  In the meantime, I'll check out glue
  as well - it looks pretty cool.
 
  I might bug you one more time if I can't figure it out, but I am not
  in a hurry and I probably just overlooked something. :)
 
  Thanks and much appreciated!
 
  -C
 
  On Tue, Feb 10, 2015 at 2:44 PM, Thomas Caswell tcasw...@gmail.com
  wrote:
  Sorry this didn't get a response for so long.
 
  The core of the embedding in Qt is at QWidget which contains the
  canvas.
  Anything you want to do with a QWidget you can do with the canvas.
  Independently you need to maintain the mpl level plotting objects (the
  Figure, Axes, and Artist objects) (well, you don't _need_ to, you can
  get to
  them through the canvas object, but to keep your self sane I highly
  recommend keeping track of the mpl objects your self, this linkage is
  there
  so that GUI generated draw commands can trigger a re-rendering of the
  figure).
 
  I would just have a widget for each of the plots you want to have and
  then
  cycle which one is visible in the main window, that is probably a lot
  easier
  than trying to attach and detach canvases from Figures.
 
  I would also take a look at glue
  http://www.glueviz.org/en/stable/installation.html who may have solved
  many
  of these problems for you.
 
  Tom
 
  On Thu Feb 05 2015 at 1:03:16 PM tenspd137 . dcday...@gmail.com
  wrote:
 
  Hi all,
 
  I often have scripts that make a lot of plots, and I would like to be
  able to create the plots and then have a UI tool that shows a list of
  their titles, click on the title and have the plot be drawn in a
  window.  So far, I have been able to use PyQt to create a UI with a
  list box and a Widget to display plots.  What I can't seem to figure
  out is how to make a bunch of plots and then have the Window update.
 
  So, in psuedo code:
 
  list of plots = []
 
  Go through datasets:
  plots.append(plot(dataset))
 
  For plot in plots:
 add plot title to UI list, position in list is reference back
  into list of plots
 
  On UI:
  click on plot name/title
  widget draws plot
 
 
  So - basically like docked plots, except there is just a list to the
  side instead (much cleaner IMHO)
 
  I haven't been able to find any examples from googling.  Has any one
  been able to do this or seen examples?
 
 
  Any help or suggestions are appreciated!
 
  Thanks!
 
  :
 
 
 
  
--
  Dive into the World of Parallel Programming. The Go Parallel

Re: [Matplotlib-users] Event errors in qt5 backend after recent commit

2015-02-18 Thread Thomas Caswell
Can you put in a pull request with those changes please?

On Wed, Feb 18, 2015, 17:03 Jorge Scandaliaris jorgesmbox...@yahoo.es
wrote:

 Hi,
 A recent commit against lib/matplotlib/backends/backend_qt5.py [1] causes
 some errors in code that was working fine before. The error is as follows:

 
 ---
 TypeError Traceback (most recent call last)
 /home/jscandal/sw/matplotlib/matplotlib.py3/lib/matplotlib/backends
 /backend_qt5.py
 in enterEvent(self, event)
 249
 250 def enterEvent(self, event):
 -- 251 FigureCanvasBase.enter_notify_event(self, event,
 guiEvent=event)
 252
 253 def leaveEvent(self, event):

 TypeError: enter_notify_event() got multiple values for argument 'guiEvent'

 
 ---
 TypeError Traceback (most recent call last)
 /home/jscandal/sw/matplotlib/matplotlib.py3/lib/matplotlib/backends
 /backend_qt5.py
 in leaveEvent(self, event)
 253 def leaveEvent(self, event):
 254 QtWidgets.QApplication.restoreOverrideCursor()
 -- 255 FigureCanvasBase.leave_notify_event(self, event,
 guiEvent=event)
 256
 257 def mousePressEvent(self, event):

 TypeError: leave_notify_event() got multiple values for argument 'guiEvent'



 Reverting the changes introduced by the commit in lines 251 and 255 of
 backend_qt5.py seems to fix the issue, in my particular use case.

 Regards,

 Jorge


 1.
 b72e0cd9e63f7cf4bec2908143c62c23666b674a
 Author: Steven Silvester steven.silves...@ieee.org
 Date:   Sun Feb 15 09:38:21 2015 -0600

 Add guiEvent data to Qt backend



 
 --
 Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
 from Actuate! Instantly Supercharge Your Business Reports and Dashboards
 with Interactivity, Sharing, Native Excel Exports, App Integration  more
 Get technology previously reserved for billion-dollar corporations, FREE
 http://pubads.g.doubleclick.net/gampad/clk?id=190641631;
 iu=/4140/ostg.clktrk
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration  more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] matplotlib v1.4.3

2015-02-16 Thread Thomas Caswell
Hello all,

We are pleased to announce the release of matplotlib v1.4.3!

Wheels, windows binaries and the source tarball are available through both
source-forge [1]  and pypi (via pip).  Additionally the source is available
tarball is available from github [2] and mac-wheels from
http://wheels.scikit-image.org/.

This is the last planned bug-fix release in the 1.4 series.

Many bugs are fixed including:

   - fixing drawing of edge-only markers in AGG
   - fix run-away memory usage when using %inline or saving with a tight
   bounding box with QuadMesh artists
   - improvements to wx and tk gui backends

Additionally the webagg and nbagg backends were brought closer to
feature parity with the desktop backends with the addition of keyboard
and scroll events thanks to Steven Silvester.

The next planned release will be based on the 1.4.x series but will change
the default colors and be tagged as version v2.0. The target release date
is in the next month or two.

The next feature release will be v2.1 targeted for around SciPy in July.

Tom


[1]
https://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-1.4.3/

[2] https://github.com/matplotlib/matplotlib/releases/tag/v1.4.3
--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration  more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib finance

2015-01-30 Thread Thomas Caswell
Boris,

Please direct such questions to the user list in the future (I have
included the list on my reply).  You may need to join the list to be able
to post.

The reason that mpl.finance was deprecated is that none of the current core
developers work in finance and hence do not have the domain expertise to
maintain the module.  We are currently looking for a volunteer to take
responsibility for that bit of code.

I have no experience with plotting financial data and am hesitant to
speculate about performance, but have gotten 20-30 fps out of mpl on other
applications.

Tom

On Fri Jan 30 2015 at 1:19:47 PM tbad tbad2...@gmail.com wrote:

 Hello Thomas,

 - You write in Github that matplotlib finance is deprecated since
 matplotlib 1.4. What is instead of it?
 - Can you please advice on what to use if i want to use matplotlib for
 charting stocks, volume in different formats like candlesticks, tick
 charts, bar charts with technical analysis add-ons like moving averages
 etc.? I want to have charts with intra-day real time streaming with a lot
 of stocks (i have a data feed provider). Or the only way is to do
 everything manually?
 - And will matplotlib be capable of streaming a lot of stocks tick by tick
 without delays?
 - Also maybe there are other python packages useful for trading purposes?

 Thank you for any answers beforehand,
 Best regards,
 Boris

--
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] v1.4.3rc1

2015-02-01 Thread Thomas Caswell
Evening all,

I have tagged the first release candidate for v1.4.3 (
https://github.com/matplotlib/matplotlib/releases/tag/v1.4.3rc1).

Although this is a bug-fix release, a fair amount of work has gone into
making the nbagg (interactive figures in ipython notebooks) feature
complete compared to the other interactive backends.

Please kick the tires and give it a try!  If there are no major issues, the
plan is to target 1.4.3 for next weekend.

The mac build has been started and (if I understand how these things work)
should be available to install via
pip install -f http://wheels.scikit-image.org --pre matplotlib  soon.

For linux anaconda users, packages for 2.6/2.7 python  on my binstar
channel (conda install -c https://conda.binstar.org/tacaswell matplotlib).
The py3k builds have some issue with invalid syntax in pyqt4, if some knows
how to build these, please let me know.


Tom
--
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] using it in a Qt5-Widget

2015-01-28 Thread Thomas Caswell
It should be exactly the same as for Qt4, just importing from the Qt5
version

Tom

On Wed Jan 28 2015 at 11:24:55 AM moon...@posteo.org wrote:

 I read the documentation a little bit. But I couldn't find a hint how
 to integrate a plot with matplotlib into a Qt5-Gui.

 
 --
 Dive into the World of Parallel Programming. The Go Parallel Website,
 sponsored by Intel and developed in partnership with Slashdot Media, is
 your
 hub for all things parallel software development, from weekly thought
 leadership blogs to news, videos, case studies, tutorials and more. Take a
 look and join the conversation now. http://goparallel.sourceforge.net/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] using it in a Qt5-Widget

2015-01-28 Thread Thomas Caswell
http://matplotlib.org/examples/user_interfaces/embedding_in_qt4_wtoolbar.html
and http://matplotlib.org/examples/user_interfaces/embedding_in_qt4.html
 are a good place to start.

Embedding a mpl figure in a QWidget is how the QtAgg backend family works
and how the interactive windows work.

Tom

On Wed Jan 28 2015 at 2:39:16 PM moon...@posteo.org wrote:

 On 2015-01-28 16:25 Thomas Caswell tcasw...@gmail.com wrote:
  It should be exactly the same as for Qt4, just importing from the Qt5
  version

 Sorry, but my question was to unspecific.

 I don't know how it worked with Qt4.

 I need to know I can draw a plot into a QWidget or something else. I
 couldn't find an example or documentation about it.

 
 --
 Dive into the World of Parallel Programming. The Go Parallel Website,
 sponsored by Intel and developed in partnership with Slashdot Media, is
 your
 hub for all things parallel software development, from weekly thought
 leadership blogs to news, videos, case studies, tutorials and more. Take a
 look and join the conversation now. http://goparallel.sourceforge.net/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] [matplotlib-devel] v1.4.3rc1

2015-02-08 Thread Thomas Caswell
Sorry about the bad tarball, I forgot to clean my git directory before
generating it.  Another point in favor of using the gh tarball, I can't
screw it up.

This is the first I have seen that CVE.

That PR is not included in 1.4.3 because it completely over-hauls how the
Agg rendering works (and generated a whole bunch of other bugs along the
way).

Mike: Is there a way to fix up the security issues reported on just the
1.4.x branch with out pulling that whole patch back?

Tom


On Sun Feb 08 2015 at 7:47:00 PM Benjamin Root ben.r...@ou.edu wrote:

 Please ignore my test failure report. I was accidentally running an older
 install of matplotlib from the same branch.

 Ben Root

 On Sat, Feb 7, 2015 at 9:08 PM, Benjamin Root ben.r...@ou.edu wrote:

 I am getting some test failures here and on master in the collections
 module.

 ==
 FAIL: __main__.test_regularpolycollection_rotate.test
 --
 Traceback (most recent call last):
   File /home/ben/miniconda/lib/python2.7/site-packages/nose/case.py,
 line 197, in runTest
 self.test(*self.arg)
   File
 /home/ben/.local/lib/python2.7/site-packages/matplotlib-1.4.x-py2.7-linux-x86_64.egg/matplotlib/testing/decorators.py,
 line 51, in failer
 result = f(*args, **kwargs)
   File
 /home/ben/.local/lib/python2.7/site-packages/matplotlib-1.4.x-py2.7-linux-x86_64.egg/matplotlib/testing/decorators.py,
 line 196, in do_test
 '(RMS %(rms).3f)'%err)
 ImageComparisonFailure: images not close:
 /home/ben/Programs/matplotlib/result_images/test_collections/regularpolycollection_rotate.png
 vs.
 /home/ben/Programs/matplotlib/result_images/test_collections/regularpolycollection_rotate-expected.png
 (RMS 54.618)

 ==
 FAIL: __main__.test_regularpolycollection_scale.test
 --
 Traceback (most recent call last):
   File /home/ben/miniconda/lib/python2.7/site-packages/nose/case.py,
 line 197, in runTest
 self.test(*self.arg)
   File
 /home/ben/.local/lib/python2.7/site-packages/matplotlib-1.4.x-py2.7-linux-x86_64.egg/matplotlib/testing/decorators.py,
 line 51, in failer
 result = f(*args, **kwargs)
   File
 /home/ben/.local/lib/python2.7/site-packages/matplotlib-1.4.x-py2.7-linux-x86_64.egg/matplotlib/testing/decorators.py,
 line 196, in do_test
 '(RMS %(rms).3f)'%err)
 ImageComparisonFailure: images not close:
 /home/ben/Programs/matplotlib/result_images/test_collections/regularpolycollection_scale.png
 vs.
 /home/ben/Programs/matplotlib/result_images/test_collections/regularpolycollection_scale-expected.png
 (RMS 120.828)

 --
 Ran 54 tests in 15.149s

 FAILED (failures=2)



 The squares in the first test are larger than they should be. I have some
 other errors, but they seem to other be floating point errors, or issues
 with fonts.

 Ben Root


 On Sat, Feb 7, 2015 at 4:46 PM, Thomas Caswell tcasw...@gmail.com
 wrote:

 Sandro,

 Well, creating the tarball on GH is a lot easier for us as it happens
 automatically!  I don't want to unilaterally change policy so I will create
 the files on SF.

 If you want to tracking GH for debian instead of SF I don't think that
 would be a bad idea, but I don't know how much of a hassle that would be
 for you.

 Tom

 On Sat Feb 07 2015 at 4:14:36 PM Sandro Tosi mo...@debian.org wrote:

 On Sat, Feb 7, 2015 at 9:05 PM, Thomas Caswell tcasw...@gmail.com
 wrote:
  Sandro,
 
  Can you use the tarball from github
  (https://github.com/matplotlib/matplotlib/archive/v1.4.3rc1.tar.gz ?)

 Sure I can, but since all the previous release (even RC) were done one
 SF, we have our tools to monitor and download new releases pointing to
 SF: do you plan to switch to GH for releasing tarballs too?

 Cheers,
 --
 Sandro Tosi (aka morph, morpheus, matrixhasu)
 My website: http://matrixhasu.altervista.org/
 Me at Debian: http://wiki.debian.org/SandroTosi



 --
 Dive into the World of Parallel Programming. The Go Parallel Website,
 sponsored by Intel and developed in partnership with Slashdot Media, is
 your
 hub for all things parallel software development, from weekly thought
 leadership blogs to news, videos, case studies, tutorials and more. Take
 a
 look and join the conversation now. http://goparallel.sourceforge.net/
 ___
 Matplotlib-devel mailing list
 matplotlib-de...@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-devel




--
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub

Re: [Matplotlib-users] Bug in matplotlib 1.4.2

2015-02-09 Thread Thomas Caswell
Can you test with 1.4.3rc1?  I believe this has been fixed.

On Mon Feb 09 2015 at 1:07:28 PM Alex Böhnert alex.boehn...@gmail.com
wrote:

 Dear all,

 when plotting scattered data with the , marker, the data points do not
 show up either on screen (Qt4Agg backend) or in saved bitmap images (tested
 with png); they do show up if the plot is exported as pdf.

 Example code (run in ipython --pylab for simplicity):

 import numpy as np
 a = np.random.standard_normal(500)
 b = np.random.standard_normal(500)
 plot(a,b,',')
 savefig(testplot.png)
 savefig(testplot.pdf)

 Expected result: Scatter plot of random data points, both on screen and in
 saved files.

 Actual result: Empty-looking plot both on screen and in png, but plot as
 expected in pdf.

 System info: Arch linux, Kernel 3.17.6 (and 3.18.6), matplotlib version
 1.4.2, Python 3.4.2, IPython 2.3.1., numpy version 1.9.1, Qt4Agg backend.

 Related: I posted this to the arch-bugtracker (
 https://bugs.archlinux.org/task/43392) and asked on stack overflow
 whether anyone else saw this (
 http://stackoverflow.com/questions/28112916/python-matplotlib-does-not-display-data-points-bug-or-something-else).
 Apparently, the same thing happens in Ubuntu, too.

 Hope this is the right place to report this.

 Cheers,
 Alex

 P.S.: I sent the same mail to the list a few weeks ago without
 registering, but it was never posted, nor replied to. It might be a good
 idea not to suggest at
 http://matplotlib.org/faq/troubleshooting_faq.html#getting-help that just
 sending a mail to the list will achieve anything...
 
 --
 Dive into the World of Parallel Programming. The Go Parallel Website,
 sponsored by Intel and developed in partnership with Slashdot Media, is
 your
 hub for all things parallel software development, from weekly thought
 leadership blogs to news, videos, case studies, tutorials and more. Take a
 look and join the conversation now. http://goparallel.sourceforge.net/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Keep list of figures or plots and flip through list using UI

2015-02-10 Thread Thomas Caswell
Sorry this didn't get a response for so long.

The core of the embedding in Qt is at QWidget which contains the canvas.
Anything you want to do with a QWidget you can do with the canvas.
Independently
you need to maintain the mpl level plotting objects (the Figure, Axes, and
Artist objects) (well, you don't _need_ to, you can get to them through the
canvas object, but to keep your self sane I highly recommend keeping track
of the mpl objects your self, this linkage is there so that GUI generated
draw commands can trigger a re-rendering of the figure).

I would just have a widget for each of the plots you want to have and then
cycle which one is visible in the main window, that is probably a lot
easier than trying to attach and detach canvases from Figures.

I would also take a look at glue
http://www.glueviz.org/en/stable/installation.html who may have solved many
of these problems for you.

Tom

On Thu Feb 05 2015 at 1:03:16 PM tenspd137 . dcday...@gmail.com wrote:

 Hi all,

 I often have scripts that make a lot of plots, and I would like to be
 able to create the plots and then have a UI tool that shows a list of
 their titles, click on the title and have the plot be drawn in a
 window.  So far, I have been able to use PyQt to create a UI with a
 list box and a Widget to display plots.  What I can't seem to figure
 out is how to make a bunch of plots and then have the Window update.

 So, in psuedo code:

 list of plots = []

 Go through datasets:
 plots.append(plot(dataset))

 For plot in plots:
add plot title to UI list, position in list is reference back
 into list of plots

 On UI:
 click on plot name/title
 widget draws plot


 So - basically like docked plots, except there is just a list to the
 side instead (much cleaner IMHO)

 I haven't been able to find any examples from googling.  Has any one
 been able to do this or seen examples?


 Any help or suggestions are appreciated!

 Thanks!

 :

 
 --
 Dive into the World of Parallel Programming. The Go Parallel Website,
 sponsored by Intel and developed in partnership with Slashdot Media, is
 your
 hub for all things parallel software development, from weekly thought
 leadership blogs to news, videos, case studies, tutorials and more. Take a
 look and join the conversation now. http://goparallel.sourceforge.net/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] quiverkey() doesn't plot the reference vector?

2015-02-18 Thread Thomas Caswell
This is probably related to the Agg renderer issue with edge-only markers.

On Wed Feb 18 2015 at 7:14:22 PM Eric Firing efir...@hawaii.edu wrote:

 On 2015/02/18 2:00 PM, Thomas Caswell wrote:
  Is this just on master or with 1.4.x?

 It's on 1.4.1 and 1.4.2, but not on 1.4.3 or master or 1.4.0.  Therefore
 I won't enter it as an issue.

 I don't know what went wrong with this in those two bugfix releases.

 Eric

 
  On Wed Feb 18 2015 at 6:00:26 PM Eric Firing efir...@hawaii.edu
  mailto:efir...@hawaii.edu wrote:
 
  On 2015/02/18 9:52 AM, njs wrote:
Hi All,
   
I'm having issues with quiver, and quiverkey() although, I have
 never
experienced these issues in the past.  I attached an image to
  this post that
demonstrates that quiver_key() used to work for me, this image
  was generated
on 17-Jul-2014.  However, if I run this exact same code (see
  below for the
code), the quiver key reference on the top right does not get
  plotted, but
the text will.  I haven't changed anything, but I think there
  have been some
package updates between then and now.  For what it's worth, I've
  tried many
different ways to generate the quiverkey() and haven't had any
  luck.  Has
anyone else experienced similar issues?
 
  That's alarming!  I can reproduce the problem even with the standard
 mpl
  example--the arrow is missing in 5 out of the 6 plots.  I will file a
  github issue.  Thanks for the report.
 
  Eric
 
   
Thanks for any insights!
   
Working quiverkey():
http://matplotlib.1069221.n5.__nabble.com/file/n44968/qkey.__png
  http://matplotlib.1069221.n5.nabble.com/file/n44968/qkey.png
   
quiverkey() doesn't work anymore...:
   
  http://matplotlib.1069221.n5.__nabble.com/file/n44968/qkey_1.__png
  http://matplotlib.1069221.n5.nabble.com/file/n44968/qkey_1.png
   
Code:
   
 fig = plt.figure(figsize=(12,12))
 map = Basemap(projection = 'cyl', llcrnrlat = -30,
  urcrnrlat = 90, \
 llcrnrlon = 0, urcrnrlon = 360, resolution =
  'c')
 [x,y] = N.meshgrid(lons,lats)
 [x,y] = map(x,y)
 [xulr,yulr] = N.meshgrid(lons1,lats1)
 [xulr,yulr] = map(xulr,yulr)
 clevs = N.arange(-50,51,5)
 cs = map.contourf(x,y,hgt500aComp[_
 _lag,:,:],cmap='RdBu_r',
 levels = clevs)
 cs1 =
  map.contour(x,y,hgt500Comp[__lag,:,:],N.arange(1110,1230,6)__, \
   
  colors='purple',linewidth=100,__linestyle = 'dashed')
 cs1 = map.contour(x,y,hgt500aComp[__lag,:,:],levels =
 clevs,
 colors = 'black')
   
   
  colors=[(244,2,255),(36,26,__232),(255,255,255),(8,232,61),
 __(224,255,0)]
 cmap = mF.make_cmap(colors, position=None, bit=True)
 clevs = N.arange(-30,30.025,.025)
 cs2 = map.contourf(xulr,yulr,__
 olrComp[lag,:,:],cmap=cmap,
 levels = clevs)
 Q =
  map.quiver(x[::2,::2],y[::2,::__2],u850Comp[lag,::2,::2],
 v850Comp[lag,::2,::2],width = 0.002,scale = 50)
 map.drawcoastlines(linewidth = 1)
 map.drawcountries(linewidth = 0.5)
 map.fillcontinents(zorder = 0)
 map.drawmeridians(N.arange(0,__360,30))
 map.drawparallels(N.arange(-__90,90,30))
 title = plt.title('Lag: {0} | Transition Cases | n =
{1}'.format(lag-30,len(cases))__)
 title.set_fontweight('bold')
 axt = fig.add_axes([.15,.35,.3,.01])
 cbar = plt.colorbar(cs,cax = axt,orientation =
 'horizontal')
 cbar.set_label('500-hPa Anomaly (m)')
 cbar.set_ticks(N.arange(-50,__51,25))
 cs1.clabel(fmt = '%d')
 axt = fig.add_axes([.58,.35,.3,.01])
 cbar2 = plt.colorbar(cs2,cax = axt,orientation =
  'horizontal')
 cbar2.set_label(r'OLR Anomaly ($W m^{-2}$)')
 cbar2.set_ticks(N.arange(-30,__31,10))
 qk = plt.quiverkey(Q,0.95,1.05,1.0,__r'1 $m
  s^{-1}$',labelpos='E')
   
   
   
--
View this message in context:
  http://matplotlib.1069221.n5.__nabble.com/quiverkey-doesn-t-
 __plot-the-reference-vector-__tp44968.html
  http://matplotlib.1069221.n5.nabble.com/quiverkey-doesn-t-
 plot-the-reference-vector-tp44968.html
Sent from the matplotlib - users mailing list archive at
 Nabble.com.
   
   
  --__
 --__--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server

Re: [Matplotlib-users] what are the new features of nbagg?

2015-02-18 Thread Thomas Caswell
Recent means IPython  2.4.

For 3.0

%matplotlib notebook

 will also work.

Tom

On Wed Feb 18 2015 at 7:25:41 PM Eric Firing efir...@hawaii.edu wrote:

 On 2015/02/18 6:44 AM, Emilia Petrisor wrote:
  Hi all,
 
  I looked for a link where I could find out what’s new in |matplotlib
  1.4.3|, but there is no one.
 
  Especially I’m interested in the new features of |nbagg backend|. All I
  know is what I read in an email here, namely that /The nbagg backend is
  looking great - some pretty swish new features/.
  Thanks,
 
  Emilia
 

 In a recent IPython, try starting up a notebook and using

 %matplotlib nbagg

 You will find that the embedded plot is fully interactive, complete with
 a cursor readout and navigation buttons.  I think that's the new part.

 Eric



 
 --
 Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
 from Actuate! Instantly Supercharge Your Business Reports and Dashboards
 with Interactivity, Sharing, Native Excel Exports, App Integration  more
 Get technology previously reserved for billion-dollar corporations, FREE
 http://pubads.g.doubleclick.net/gampad/clk?id=190641631;
 iu=/4140/ostg.clktrk
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration  more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] what are the new features of nbagg?

2015-02-18 Thread Thomas Caswell
Interesting, I was going off what the IPython devs said here
https://github.com/ipython/ipython/issues/7774

On Wed Feb 18 2015 at 7:48:32 PM Eric Firing efir...@hawaii.edu wrote:

 On 2015/02/18 2:31 PM, Thomas Caswell wrote:
  Recent means IPython  2.4.

 Did you mean 2.2?  It works on 2.3.

 Eric

 
  For 3.0
 
  %matplotlib notebook
 
will also work.
 
  Tom
 
  On Wed Feb 18 2015 at 7:25:41 PM Eric Firing efir...@hawaii.edu
  mailto:efir...@hawaii.edu wrote:
 
  On 2015/02/18 6:44 AM, Emilia Petrisor wrote:
Hi all,
   
I looked for a link where I could find out what’s new in
 |matplotlib
1.4.3|, but there is no one.
   
Especially I’m interested in the new features of |nbagg backend|.
  All I
know is what I read in an email here, namely that /The nbagg
  backend is
looking great - some pretty swish new features/.
Thanks,
   
Emilia
   
 
  In a recent IPython, try starting up a notebook and using
 
  %matplotlib nbagg
 
  You will find that the embedded plot is fully interactive, complete
 with
  a cursor readout and navigation buttons.  I think that's the new
 part.
 
  Eric
 
 
 
  --__
 --__--
  Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
  from Actuate! Instantly Supercharge Your Business Reports and
 Dashboards
  with Interactivity, Sharing, Native Excel Exports, App Integration 
  more
  Get technology previously reserved for billion-dollar corporations,
 FREE
  http://pubads.g.doubleclick.__net/gampad/clk?id=190641631__
 iu=/4140/ostg.clktrk
  http://pubads.g.doubleclick.net/gampad/clk?id=190641631;
 iu=/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
  https://lists.sourceforge.net/lists/listinfo/matplotlib-users
 


--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration  more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] quiverkey() doesn't plot the reference vector?

2015-02-18 Thread Thomas Caswell
Is this just on master or with 1.4.x?

On Wed Feb 18 2015 at 6:00:26 PM Eric Firing efir...@hawaii.edu wrote:

 On 2015/02/18 9:52 AM, njs wrote:
  Hi All,
 
  I'm having issues with quiver, and quiverkey() although, I have never
  experienced these issues in the past.  I attached an image to this post
 that
  demonstrates that quiver_key() used to work for me, this image was
 generated
  on 17-Jul-2014.  However, if I run this exact same code (see below for
 the
  code), the quiver key reference on the top right does not get plotted,
 but
  the text will.  I haven't changed anything, but I think there have been
 some
  package updates between then and now.  For what it's worth, I've tried
 many
  different ways to generate the quiverkey() and haven't had any luck.  Has
  anyone else experienced similar issues?

 That's alarming!  I can reproduce the problem even with the standard mpl
 example--the arrow is missing in 5 out of the 6 plots.  I will file a
 github issue.  Thanks for the report.

 Eric

 
  Thanks for any insights!
 
  Working quiverkey():
  http://matplotlib.1069221.n5.nabble.com/file/n44968/qkey.png
 
  quiverkey() doesn't work anymore...:
  http://matplotlib.1069221.n5.nabble.com/file/n44968/qkey_1.png
 
  Code:
 
   fig = plt.figure(figsize=(12,12))
   map = Basemap(projection = 'cyl', llcrnrlat = -30, urcrnrlat =
 90, \
   llcrnrlon = 0, urcrnrlon = 360, resolution = 'c')
   [x,y] = N.meshgrid(lons,lats)
   [x,y] = map(x,y)
   [xulr,yulr] = N.meshgrid(lons1,lats1)
   [xulr,yulr] = map(xulr,yulr)
   clevs = N.arange(-50,51,5)
   cs = map.contourf(x,y,hgt500aComp[lag,:,:],cmap='RdBu_r',
   levels = clevs)
   cs1 = map.contour(x,y,hgt500Comp[lag,:,:],N.arange(1110,1230,6),
 \
   colors='purple',linewidth=100,linestyle =
 'dashed')
   cs1 = map.contour(x,y,hgt500aComp[lag,:,:],levels = clevs,
   colors = 'black')
 
  colors=[(244,2,255),(36,26,232),(255,255,255),(8,232,61),(224,255,0)]
   cmap = mF.make_cmap(colors, position=None, bit=True)
   clevs = N.arange(-30,30.025,.025)
   cs2 = map.contourf(xulr,yulr,olrComp[lag,:,:],cmap=cmap,
   levels = clevs)
   Q = map.quiver(x[::2,::2],y[::2,::2],u850Comp[lag,::2,::2],
   v850Comp[lag,::2,::2],width = 0.002,scale = 50)
   map.drawcoastlines(linewidth = 1)
   map.drawcountries(linewidth = 0.5)
   map.fillcontinents(zorder = 0)
   map.drawmeridians(N.arange(0,360,30))
   map.drawparallels(N.arange(-90,90,30))
   title = plt.title('Lag: {0} | Transition Cases | n =
  {1}'.format(lag-30,len(cases)))
   title.set_fontweight('bold')
   axt = fig.add_axes([.15,.35,.3,.01])
   cbar = plt.colorbar(cs,cax = axt,orientation = 'horizontal')
   cbar.set_label('500-hPa Anomaly (m)')
   cbar.set_ticks(N.arange(-50,51,25))
   cs1.clabel(fmt = '%d')
   axt = fig.add_axes([.58,.35,.3,.01])
   cbar2 = plt.colorbar(cs2,cax = axt,orientation = 'horizontal')
   cbar2.set_label(r'OLR Anomaly ($W m^{-2}$)')
   cbar2.set_ticks(N.arange(-30,31,10))
   qk = plt.quiverkey(Q,0.95,1.05,1.0,r'1 $m
 s^{-1}$',labelpos='E')
 
 
 
  --
  View this message in context: http://matplotlib.1069221.n5.
 nabble.com/quiverkey-doesn-t-plot-the-reference-vector-tp44968.html
  Sent from the matplotlib - users mailing list archive at Nabble.com.
 
  
 --
  Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
  from Actuate! Instantly Supercharge Your Business Reports and Dashboards
  with Interactivity, Sharing, Native Excel Exports, App Integration  more
  Get technology previously reserved for billion-dollar corporations, FREE
  http://pubads.g.doubleclick.net/gampad/clk?id=190641631;
 iu=/4140/ostg.clktrk
  ___
  Matplotlib-users mailing list
  Matplotlib-users@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/matplotlib-users
 


 
 --
 Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
 from Actuate! Instantly Supercharge Your Business Reports and Dashboards
 with Interactivity, Sharing, Native Excel Exports, App Integration  more
 Get technology previously reserved for billion-dollar corporations, FREE
 http://pubads.g.doubleclick.net/gampad/clk?id=190641631;
 iu=/4140/ostg.clktrk
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
Download BIRT iHub F-Type - The Free 

Re: [Matplotlib-users] Event errors in qt5 backend after recent commit

2015-02-18 Thread Thomas Caswell
Jorge,

I have put in a PR to fix this issue.  Can you confirm that it is
equivalent to your fix?  For aesthetic reasons I chose to pass guiEvent as
a kwarg to all of the event related functions.

https://github.com/matplotlib/matplotlib/pull/4130

Tom

On Wed Feb 18 2015 at 5:32:04 PM Thomas Caswell tcasw...@gmail.com wrote:

 Can you put in a pull request with those changes please?

 On Wed, Feb 18, 2015, 17:03 Jorge Scandaliaris jorgesmbox...@yahoo.es
 wrote:

 Hi,
 A recent commit against lib/matplotlib/backends/backend_qt5.py [1] causes
 some errors in code that was working fine before. The error is as follows:

 
 ---
 TypeError Traceback (most recent call
 last)
 /home/jscandal/sw/matplotlib/matplotlib.py3/lib/matplotlib/backends
 /backend_qt5.py
 in enterEvent(self, event)
 249
 250 def enterEvent(self, event):
 -- 251 FigureCanvasBase.enter_notify_event(self, event,
 guiEvent=event)
 252
 253 def leaveEvent(self, event):

 TypeError: enter_notify_event() got multiple values for argument
 'guiEvent'

 
 ---
 TypeError Traceback (most recent call
 last)
 /home/jscandal/sw/matplotlib/matplotlib.py3/lib/matplotlib/backends
 /backend_qt5.py
 in leaveEvent(self, event)
 253 def leaveEvent(self, event):
 254 QtWidgets.QApplication.restoreOverrideCursor()
 -- 255 FigureCanvasBase.leave_notify_event(self, event,
 guiEvent=event)
 256
 257 def mousePressEvent(self, event):

 TypeError: leave_notify_event() got multiple values for argument
 'guiEvent'



 Reverting the changes introduced by the commit in lines 251 and 255 of
 backend_qt5.py seems to fix the issue, in my particular use case.

 Regards,

 Jorge


 1.
 b72e0cd9e63f7cf4bec2908143c62c23666b674a
 Author: Steven Silvester steven.silves...@ieee.org
 Date:   Sun Feb 15 09:38:21 2015 -0600

 Add guiEvent data to Qt backend



 
 --
 Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
 from Actuate! Instantly Supercharge Your Business Reports and Dashboards
 with Interactivity, Sharing, Native Excel Exports, App Integration  more
 Get technology previously reserved for billion-dollar corporations, FREE
 http://pubads.g.doubleclick.net/gampad/clk?id=190641631iu=/
 4140/ostg.clktrk
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration  more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] [matplotlib-devel] 1.4.3 does not build on Ubuntu 14 with python3

2015-03-18 Thread Thomas Caswell
We do support ubuntu, travis.ci (which we use for continuous integration
testing) is ubuntu based and my main development box is ubuntu (but I
mostly work inside conda environments rather than virtualenvs these days).
Even though it is the worst thing for a dev to say, 'it works on my
machine'.

Part of the problem here is that it looks like you are doing system-wide
installations from source so you have almost certainly driven your system
into an inconsistent state.  Unless you know enough sys-admin magic to
ensure you won't step on the toes of the system packages, I strongly
suggest _never_ using sudo to install python packages.  Either use
venv/conda or install into a directory in your home directory and modify
$PYTHONPATH as needed.

 I know it is frustrating, but there isn't a whole lot we can do to help
you with you knowing exactly what you have done to your system.

In any case antagonizing the developers and the debian packager is _not_
the most effective course of action.  I assure you all of us are making a
good faith effort to make sure mpl works everywhere.  Starting from that
assumption will make all of these conversations go much more smoothly.
Also remember everyone responding to you on this list is a volunteer,
please be respectful of our time and energy.

Tom

On Wed, Mar 18, 2015 at 1:27 PM Benjamin Root ben.r...@ou.edu wrote:

 We would too. This is the first time I have seen updating setuptools not
 work. That was the fix... I have no clue why it is broken on your system.

 On Wed, Mar 18, 2015 at 1:20 PM, keith.bri...@bt.com wrote:

 Ok, I will check out anaconda anyway.



 I would think that the matplotlib maintainers would want to make sure
 they support the very popular Ubuntu platform, even if a workaround for a
 bug elsewhere is needed.



 K





 *From:* ben.v.r...@gmail.com [mailto:ben.v.r...@gmail.com] *On Behalf Of
 *Benjamin Root
 *Sent:* 18 March 2015 17:17
 *To:* Briggs,KM,Keith,TUB2 R; Matplotlib Users


 *Subject:* Re: [matplotlib-devel] 1.4.3 does not build on Ubuntu 14 with
 python3



 One thing I just noticed is that python3.4 and the distutils libraries
 are installed at /usr/lib/python3.4/distutils/, but the setuptools is
 located at /usr/local/lib/python3.4/dist-packages/. One of the oddities
 of setuptools is that it monkey-patches distutils, if I understand it
 correctly, so perhaps it isn't doing it correctly for some reason? I
 haven't a clue, really.

 This oddity in directory structures was actually one thing I noticed in
 Ubuntu last summer/fall for py2.7 that broke a lot of things for me. I was
 in a rush at the time, so I just switched to anaconda, nuked everything
 python in my .local and moved on. That is always an option here, but it
 would be nice to get to the bottom of this as well.

 Ben Root



 On Wed, Mar 18, 2015 at 1:03 PM, keith.bri...@bt.com wrote:

 Ben: thanks for your help - it's very much appreciated!
 Keith

 kbriggs:~/Downloads/matplotlib-1.4.3 python3
 Python 3.4.0 (default, Apr 11 2014, 13:05:11)
 [GCC 4.8.2] on linux
 Type help, copyright, credits or license for more information.
 
  import setuptools
  print(setuptools.__file__)
 /usr/local/lib/python3.4/dist-packages/setuptools-14.3-py3.
 4.egg/setuptools/__init__.py
 


 kbriggs:~/Downloads/matplotlib-1.4.3 python
 Python 2.7.6 (default, Mar 22 2014, 22:59:56)
 [GCC 4.8.2] on linux2
 Type help, copyright, credits or license for more information.
 
  import setuptools
  print(setuptools.__file__)
 /usr/lib/python2.7/dist-packages/setuptools/__init__.pyc
 


 
 From: ben.v.r...@gmail.com [ben.v.r...@gmail.com] On Behalf Of Benjamin
 Root [ben.r...@ou.edu]
 Sent: 18 March 2015 16:58
 To: Briggs,KM,Keith,TUB2 R
 Cc: matplotlib development list
 Subject: Re: [matplotlib-devel] 1.4.3 does not build on Ubuntu 14 with
 python3

 Keith,

 Back to the issue at hand. could you do the following?

 import setuptools
 print(setuptools.__file__)

 It would be interesting to see if that path differs from the path of the
 egg you just listed.
 Ben

 On Wed, Mar 18, 2015 at 11:39 AM, keith.bri...@bt.commailto:ke
 ith.bri...@bt.com wrote:
 pip still thinks I have the latest.   I think it's a question of how to
 force the matplotlib setup.py to use actually it.
 Keith

 kbriggs:~/Downloads/matplotlib-1.4.3 sudo pip3  install setuptools
 --upgrade
 Requirement already up-to-date: setuptools in
 /usr/local/lib/python3.4/dist-packages/setuptools-14.3-py3.4.egg
 Cleaning up...

 
 From: ben.v.r...@gmail.commailto:ben.v.r...@gmail.com [
 ben.v.r...@gmail.commailto:ben.v.r...@gmail.com] On Behalf Of Benjamin
 Root [ben.r...@ou.edumailto:ben.r...@ou.edu]
 Sent: 18 March 2015 15:33
 To: Briggs,KM,Keith,TUB2 R
 Cc: matplotlib development list
 Subject: Re: [matplotlib-devel] 1.4.3 does not build on Ubuntu 14 with
 python3

 I would just use pip. Ubuntu/Debian has really messed up the python
 environment in more ways than one.

 

Re: [Matplotlib-users] [matplotlib-devel] 1.4.3 does not build on Ubuntu 14 with python3

2015-03-18 Thread Thomas Caswell
Hmm, I can't read and miss-attributed who was antagonizing Sandro, please
don't do that.

On Wed, Mar 18, 2015 at 2:01 PM Benjamin Root ben.r...@ou.edu wrote:

 For my part, I didn't take Keith's comment as antagonizing. If anything, I
 should apologize to Sandro. It was not necessary for me to drag Debian into
 this, because all I know is that I was having issues on Ubuntu.

 Ben Root

 On Wed, Mar 18, 2015 at 1:51 PM, Thomas Caswell tcasw...@gmail.com
 wrote:

 We do support ubuntu, travis.ci (which we use for continuous integration
 testing) is ubuntu based and my main development box is ubuntu (but I
 mostly work inside conda environments rather than virtualenvs these days).
 Even though it is the worst thing for a dev to say, 'it works on my
 machine'.

 Part of the problem here is that it looks like you are doing system-wide
 installations from source so you have almost certainly driven your system
 into an inconsistent state.  Unless you know enough sys-admin magic to
 ensure you won't step on the toes of the system packages, I strongly
 suggest _never_ using sudo to install python packages.  Either use
 venv/conda or install into a directory in your home directory and modify
 $PYTHONPATH as needed.

  I know it is frustrating, but there isn't a whole lot we can do to help
 you with you knowing exactly what you have done to your system.

 In any case antagonizing the developers and the debian packager is _not_
 the most effective course of action.  I assure you all of us are making a
 good faith effort to make sure mpl works everywhere.  Starting from that
 assumption will make all of these conversations go much more smoothly.
 Also remember everyone responding to you on this list is a volunteer,
 please be respectful of our time and energy.

 Tom

 On Wed, Mar 18, 2015 at 1:27 PM Benjamin Root ben.r...@ou.edu wrote:

 We would too. This is the first time I have seen updating setuptools not
 work. That was the fix... I have no clue why it is broken on your system.

 On Wed, Mar 18, 2015 at 1:20 PM, keith.bri...@bt.com wrote:

 Ok, I will check out anaconda anyway.



 I would think that the matplotlib maintainers would want to make sure
 they support the very popular Ubuntu platform, even if a workaround for a
 bug elsewhere is needed.



 K





 *From:* ben.v.r...@gmail.com [mailto:ben.v.r...@gmail.com] *On Behalf
 Of *Benjamin Root
 *Sent:* 18 March 2015 17:17
 *To:* Briggs,KM,Keith,TUB2 R; Matplotlib Users


 *Subject:* Re: [matplotlib-devel] 1.4.3 does not build on Ubuntu 14
 with python3



 One thing I just noticed is that python3.4 and the distutils libraries
 are installed at /usr/lib/python3.4/distutils/, but the setuptools is
 located at /usr/local/lib/python3.4/dist-packages/. One of the
 oddities of setuptools is that it monkey-patches distutils, if I understand
 it correctly, so perhaps it isn't doing it correctly for some reason? I
 haven't a clue, really.

 This oddity in directory structures was actually one thing I noticed in
 Ubuntu last summer/fall for py2.7 that broke a lot of things for me. I was
 in a rush at the time, so I just switched to anaconda, nuked everything
 python in my .local and moved on. That is always an option here, but it
 would be nice to get to the bottom of this as well.

 Ben Root



 On Wed, Mar 18, 2015 at 1:03 PM, keith.bri...@bt.com wrote:

 Ben: thanks for your help - it's very much appreciated!
 Keith

 kbriggs:~/Downloads/matplotlib-1.4.3 python3
 Python 3.4.0 (default, Apr 11 2014, 13:05:11)
 [GCC 4.8.2] on linux
 Type help, copyright, credits or license for more information.
 
  import setuptools
  print(setuptools.__file__)
 /usr/local/lib/python3.4/dist-packages/setuptools-14.3-py3.
 4.egg/setuptools/__init__.py
 


 kbriggs:~/Downloads/matplotlib-1.4.3 python
 Python 2.7.6 (default, Mar 22 2014, 22:59:56)
 [GCC 4.8.2] on linux2
 Type help, copyright, credits or license for more information.
 
  import setuptools
  print(setuptools.__file__)
 /usr/lib/python2.7/dist-packages/setuptools/__init__.pyc
 


 
 From: ben.v.r...@gmail.com [ben.v.r...@gmail.com] On Behalf Of
 Benjamin Root [ben.r...@ou.edu]
 Sent: 18 March 2015 16:58
 To: Briggs,KM,Keith,TUB2 R
 Cc: matplotlib development list
 Subject: Re: [matplotlib-devel] 1.4.3 does not build on Ubuntu 14 with
 python3

 Keith,

 Back to the issue at hand. could you do the following?

 import setuptools
 print(setuptools.__file__)

 It would be interesting to see if that path differs from the path of
 the egg you just listed.
 Ben

 On Wed, Mar 18, 2015 at 11:39 AM, keith.bri...@bt.commailto:ke
 ith.bri...@bt.com wrote:
 pip still thinks I have the latest.   I think it's a question of how to
 force the matplotlib setup.py to use actually it.
 Keith

 kbriggs:~/Downloads/matplotlib-1.4.3 sudo pip3  install setuptools
 --upgrade
 Requirement already up-to-date: setuptools in
 /usr/local/lib/python3.4/dist-packages/setuptools-14.3-py3.4.egg
 Cleaning up

Re: [Matplotlib-users] Best way to display image from URL in Python3

2015-03-20 Thread Thomas Caswell
I think `six` (which we use to smooth over the 2/3 changes) has a way of
dealing with atleast the urllib renaming .

On Fri, Mar 20, 2015 at 11:58 AM Ryan Nelson rnelsonc...@gmail.com wrote:

 For me, if I change the script from the PR to what is shown below,
 everything works fine in both Python 2.7 and 3.4 (Anaconda environments,
 everything updated):
 ##
 url = 'http://www.libpng.org/pub/png/img_png/pngnow.png'
 try:
 import urllib2
 data = urllib2.urlopen(url)
 except Exception:
 import urllib.request
 from io import BytesIO
 data = BytesIO(urllib.request.urlopen(url).read())

 from matplotlib import pyplot

 image = pyplot.imread(data)  # crash on py3.x
 pyplot.imshow(image)
 pyplot.show()
 #
 But as you can see, the Python 3 version requires the addition of BytesIO
 and read(). I take it that this is not supposed to be the case.

 Ryan

 On Fri, Mar 20, 2015 at 11:48 AM, Ryan Nelson rnelsonc...@gmail.com
 wrote:

 Thanks, Ben. I should have made that more clear. If I run the code from
 the PR, I get the following error:

 Traceback (most recent call last):
   File junk.py, line 11, in module
 image = pyplot.imread(data)  # crash on py3.x
   File
 /home/nelson/apps/miniconda/lib/python3.4/site-packages/matplotlib/pyplot.py,
 line 2215, in imread
 return _imread(*args, **kwargs)
   File
 /home/nelson/apps/miniconda/lib/python3.4/site-packages/matplotlib/image.py,
 line 1270, in imread
 return handler(fname)
 RuntimeError: _image_module::readpng: file not recognized as a PNG file

 My code that I'm trying to port essentially does the same thing, and I
 get the same error. I ran this example just now from Anaconda Python 3.4
 install with MPL 1.4.3.

 My impression from the PR was that this should work out of the box now. I
 figured that maybe that was not quite the case. The implementations between
 Py2 and 3 are quite different. Figured there must be a different way that I
 wasn't aware of.

 Ryan

 On Fri, Mar 20, 2015 at 9:51 AM, Benjamin Root ben.r...@ou.edu wrote:

 According to the PR you reference, the fix for this was merged back in
 Jan 2013, so that means that this fix is in version 1.2.x and up. Are you
 saying that you still can't do imread(urllib.request.urlopen(url))?

 On Thu, Mar 19, 2015 at 8:54 PM, Ryan Nelson rnelsonc...@gmail.com
 wrote:

 Hello all,

 I'm porting over some code that used Py2.7 urllib2.urlopen(url) to grab
 some image data from the net and load with pyplot.imread. It doesn't work
 quite right in Py3.4. I found a couple of refs:

 https://github.com/matplotlib/matplotlib/pull/1650

 http://stackoverflow.com/questions/15183170/python-crash-when-downloading-image-as-numpy-array

 They suggest io.BytesIO(urllib.request.urlopen(url).read()) as a
 replacement for Py3. Is this the best practice? Does anyone know a simpler
 way to do this?

 Ryan


 --
 Dive into the World of Parallel Programming The Go Parallel Website,
 sponsored
 by Intel and developed in partnership with Slashdot Media, is your hub
 for all
 things parallel software development, from weekly thought leadership
 blogs to
 news, videos, case studies, tutorials and more. Take a look and join the
 conversation now. http://goparallel.sourceforge.net/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users




 
 --
 Dive into the World of Parallel Programming The Go Parallel Website,
 sponsored
 by Intel and developed in partnership with Slashdot Media, is your hub for
 all
 things parallel software development, from weekly thought leadership blogs
 to
 news, videos, case studies, tutorials and more. Take a look and join the
 conversation now. http://goparallel.sourceforge.net/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Best way to display image from URL in Python3

2015-03-20 Thread Thomas Caswell
Despite my grumping earlier, a PR that makes URLs just work is probably a
good idea and would be merged.

Tom

On Fri, Mar 20, 2015 at 3:59 PM Jerzy Karczmarczuk 
jerzy.karczmarc...@unicaen.fr wrote:


 Le 20/03/2015 16:57, Ryan Nelson a écrit :
  For me, if I change the script from the PR to what is shown below,
  everything works fine in both Python 2.7 and 3.4 (Anaconda
  environments, everything updated):
  ##
  url = 'http://www.libpng.org/pub/png/img_png/pngnow.png'
  try:
  import urllib2
  data = urllib2.urlopen(url)
  except Exception:
  import urllib.request
  from io import BytesIO
  data = BytesIO(urllib.request.urlopen(url).read())
 
  from matplotlib import pyplot
 
  image = pyplot.imread(data)  # crash on py3.x
  pyplot.imshow(image)
  pyplot.show()
  #
  But as you can see, the Python 3 version requires the addition of
  BytesIO and read(). I take it that this is not supposed to be the case.

 It works for X.png, not for X.jpg. The call of imread() fails then.
 Tested also under 3.4/Anaconda.

 Jerzy Karczmarczuk


 
 --
 Dive into the World of Parallel Programming The Go Parallel Website,
 sponsored
 by Intel and developed in partnership with Slashdot Media, is your hub for
 all
 things parallel software development, from weekly thought leadership blogs
 to
 news, videos, case studies, tutorials and more. Take a look and join the
 conversation now. http://goparallel.sourceforge.net/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Draggable is not working on multiple legends of plots which are generated with twinx()

2015-03-11 Thread Thomas Caswell
As I said in the first email, you need to put both legend artists on the
top axes.  The link is to the documentation on _how_ to put more than one
legend in the same axes.

Tom

On Wed, Mar 11, 2015 at 10:58 AM liu lily politoeso...@gmail.com wrote:

 thanks,
 then are there any workaround on my case?
 or are there any other libaries which I CAN use to plot and manipulate the
 GUI?

 On Wed, Mar 11, 2015 at 3:54 PM, Benjamin Root ben.r...@ou.edu wrote:

 By top he means whichever axes was added most recently. When twining,
 the new axes is added on top of the original axes.

 I hope that clears it up.

 Ben Root

 On Wed, Mar 11, 2015 at 10:05 AM, liu lily politoeso...@gmail.com
 wrote:

 I dont understand
 you say it is the first axe
 but why in my case, only the second legend is draggable? it is in the
 second axe

 besides, since I have to use both y-axis on the left and on the right,
 it seems I have to have two axes,
 are there any workarounds? thanks!

 On Wed, Mar 11, 2015 at 2:22 PM, Thomas Caswell tcasw...@gmail.com
 wrote:

 The mouse events only propagate to the top axes.  You will have to add
 both legends to the same (top) axes.

 See http://matplotlib.org/users/legend_guide.html#multiple-legend


 Tom
 On Wed, Mar 11, 2015, 08:57 liu lily politoeso...@gmail.com wrote:

 Hi, all:

 I have two legends, as below, I find that I can't drag the first
 legend, what is the problem? how to deal with it? thanks!

 import matplotlib.pyplot as plt

 fig1, ax1 = plt.subplots()
 ax2 = ax1.twinx()

 ax1.plot([1,2,3],[0.1,0.82,0.3],'y*', label=one)
 ax2.plot([1,2,3],[5,6,7],'ro', label=two)

 leg1 = ax1.legend()
 leg2 = ax2.legend()

 leg1.draggable(state=True)
 leg2.draggable(state=True)
 plt.show()

 
 --
 Dive into the World of Parallel Programming The Go Parallel Website,
 sponsored
 by Intel and developed in partnership with Slashdot Media, is your hub
 for all
 things parallel software development, from weekly thought leadership
 blogs to
 news, videos, case studies, tutorials and more. Take a look and join
 the
 conversation now. http://goparallel.sourceforge.net/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users




 --
 Dive into the World of Parallel Programming The Go Parallel Website,
 sponsored
 by Intel and developed in partnership with Slashdot Media, is your hub
 for all
 things parallel software development, from weekly thought leadership
 blogs to
 news, videos, case studies, tutorials and more. Take a look and join the
 conversation now. http://goparallel.sourceforge.net/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users




--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Avoid circular references with format_coord and Qt?

2015-03-08 Thread Thomas Caswell
My knee-jerk reaction is to move the definition of `format` outside of the
`Visualize.__init__` method.  If you need to have hooks back into the
visualize method I would use a function factory + weak refs or a class
(again with weakrefs) with a `__call__` method.

Tom

On Sun, Mar 8, 2015 at 3:35 PM Sebastian Berg sebast...@sipsolutions.net
wrote:

 Hey,

 probably there is nothing to help me here, but I have a QtGui, using
 matplotlib and basically end up in a circular reference hell that is not
 resolvable by the gc. After removing almost all circular references, the
 python inherited QWidget that embeds the figurecanvas is now deleted
 fine.

 The thing I end up with however is something like

 class Visualize(object):
  def __init__(self):
  self.figure = Figure()
  canvas = FigureCanvas(self.figure)
  PythonInheritedQtWidget(self).element.setWidget(canvas)

  def format(*args):
  # do stuff
  return something
  self.axis = self.figure.add_subplot(1, 1, 1)
  self.axis.format_coord = format

  # This was completely drawn with canvas and all
  # PythonInheritedQtWidget is deleted fine.

 I have not been able to get a minimal test case. But I have it pinned
 down that everything can get cleaned up after:

 del Visualize.axes.format_coord

 so the circular reference that makes it not collectable is only the
 format_coord which is a method pointing to the class owning the figure
 and the axis. I am about to just use a weak reference wrapper function
 to break the circle but it seems silly.

 Anyway, I do not expect that anyone can help, and I expect it is some Qt
 stuff really, but this is seriously annoying me

 - Sebastian
 
 --
 Dive into the World of Parallel Programming The Go Parallel Website,
 sponsored
 by Intel and developed in partnership with Slashdot Media, is your hub for
 all
 things parallel software development, from weekly thought leadership blogs
 to
 news, videos, case studies, tutorials and more. Take a look and join the
 conversation now. http://goparallel.sourceforge.net/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] IPython's matplotlib inline magic is really magic? Actually it might resets axes bounds...

2015-03-13 Thread Thomas Caswell
This is due to the fact that by default the inline backend saves the pngs
using `boundingbox_inches='tight'`.  The design goal on the mpl side of
this kwargs was to trim off extra whitespace, but the way it is implemented
works just as effectively to expand to fit artists that fall outside of the
figure.  I assume the choice to make this the default in inline was to
waste as little space as possible.

A possibly more reliable method to get the same effect is to use
`tight_layout` (see http://matplotlib.org/users/tight_layout_guide.html)

There was talk of replacing that implementation with a linear constraint
solver, but not much progress has been made in that direction (see
https://github.com/matplotlib/matplotlib/issues/1109)

Tom

On Fri, Mar 13, 2015 at 3:01 PM Ryan Nelson rnelsonc...@gmail.com wrote:

 I'm constructing a multi-plot figure using an IPython notebook (v3) and
 matplotlib (v1.4.3) inline magic. I was manually setting the axes bounds,
 and I ended up with something like the following:

 
 import matplotlib.pyplot as plt
 %matplotlib inline

 bottom = 0.12
 top = 0.9
 left = 0.12
 axwidth = (1-(left*2))/3

 fig = plt.figure(figsize=(10,4))

 ax1 = fig.add_axes((left, bottom, axwidth, top))
 ax1.set_title('Title')
 #ax1.tick_params(labelleft=False)

 ax2 = fig.add_axes((left+axwidth, bottom, axwidth, top),
sharex=ax1, sharey=ax1)
 ax2.tick_params(labelleft=False)

 ax3 = fig.add_axes((left+axwidth*2, bottom, axwidth, top),
sharex=ax1, sharey=ax1)
 ax3.tick_params(labelleft=False)

 fig.savefig('junk.pdf', format='pdf')
 fig.savefig('junk2.png')
 ###

 Obviously, the bottom+top that I've selected is 1, so the axes should go
 off the top of the figure. (Stupid, I know...) The axes in both the PDF and
 PNG formatted files are clipped by the top of the figure as you would
 expect; however, the figure that is displayed in the Notebook looks just
 fine. In addition, if you add a title to one of the axes, the figure in
 IPython suddenly creates more space for the text. Maybe it is rearranging
 the axes information behind the scenes?

 I'm curious why this design decision was made. I would say this is a bug.
 Now that I know about this behavior, I can easily fix it. But new users
 will be baffled when their saved figure looks nothing like the displayed
 figure in the notebook.

 Ryan
 
 --
 Dive into the World of Parallel Programming The Go Parallel Website,
 sponsored
 by Intel and developed in partnership with Slashdot Media, is your hub for
 all
 things parallel software development, from weekly thought leadership blogs
 to
 news, videos, case studies, tutorials and more. Take a look and join the
 conversation now. http://goparallel.sourceforge.net/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Draggable is not working on multiple legends of plots which are generated with twinx()

2015-03-11 Thread Thomas Caswell
The mouse events only propagate to the top axes.  You will have to add both
legends to the same (top) axes.

See http://matplotlib.org/users/legend_guide.html#multiple-legend


Tom
On Wed, Mar 11, 2015, 08:57 liu lily politoeso...@gmail.com wrote:

 Hi, all:

 I have two legends, as below, I find that I can't drag the first legend,
 what is the problem? how to deal with it? thanks!

 import matplotlib.pyplot as plt

 fig1, ax1 = plt.subplots()
 ax2 = ax1.twinx()

 ax1.plot([1,2,3],[0.1,0.82,0.3],'y*', label=one)
 ax2.plot([1,2,3],[5,6,7],'ro', label=two)

 leg1 = ax1.legend()
 leg2 = ax2.legend()

 leg1.draggable(state=True)
 leg2.draggable(state=True)
 plt.show()

 
 --
 Dive into the World of Parallel Programming The Go Parallel Website,
 sponsored
 by Intel and developed in partnership with Slashdot Media, is your hub for
 all
 things parallel software development, from weekly thought leadership blogs
 to
 news, videos, case studies, tutorials and more. Take a look and join the
 conversation now. http://goparallel.sourceforge.net/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] 'c' Keyword for color not working with latest IPython 3.0.0

2015-03-30 Thread Thomas Caswell
This bug has already been fixed in the source.

The work around for now is to use the full name `color='r'` instead of the
alais 'c'.

Tom

On Mon, Mar 30, 2015 at 11:06 PM Yuxiang Wang yw...@virginia.edu wrote:

 Dear all,

 I have tried both latest Anaconda and WinPython in Windows 7, 64-bit
 system, with Python 3.4 64-bit, and both run into this issue:

 1) Open up a new IPython QtConsole (version 3.0.0), and make sure
 matplotlib version is 1.4.3
 2) It doesn't matter which backend you are using. Do:
 ```python
 import matplotlib.pyplot as plt
 plt.plot(range(5), c='r')
 ```
 3) The default color blue showed up, rather than red.

 Could anyone please help me with this? Can you repeat the error that I see
 here?

 Thanks!

 Shawn

 --
 Yuxiang Shawn Wang
 Gerling Research Lab
 University of Virginia
 yw...@virginia.edu
 +1 (434) 284-0836
 https://sites.google.com/a/virginia.edu/yw5aj/

 
 --
 Dive into the World of Parallel Programming The Go Parallel Website,
 sponsored
 by Intel and developed in partnership with Slashdot Media, is your hub for
 all
 things parallel software development, from weekly thought leadership blogs
 to
 news, videos, case studies, tutorials and more. Take a look and join the
 conversation now. http://goparallel.sourceforge.net/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] [matplotlib-devel] 1.4.3 does not build on Ubuntu 14 with python3

2015-04-01 Thread Thomas Caswell
Independent of what exactly is going wrong, the issue is that it _isn't_
finding the right version of freetype and iirc LooseVersion is handling the
'not found' return code badly.  This is coming up often enough we probably
do need to special case this check with a try/except.

On Wed, Apr 1, 2015 at 9:50 AM Benjamin Root ben.r...@ou.edu wrote:

 Actually, look at the traceback... it is using distutils' version.py.
 That's weird. Is that a result of setuptools monkey-patching?

 On Wed, Apr 1, 2015 at 9:25 AM, Jens Nielsen jenshniel...@gmail.com
 wrote:

 I think we have seen this issue before and it seems to be caused by an
 out of date version of setuptools. I tried reproducing it on fresh ubuntu
 14.04 machine but was not able to reproduce the issue. Do you know which
 version of setuptools you are using?

 Jens

 ons. 1. apr. 2015 kl. 14.19 skrev Thomas Caswell tcasw...@gmail.com:

 Make sure you have `freetype-dev` installed at the system level.

 Tom

 On Wed, Apr 1, 2015 at 8:02 AM Christian Ambros ambr...@ymail.com
 wrote:

 Hi,

 I'm facing the same trouble with installing matplotlib 1.4.3 and
 1.5.dev1. running

 python3 setup.py build

 in the unarchived directory gives this:

 
 Edit setup.cfg to change the build options

 BUILDING MATPLOTLIB
 matplotlib: yes [1.5.dev1]
 python: yes [3.4.0 (default, Apr 11 2014, 13:05:11)
 [GCC
 4.8.2]]
   platform: yes [linux]

 REQUIRED DEPENDENCIES AND EXTENSIONS
  numpy: yes [version 1.9.2]
six: yes [using six version 1.5.2]
   dateutil: yes [using dateutil version 2.0]
   pytz: yes [using pytz version 2012c]
tornado: yes [using tornado version 3.1.1]
  pyparsing: yes [using pyparsing version 2.0.1]
 libagg: yes [Requires patches that have not been merged
 upstream. Using local copy.]
 Traceback (most recent call last):
   File setup.py, line 153, in module
 result = package.check()
   File /home/ambrosc/Downloads/matplotlib-master/setupext.py, line
 900, in check
 min_version='2.3', version=version)
   File /home/ambrosc/Downloads/matplotlib-master/setupext.py, line
 446, in _check_for_pkg_config
 if (not is_min_version(version, min_version)):
   File /home/ambrosc/Downloads/matplotlib-master/setupext.py, line
 173, in is_min_version
 return found_version = expected_version
   File /usr/lib/python3.4/distutils/version.py, line 76, in __ge__
 c = self._cmp(other)
   File /usr/lib/python3.4/distutils/version.py, line 343, in _cmp
 if self.version  other.version:
 TypeError: unorderable types: str()  int()

 I'm running Linux Mint 17 Quina which is based on Ubuntu's trusty
 packges.

 pip3 is up to date. Running
 print(setuptools.__file__)

 gives: /usr/local/lib/python3.4/dist-packages/setuptools/__init__.py
 which is as expected.

 Using pip3 install matplotlib --upgrade #even to 1.4.3
 get's me this:


 Collecting matplotlib from
 https://pypi.python.org/packages/source/m/matplotlib/matplotlib-1.4.3.tar.gz#md5=86af2e3e3c61849ac7576a6f5ca44267
   Downloading matplotlib-1.4.3.tar.gz (50.4MB)
 100% || 50.4MB 8.0kB/s
 Traceback (most recent call last):
   File string, line 20, in module
   File /tmp/pip-build-sezmzam8/matplotlib/setup.py, line 155, in
 module
 result = package.check()
   File /tmp/pip-build-sezmzam8/matplotlib/setupext.py, line 961,
 in check
 min_version='2.3', version=version)
   File /tmp/pip-build-sezmzam8/matplotlib/setupext.py, line 445,
 in _check_for_pkg_config
 if (not is_min_version(version, min_version)):
   File /tmp/pip-build-sezmzam8/matplotlib/setupext.py, line 173,
 in is_min_version
 return found_version = expected_version
   File /usr/lib/python3.4/distutils/version.py, line 76, in __ge__
 c = self._cmp(other)
   File /usr/lib/python3.4/distutils/version.py, line 343, in _cmp
 if self.version  other.version:
 TypeError: unorderable types: str()  int()

 
 Edit setup.cfg to change the build options
 BUILDING MATPLOTLIB
 matplotlib: yes [1.4.3]
 python: yes [3.4.0 (default, Apr 11 2014,
 13:05:11)  [GCC
 4.8.2]]
   platform: yes [linux]
 REQUIRED DEPENDENCIES AND EXTENSIONS
  numpy: yes [version 1.9.2]
six: yes [using six version 1.5.2]
   dateutil: yes [using dateutil version 2.0]
   pytz: yes [using pytz version 2012c]
tornado: yes [using tornado version 3.1.1]
  pyparsing: yes [using pyparsing version 2.0.1

Re: [Matplotlib-users] Plotting style

2015-03-03 Thread Thomas Caswell
Yes, we are interested it more built-in themes.

It may be worth making a 'matplotlib-styles' project which is _just_ a
style library.

On Tue, Mar 3, 2015 at 11:23 AM Marin GILLES mrngil...@gmail.com wrote:

  Le 03/03/2015 16:32, Christian Alis a écrit :

 Hi Marin,

 Have you looked at the style sheets examples in the gallery?
 http://matplotlib.org/gallery.html#style_sheets

 Regards,

 Christian


 On Tue, Mar 3, 2015 at 3:08 PM, Marin GILLES mrngil...@gmail.com 
 mrngil...@gmail.com wrote:

  Hello everyone,

 I was wondering if there would be some kind of plot style profile interface.
 What I mean, is that you could have mutliple files with different styles for
 plots, that would be used to change easily the style of plots.

 I know about the matplotlibrc but I am thinking of something a little bit
 more flexible, which could swicth between multiple “style sheets” easily.

 As an example, for now I use the Seaborn set_style capabilities to get
 better looking graphs.
 I previously used Prettyplotlib to make better plots.

 But with those two libraries, it does not seem to me that you can control
 your graph settings with, for example, a config file.

 Thank you


 --
 Marin GILLES
 PhD student CNRS
 Laboratoire Interdisciplinaire Carnot de Bourgogne (ICB)
 UMR 6303 CNRS - Université de Bourgogne
 9 av Alain Savary, BP 47870
 21078, Dijon (France)
 ☎ (+33)6.79.35.30.11
 ✉ marin.gil...@u-bourgogne.fr

 --
 Dive into the World of Parallel Programming The Go Parallel Website,
 sponsored
 by Intel and developed in partnership with Slashdot Media, is your hub for
 all
 things parallel software development, from weekly thought leadership blogs
 to
 news, videos, case studies, tutorials and more. Take a look and join the
 conversation now. http://goparallel.sourceforge.net/
 ___
 Matplotlib-users mailing 
 listMatplotlib-users@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/matplotlib-users

  Hi Christian,
 I saw them indeed.
 After looking into it in more details, it seems that the default styles
 are defined in a config-like style.
 It is possible to create your own styles and put it in your config path so
 they are accessible (Style on matplotlib.org
 http://matplotlib.org/users/style_sheets.html?highlight=style).

 Also, Would the community be interested in more integrated themes?

 Thanks for your help


 --
 *Marin GILLES*

 *PhD student CNRS *



 * Laboratoire Interdisciplinaire Carnot de Bourgogne (ICB) UMR 6303 CNRS -
 Université de Bourgogne 9 av Alain Savary, BP 47870 21078, Dijon (France) *
 ☎ (+33)6.79.35.30.11
 ✉ marin.gil...@u-bourgogne.fr
  
 --
 Dive into the World of Parallel Programming The Go Parallel Website,
 sponsored
 by Intel and developed in partnership with Slashdot Media, is your hub for
 all
 things parallel software development, from weekly thought leadership blogs
 to
 news, videos, case studies, tutorials and more. Take a look and join the
 conversation now. http://goparallel.sourceforge.net/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Plotting style

2015-03-03 Thread Thomas Caswell
I was thinking of the stand alone repository to just  store the style files
as the style module handles the loading pretty well.

The main motivation for this would be to decouple the release cycle of the
styles (which can be very fast) from the library (which needs to be slower).

On Tue, Mar 3, 2015, 12:35 Marin GILLES mrngil...@gmail.com wrote:

  Le 03/03/2015 18:15, Gökhan Sever a écrit :



 On Tue, Mar 3, 2015 at 12:07 PM, Marin GILLES mrngil...@gmail.com wrote:


   Sure, I'll be careful about that.
 I'm going to go try and design some new interesting ones.
 Maybe adding some styles specific to some plot types could be useful.
 Also some styles specific for some applications (geoscience, biology)?
 If you have any other ideas, please let me know.

 --
 *Marin GILLES*


  It would be good to have styles for paper and presentation modes.
 The former would have smaller ticks, labels, linewidths, other axis
 elements that goes into a journal publication, while the latter with much
 magnified elements to be clearly visible on a screen from the back of a
 room.

 Indeed it would be a very good idea.
 I've seen that already in the seaborn lib I guess.

 --
 *Marin GILLES*

 *PhD student CNRS *



 * Laboratoire Interdisciplinaire Carnot de Bourgogne (ICB) UMR 6303 CNRS -
 Université de Bourgogne 9 av Alain Savary, BP 47870 21078, Dijon (France) *
 ☎ (+33)6.79.35.30.11
 ✉ marin.gil...@u-bourgogne.fr
  
 --
 Dive into the World of Parallel Programming The Go Parallel Website,
 sponsored
 by Intel and developed in partnership with Slashdot Media, is your hub for
 all
 things parallel software development, from weekly thought leadership blogs
 to
 news, videos, case studies, tutorials and more. Take a look and join the
 conversation now. http://goparallel.sourceforge.net/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Plotting style

2015-03-04 Thread Thomas Caswell
That repo should probably be folded together with Tony Yu's style gallery
code and eventually be migrated to live under the main matplotlib
organization.

I would also advocate for adding a bit of code into that repo to make it
importable and to register all/some of it's style files with the
USER_LIBRARY_PATHS attribute in mpl.style.core so that these things 'just
work' by name if you import `mpl_styles` (ex `style.use('journals.pre')`
would enable the styles for Physical Review E).

Tom

(ps sorry if this goes out twice, browser was being flaky)

On Wed, Mar 4, 2015 at 5:31 PM Marin GILLES mrngil...@gmail.com wrote:

  Le 04/03/2015 22:46, Yuxiang Wang a écrit :

   Hi Marin,

 +1 for the idea of specific papers. For example, all PLOS require the
 same figure format and I have my own config file. I'd be more than
 happy to dig into it and try my best to contribute.

 Shawn

 On Wed, Mar 4, 2015 at 4:27 PM, Marin GILLES mrngil...@gmail.com 
 mrngil...@gmail.com wrote:

  Le 04/03/2015 06:21, Tony Yu a écrit :

 On Tue, Mar 3, 2015 at 11:50 AM, Gökhan Sever gokhanse...@gmail.com 
 gokhanse...@gmail.com wrote:

  I see seaborn has paper, notebook, talk, and poster 
 options.http://stanford.edu/~mwaskom/software/seaborn-dev/aesthetics.html
 Apperantly he scales each parameter to get modified views. This would be a
 good addition for any of the styles available in matplotlib.

  A similar pattern with `matplotlib.style` would use chained stylesheets. The
 idea would be to make stylesheets either aesthetics focused or layout
 focused. By aesthetics, I mean things like colors and marker shape, and by
 layout, I mean things like default figure size, figure padding, font size,
 etc. Then you can easily have a style that defines the general aesthetics
 and easily modify it for papers, talks, etc.

 Here's an example from `mpltools`, but the same syntax applies to the
 `style` module in `matplotlib`:
 http://tonysyu.github.io/mpltools/auto_examples/style/plot_multiple_styles.html

 (PoF = Physics of Fluids journal; IIRC I think I have some personal
 stylesheets that take the normal two-column figure layout and convert it to
 a full-page layout.)

 -Tony


  On Tue, Mar 3, 2015 at 12:35 PM, Marin GILLES mrngil...@gmail.com 
 mrngil...@gmail.com wrote:

  Le 03/03/2015 18:15, Gökhan Sever a écrit :



 On Tue, Mar 3, 2015 at 12:07 PM, Marin GILLES mrngil...@gmail.com 
 mrngil...@gmail.com
 wrote:

  Sure, I'll be careful about that.
 I'm going to go try and design some new interesting ones.
 Maybe adding some styles specific to some plot types could be useful.
 Also some styles specific for some applications (geoscience, biology)?
 If you have any other ideas, please let me know.

 --
 Marin GILLES

  It would be good to have styles for paper and presentation modes. The
 former would have smaller ticks, labels, linewidths, other axis elements
 that goes into a journal publication, while the latter with much magnified
 elements to be clearly visible on a screen from the back of a room.

 Indeed it would be a very good idea.
 I've seen that already in the seaborn lib I guess.

 --
 Marin GILLES
 PhD student CNRS
 Laboratoire Interdisciplinaire Carnot de Bourgogne (ICB)
 UMR 6303 CNRS - Université de Bourgogne
 9 av Alain Savary, BP 47870
 21078, Dijon (France)
 ☎ (+33)6.79.35.30.11
 ✉ marin.gil...@u-bourgogne.fr

  --
 Gökhan


 --
 Dive into the World of Parallel Programming The Go Parallel Website,
 sponsored
 by Intel and developed in partnership with Slashdot Media, is your hub for
 all
 things parallel software development, from weekly thought leadership blogs
 to
 news, videos, case studies, tutorials and more. Take a look and join the
 conversation now. http://goparallel.sourceforge.net/
 ___
 Matplotlib-users mailing 
 listMatplotlib-users@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/matplotlib-users

  Hi,

 I started working on styles based on which support the figure is designed
 for (as of now, I've got 'paper', 'notebook', 'talk', 'poster').

 For those, in a style point of view, I think only the text size should be
 modified (got it done, just need to get the proper sizes for each style),
 which is unlike the 'seaborn' way of doing it. Thing is, by doing so, we
 don't mess with any style we could apply using Cascading styles.

 Also, I was thinking that I should set the export settings for each of those
 styles, but also get an export style folder (with a few good parameters).
 This would mean no more need to adjust dpi, file format, figure size...

 Finally, I could add a folder for specific papers, in which the figure
 parameters would be tweaked so that we can directly be in a specific paper
 format. I guess it would take into account both text size and export
 parameters for each paper.

 Let me know what you think about it.

 Marin Gilles

 

Re: [Matplotlib-users] Plotting style

2015-03-05 Thread Thomas Caswell
the rcparams are stored in a sub-class of dict which does both name and
value validation on the way in.  This is controlled by the class-level
attribute `validate` (which is a dict mapping from key-name - validation
function).  In principle you could update this dict to add rcparams on the
fly, however if the plotting functions don't know to look at the rcparams
they won't have any effect.  To add new rcparams you need to modify the
upstream code.

There is a PR to add spine-related rcparams (
https://github.com/matplotlib/matplotlib/pull/2702) but it has not been
active in a while.

On Thu, Mar 5, 2015 at 11:12 AM Marin GILLES mrngil...@gmail.com wrote:

  Le 04/03/2015 23:31, Marin GILLES a écrit :

   Le 04/03/2015 22:46, Yuxiang Wang a écrit :

 Hi Marin,

 +1 for the idea of specific papers. For example, all PLOS require the
 same figure format and I have my own config file. I'd be more than
 happy to dig into it and try my best to contribute.

 Shawn

 On Wed, Mar 4, 2015 at 4:27 PM, Marin GILLES mrngil...@gmail.com 
 mrngil...@gmail.com wrote:

  Le 04/03/2015 06:21, Tony Yu a écrit :

 On Tue, Mar 3, 2015 at 11:50 AM, Gökhan Sever gokhanse...@gmail.com 
 gokhanse...@gmail.com wrote:

  I see seaborn has paper, notebook, talk, and poster 
 options.http://stanford.edu/~mwaskom/software/seaborn-dev/aesthetics.html
 Apperantly he scales each parameter to get modified views. This would be a
 good addition for any of the styles available in matplotlib.

  A similar pattern with `matplotlib.style` would use chained stylesheets. The
 idea would be to make stylesheets either aesthetics focused or layout
 focused. By aesthetics, I mean things like colors and marker shape, and by
 layout, I mean things like default figure size, figure padding, font size,
 etc. Then you can easily have a style that defines the general aesthetics
 and easily modify it for papers, talks, etc.

 Here's an example from `mpltools`, but the same syntax applies to the
 `style` module in `matplotlib`:
 http://tonysyu.github.io/mpltools/auto_examples/style/plot_multiple_styles.html

 (PoF = Physics of Fluids journal; IIRC I think I have some personal
 stylesheets that take the normal two-column figure layout and convert it to
 a full-page layout.)

 -Tony


  On Tue, Mar 3, 2015 at 12:35 PM, Marin GILLES mrngil...@gmail.com 
 mrngil...@gmail.com wrote:

  Le 03/03/2015 18:15, Gökhan Sever a écrit :



 On Tue, Mar 3, 2015 at 12:07 PM, Marin GILLES mrngil...@gmail.com 
 mrngil...@gmail.com
 wrote:

  Sure, I'll be careful about that.
 I'm going to go try and design some new interesting ones.
 Maybe adding some styles specific to some plot types could be useful.
 Also some styles specific for some applications (geoscience, biology)?
 If you have any other ideas, please let me know.

 --
 Marin GILLES

  It would be good to have styles for paper and presentation modes. The
 former would have smaller ticks, labels, linewidths, other axis elements
 that goes into a journal publication, while the latter with much magnified
 elements to be clearly visible on a screen from the back of a room.

 Indeed it would be a very good idea.
 I've seen that already in the seaborn lib I guess.

 --
 Marin GILLES
 PhD student CNRS
 Laboratoire Interdisciplinaire Carnot de Bourgogne (ICB)
 UMR 6303 CNRS - Université de Bourgogne
 9 av Alain Savary, BP 47870
 21078, Dijon (France)
 ☎ (+33)6.79.35.30.11
 ✉ marin.gil...@u-bourgogne.fr


 --
 Gökhan


 --
 Dive into the World of Parallel Programming The Go Parallel Website,
 sponsored
 by Intel and developed in partnership with Slashdot Media, is your hub for
 all
 things parallel software development, from weekly thought leadership blogs
 to
 news, videos, case studies, tutorials and more. Take a look and join the
 conversation now. http://goparallel.sourceforge.net/
 ___
 Matplotlib-users mailing 
 listMatplotlib-users@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/matplotlib-users

  Hi,

 I started working on styles based on which support the figure is designed
 for (as of now, I've got 'paper', 'notebook', 'talk', 'poster').

 For those, in a style point of view, I think only the text size should be
 modified (got it done, just need to get the proper sizes for each style),
 which is unlike the 'seaborn' way of doing it. Thing is, by doing so, we
 don't mess with any style we could apply using Cascading styles.

 Also, I was thinking that I should set the export settings for each of those
 styles, but also get an export style folder (with a few good parameters).
 This would mean no more need to adjust dpi, file format, figure size...

 Finally, I could add a folder for specific papers, in which the figure
 parameters would be tweaked so that we can directly be in a specific paper
 format. I guess it would take into account both text size and export
 parameters for each 

Re: [Matplotlib-users] Problems with pyplot and cm in Matplotlib ver. 1.4.3

2015-02-21 Thread Thomas Caswell
Can you re-send this with that error message formatted a bit better (It is
really hard to make any sense of it all squashed into one line like that).

From what I can make it out looks like it is mostly warnings, not errors.

Does it correctly save the figure?  Can you show us the two outputs?

v1.1.1 is from Jun, 2012, there are over 5k new commits across 301 files
between the two versions (see
https://github.com/matplotlib/matplotlib/compare/v1.1.1...v1.4.3 but it
chokes and only will show you 250 commits)

Can you put together a minimal working example (which does not rely on any
external files)?  That will really help the list pin down exactly what is
wrong and how to fix it.

Tom

On Sat Feb 21 2015 at 9:04:47 PM Starfighter sdup...@speakeasy.net wrote:

 I'm attempting to generate contour and a color map in Matplotlib ver.
 1.4.3 on a MacBook Pro under Mac OS X ver. 10.10.2 in Python 2.7.3 with the
 Anaconda environment. Now the messages from Matplotlib I get are:
 users-MacBook-Pro:lecture1 user$ python plot_solution.py Saved pseudocolor
 plot as pcolor.png
 /Users/user/anaconda/lib/python2.7/site-packages/matplotlib/text.py:52:
 UnicodeWarning: Unicode equal comparison failed to convert both arguments
 to Unicode - interpreting them as being unequal if rotation in
 ('horizontal', None):
 /Users/user/anaconda/lib/python2.7/site-packages/matplotlib/text.py:54:
 UnicodeWarning: Unicode equal comparison failed to convert both arguments
 to Unicode - interpreting them as being unequal elif rotation ==
 'vertical': Saved contour plot as contour.png users-MacBook-Pro:lecture1
 user$ The python script is attached to this note. Now I've observed that
 the same python script and input data generated the correct contour and
 color map under Linux2 using Python 2.7.3 and Matplotlib 1.1.1rc. The
 questions I have include: 1. What are the differences between Matplotlib
 vers. 1.1.1rc and 1.4.3? 2. What is going on where? 3. How can I fix this
 problem? Please advise. plot_solution.py
 http://matplotlib.1069221.n5.nabble.com/file/n45002/plot_solution.py
 --
 View this message in context: Problems with pyplot and cm in Matplotlib
 ver. 1.4.3
 http://matplotlib.1069221.n5.nabble.com/Problems-with-pyplot-and-cm-in-Matplotlib-ver-1-4-3-tp45002.html
 Sent from the matplotlib - users mailing list archive
 http://matplotlib.1069221.n5.nabble.com/matplotlib-users-f3.html at
 Nabble.com.
 
 --
 Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
 from Actuate! Instantly Supercharge Your Business Reports and Dashboards
 with Interactivity, Sharing, Native Excel Exports, App Integration  more
 Get technology previously reserved for billion-dollar corporations, FREE
 http://pubads.g.doubleclick.net/gampad/clk?id=190641631;
 iu=/4140/ostg.clktrk___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration  more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Help with updating the limits of an axis to reflect the range of new data

2015-03-26 Thread Thomas Caswell
Yikes, that formatting is almost worse!

On Thu, Mar 26, 2015 at 11:53 AM rogerjames99 ro...@beardandsandals.co.uk
wrote:

 Hi Thomas, I posted via nabble. It looks like something stripped the code.
 Here is the bit where the axes are set up def setup_axes(self, fig, rect):
  With custom locator and formatter. Note that the extreme values are
 swapped.  transform = PolarAxes.PolarTransform() angle_ticks = [(0,
 r$Right$), (.5*pi, r$Forward$), (pi, r$Left$)] grid_locator1 =
 FixedLocator([v for v, s in angle_ticks]) tick_formatter1 =
 DictFormatter(dict(angle_ticks)) grid_locator2 = MaxNLocator(4)
 self.grid_helper = floating_axes.GridHelperCurveLinear(transform,
 extremes=(0, pi, self.sonar_limit, 0), grid_locator1=grid_locator1,
 grid_locator2=grid_locator2, tick_formatter1=tick_formatter1,
 tick_formatter2=None, ) self.axes = floating_axes.FloatingSubplot(fig,
 rect, grid_helper=self.grid_helper)
 self.axes.axis[bottom].major_ticklabels.set_rotation(180)
 self.axes.axis[left].set_axis_direction(bottom) self.axes.grid(b=True,
 which='major', color='b', linestyle='-') fig.add_subplot(self.axes) #
 create a parasite axes whose transData in RA, cz self.auxiliary_axes =
 self.axes.get_aux_axes(transform) self.auxiliary_axes.patch =
 self.axes.patch # for auxiliary_axis to have a clip path as in ax
 self.axes.patch.zorder=0.9 # but this has a side effect that the patch is #
 drawn twice, and possibly over some other # artists. So, we decrease the
 zorder a bit to # prevent this. self.lines, =
 self.auxiliary_axes.plot(self.theta, self.radius) and here is the bit where
 the plot is updated def idleCallback(self): global root plotit = False
 logging.debug('Acquire the data lock') self.dataLock.acquire() if
 self.newSonarDataAvailable: plotit = True theta = self.theta[:] radius =
 self.radius[:] selfNewSonarDataAvailable = False self.dataLock.release() #
 theta.insert(0, 0.) # theta.append(0.) # radius.insert(0, 0.) #
 radius.append(0.) if plotit: logging.debug('Plotting')
 self.lines.set_data(theta, radius) self.axes.relim()
 self.axes.autoscale_view() self.canvas.draw() if have also put the full
 code file here https://dl.dropboxusercontent.com/u/84613021/barnaby.py
 As you can see I have been trying a few other things. Looks like if am
 missing the boat pretty comprehensively!
 --
 View this message in context: Re: Help with updating the limits of an
 axis to reflect the range of new data
 http://matplotlib.1069221.n5.nabble.com/Help-with-updating-the-limits-of-an-axis-to-reflect-the-range-of-new-data-tp45261p45269.html
 Sent from the matplotlib - users mailing list archive
 http://matplotlib.1069221.n5.nabble.com/matplotlib-users-f3.html at
 Nabble.com.
 
 --
 Dive into the World of Parallel Programming The Go Parallel Website,
 sponsored
 by Intel and developed in partnership with Slashdot Media, is your hub for
 all
 things parallel software development, from weekly thought leadership blogs
 to
 news, videos, case studies, tutorials and more. Take a look and join the
 conversation now. http://goparallel.sourceforge.net/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Help with updating the limits of an axis to reflect the range of new data

2015-03-26 Thread Thomas Caswell
And if I look at this on nabble the code looks fine, it just was not
redndering in inbox.  Sorry, the issues is on my end.

On Thu, Mar 26, 2015 at 11:54 AM Thomas Caswell tcasw...@gmail.com wrote:

 Yikes, that formatting is almost worse!

 On Thu, Mar 26, 2015 at 11:53 AM rogerjames99 ro...@beardandsandals.co.uk
 wrote:

 Hi Thomas, I posted via nabble. It looks like something stripped the
 code. Here is the bit where the axes are set up def setup_axes(self, fig,
 rect):  With custom locator and formatter. Note that the extreme values
 are swapped.  transform = PolarAxes.PolarTransform() angle_ticks = [(0,
 r$Right$), (.5*pi, r$Forward$), (pi, r$Left$)] grid_locator1 =
 FixedLocator([v for v, s in angle_ticks]) tick_formatter1 =
 DictFormatter(dict(angle_ticks)) grid_locator2 = MaxNLocator(4)
 self.grid_helper = floating_axes.GridHelperCurveLinear(transform,
 extremes=(0, pi, self.sonar_limit, 0), grid_locator1=grid_locator1,
 grid_locator2=grid_locator2, tick_formatter1=tick_formatter1,
 tick_formatter2=None, ) self.axes = floating_axes.FloatingSubplot(fig,
 rect, grid_helper=self.grid_helper) self.axes.axis[bottom].
 major_ticklabels.set_rotation(180) 
 self.axes.axis[left].set_axis_direction(bottom)
 self.axes.grid(b=True, which='major', color='b', linestyle='-')
 fig.add_subplot(self.axes) # create a parasite axes whose transData in RA,
 cz self.auxiliary_axes = self.axes.get_aux_axes(transform)
 self.auxiliary_axes.patch = self.axes.patch # for auxiliary_axis to have a
 clip path as in ax self.axes.patch.zorder=0.9 # but this has a side effect
 that the patch is # drawn twice, and possibly over some other # artists.
 So, we decrease the zorder a bit to # prevent this. self.lines, =
 self.auxiliary_axes.plot(self.theta, self.radius) and here is the bit
 where the plot is updated def idleCallback(self): global root plotit =
 False logging.debug('Acquire the data lock') self.dataLock.acquire() if
 self.newSonarDataAvailable: plotit = True theta = self.theta[:] radius =
 self.radius[:] selfNewSonarDataAvailable = False self.dataLock.release() #
 theta.insert(0, 0.) # theta.append(0.) # radius.insert(0, 0.) #
 radius.append(0.) if plotit: logging.debug('Plotting')
 self.lines.set_data(theta, radius) self.axes.relim()
 self.axes.autoscale_view() self.canvas.draw() if have also put the full
 code file here https://dl.dropboxusercontent.com/u/84613021/barnaby.py
 As you can see I have been trying a few other things. Looks like if am
 missing the boat pretty comprehensively!
 --
 View this message in context: Re: Help with updating the limits of an
 axis to reflect the range of new data
 http://matplotlib.1069221.n5.nabble.com/Help-with-updating-the-limits-of-an-axis-to-reflect-the-range-of-new-data-tp45261p45269.html
 Sent from the matplotlib - users mailing list archive
 http://matplotlib.1069221.n5.nabble.com/matplotlib-users-f3.html at
 Nabble.com.
 
 --
 Dive into the World of Parallel Programming The Go Parallel Website,
 sponsored
 by Intel and developed in partnership with Slashdot Media, is your hub
 for all
 things parallel software development, from weekly thought leadership
 blogs to
 news, videos, case studies, tutorials and more. Take a look and join the
 conversation now. http://goparallel.sourceforge.net/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Help with updating the limits of an axis to reflect the range of new data

2015-03-26 Thread Thomas Caswell
Can you include a minimal example of the code you are using (it looks like
you did include code, but it did not come through)?  It is very hard to
guess at what is wrong without it.

Tom

On Wed, Mar 25, 2015 at 2:29 PM rogerjames99 ro...@beardandsandals.co.uk
wrote:

 Hi,

 I am trying to draw a polar plot of a sonar scan. The idea being to present
 it like a radar display. I have used axisartist to do the ploar plot. This
 is working fine but I would like to reset the limits of the radius axis
 with
 each new scan. I have tried a number of ways of doing this without success.
 My current code to set up the plot looks like this.



 and to update the plot. Like this


 I have tried doing the above on the host axes and the auxiliary one and
 with
 different parameters to the relim etc. Nothing seems to work. Before I
 tried
 various other calls to manipulate the extremes but with the same lack of
 results. Can anyone set me straight on this? I feel I must be missing
 something obvious. However I find the documentation and the class
 inheritance hierarchy almost impossible to follow.

 Here are a couple of links to snapshots of the output.

 Before
 https://dl.dropboxusercontent.com/u/84613021/Screenshot%20from%
 202015-03-25%2018%3A17%3A24.png

 After
 https://dl.dropboxusercontent.com/u/84613021/Screenshot%20from%
 202015-03-25%2018%3A18%3A30.png

 Thanks,

 Roger



 --
 View this message in context: http://matplotlib.1069221.n5.
 nabble.com/Help-with-updating-the-limits-of-an-axis-to-
 reflect-the-range-of-new-data-tp45261.html
 Sent from the matplotlib - users mailing list archive at Nabble.com.

 
 --
 Dive into the World of Parallel Programming The Go Parallel Website,
 sponsored
 by Intel and developed in partnership with Slashdot Media, is your hub for
 all
 things parallel software development, from weekly thought leadership blogs
 to
 news, videos, case studies, tutorials and more. Take a look and join the
 conversation now. http://goparallel.sourceforge.net/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] animation.FuncAnimation example --- how does it work?

2015-04-23 Thread Thomas Caswell
Can everyone please bring the level of snark/hostility down?  Programming
is frustrating, but antagonizing the mailing list does not help anyone.

It is not well documented, but the signature for `func` is assumed to be
`def function(required, *optional_positional)` see
https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/animation.py#L1107
for the line where it actually gets called.  The logic behind this is that
the function needs to have some input to know what to draw (so the state
about where in the sequence you are lives in the animation code, not in the
supplied user code).

For passing in the frame data you have several options.  The first is to
pass in an iterable of the data you want to be passed to the function (ex
np.arange(5), image_stack, image_generator), basically anything where `it =
iter(input); data = next(it)` 'does the right thing'.  The second is to
pass in a callable where repeated calls to `data = my_callable()` 'does the
right thing'  This would be useful if you want to reach out and hit some
external hardware for you data each time the animation updates.  The last
is to pass in a number of frames, which gets converted into
xrange(frames).  In all cases, the Animation turns what ever your input is
into an iterable which gets hit once pre frame (see
https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/animation.py#L1047
for the code version of this paragraph).

Tom

PS was finishing this up as Ben's email came in

On Thu, Apr 23, 2015 at 12:06 PM Virgil Stokes v...@it.uu.se wrote:

  Thanks for your reply to my post, Jerzy.


 On 23-Apr-2015 13:18, Jerzy Karczmarczuk wrote:



 Le 23/04/2015 12:22, Virgil Stokes a écrit :

 The following interesting example (random_data.py) is posted at:

 http://matplotlib.org/1.4.2/examples/animation/random_data.html


 import matplotlib.pyplot as plt
 import matplotlib.animation as animation

 import numpy as np

 Yes, I forgot to include this


 fig, ax = plt.subplots()
 line, = ax.plot(np.random.rand(10))
 ax.set_ylim(0, 1)

 def update(data):
 line.set_ydata(data)
 return line,

 def data_gen():
 while True: yield np.random.rand(10)

 ani = animation.FuncAnimation(fig, update, data_gen, interval=100)
 plt.show()

 This codes works; but, I am very confused by it. For example:

 1. There are 3 positional arguments given for animation.FuncAnimation;
 but, in the
 API documentation for this class (
 http://matplotlib.org/api/animation_api.html), only
 two positional arguments are shown.

 The third one is the third one,
 *frames* can be a generator, an iterable, or a number of frames.

 This makes very little sense to me --- what does or a number of frames
 mean?

  The name data_gen could suggest its meaning (after having read the
 doc).

 I am not sure what you are referencing as the doc; but I did read the
 documentation several times and English is my native language.

 Note please that the keyword parameters are specified extra.

 I am aware of this.  Perhaps, I am a Python dummy --- when I see something
 like value = None in a Python API argument, I interpret this as a keyword
 argument and not a generator.


  2. data, the argument to the update function seems to be undefined.

 FuncAnimation usually passes the frame number: 0, 1, 2, ... as the first
 parameter of the update function, when frames is None, or the number of
 frames. If - as here - the third parameter is a generator, it passes the
 yielded data to update.
  It may be used or not.

 Ok, I understand that better now. But, you say or *the number* of
 frames but the documentation reads or *a number* of frames --- what
 does this mean?

 And I still do not understand how to use the first argument of the
 function to be called for the animation. In another animation example (
 histogram.py), the animation function is defined by:

 def animate(i):
 # simulate new data coming in
 data = np.random.randn(1000
 n, bins = np.histogram(data, 100)
 top = bottom + n
 verts[1::5,1] = top
 verts[2::5,1] = top

 This works of course; but, why is the i required? There is no other
 reference to it in the entire script. If I remove it; i.e. use def
 animate(): I get the following error:

 TypeError: animate() takes no arguments (1 given)

 I do not understand how this explains the fact that the function no longer
 has any arguments. Please explain the meaning of this error message?


 Please, in such cases test your programs by adding some simple tracing
 contraptions, say, print(data) inside update.

 I did this and more before posting my email. I would not have posted this
 unless I thought it was necessary. And I thought one purpose of this user
 group was to help people --- even if they ask a question which may be
 annoying or stupid in some subscribers opinion. I try to remember what a
 very wise teacher once said --- there is no such thing as a stupid
 question.

 

Re: [Matplotlib-users] Wind barb bug

2015-04-25 Thread Thomas Caswell
Jesper,

Can you open an issue on this on github.  If you are feeling ambitious a
pull request fixing the bug (as you seem to have a good idea of where the
problem is) would also be great!

Tom

On Fri, Apr 24, 2015 at 8:38 AM Jesper Larsen jesper.webm...@gmail.com
wrote:

 Hi Matplotlib Users,

 When I make wind barbs with rounding enabled and custom barb increments I
 noticed that there were no wind barbs with half barbs above 2 full barbs.
 The reason seems to be a bug in the _find_tails method. The bug is
 illustrated by this small script (_find_tails is a copy of the one in
 matplotlib):

 import numpy as np

 def _find_tails(self, mag, rounding=True, half=5, full=10, flag=50):
 '''
 Find how many of each of the tail pieces is necessary.  Flag
 specifies the increment for a flag, barb for a full barb, and half for
 half a barb. Mag should be the magnitude of a vector (ie. = 0).

 This returns a tuple of:

 (*number of flags*, *number of barbs*, *half_flag*, *empty_flag*)

 *half_flag* is a boolean whether half of a barb is needed,
 since there should only ever be one half on a given
 barb. *empty_flag* flag is an array of flags to easily tell if
 a barb is empty (too low to plot any barbs/flags.
 '''

 #If rounding, round to the nearest multiple of half, the smallest
 #increment
 if rounding:
 mag = half * (mag / half + 0.5).astype(np.int)

 num_flags = np.floor(mag / flag).astype(np.int)
 mag = np.mod(mag, flag)

 num_barb = np.floor(mag / full).astype(np.int)
 mag = np.mod(mag, full)

 half_flag = mag = half
 empty_flag = ~(half_flag | (num_flags  0) | (num_barb  0))

 return num_flags, num_barb, half_flag, empty_flag

 def main():
 mag = np.arange(0,21,1)
 barb_incs = {'half': 2.57222,
  'full': 5.1,
  'flag': 25.7222}
 print 'With rounding'
 num_flags, num_barb, half_flag, empty_flag =  _find_tails(None, mag,
 rounding=True, **barb_incs)
 for i in range(len(mag)):
 print mag[i], num_flags[i], num_barb[i], half_flag[i],
 empty_flag[i]
 print 'Without rounding'
 num_flags, num_barb, half_flag, empty_flag =  _find_tails(None, mag,
 rounding=False, **barb_incs)
 for i in range(len(mag)):
 print mag[i], num_flags[i], num_barb[i], half_flag[i],
 empty_flag[i]

 if __name__ == '__main__':
 exit(main())

 It seems like the error is not present when the barb increments are not
 set. I believe the reason for the bug is the float comparison (half_flag =
 mag = half) where the value is rounded to a value very close to/identical
 to the 'half' increment. And it seems like python does the right thing when
 the half increment is a whole number but not always when it is not.

 But in any case the code should probably not depend two floats being equal.

 Best regards,
 Jesper

 --
 One dashboard for servers and applications across Physical-Virtual-Cloud
 Widest out-of-the-box monitoring support with 50+ applications
 Performance metrics, stats and reports that give you Actionable Insights
 Deep dive visibility with transaction tracing using APM Insight.
 http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Axes3d.mouse_init(), facing problems when embedding matplotlib 3d-projection into PyQt5 App

2015-04-29 Thread Thomas Caswell
I think that this SO answer may be relevant:
https://stackoverflow.com/questions/18259350/embed-an-interactive-3d-plot-in-pyside/18278457#18278457

On Wed, Apr 29, 2015 at 5:43 AM Christian Ambros ambr...@ymail.com wrote:

 Ok, back from revision...

 The is no mix-up for the show command. The only explicit show() command is
 commented out in line 41. It can be deleted. But I haven't done that, yet.
 There are several bits of code which are remains of the design process
 since this is work in progress. Code cleaning will be done when the main
 functionality is in place.

 Back to addmpl where I embedded gui elements into the canvas. Taking out
 the matplotlib taskbar doesn't change a thing as I wrote earlier, but to
 make sure it doesn't bother the mainloop, it should be commented out. I may
 not put it back in, because I don't see the point in needing it. It was
 just to see if it's possible.

 But option 2 relinquishes that control to the developer's GUI app. You
 *cannot* use pyplot for option 2, which is what you are doing.

 Is that so? In line 116 I create the canvas, which is derived from
 matplotlib's backend's FigureCanvasQTAgg and given to the QWidget at line
 119. That's the only part where both interact with each other. the rest is
 handle by matplotlib.

 The error message says that Axes3D.figure.canvas is 'None' and that's why
 mouse rotation is disabled.
 It's None because there is no content at that point, when it's passed to
 the QWidget. It's filled with content in line 38. So if matplotlib disables
 the mouse rotation by default, when the canvas is empty how do I prevent
 this disabling by default?
 If I can't, at what point do I have to pass the filled canvas to the
 QWidget? How does that impact the GUI itself?
 If I can't enable the mouse rotation by hand and I just can pass filled
 canvas around, do I have to build a work around with initialize it with an
 empty 2D canvas and replace it later with the filled 3D canvas? How's the
 mouse rotation activated then?

 In general, I wouldn't have to enable the rotation if it wouldn't be
 switch off for an empty canvas.

 I'm going to consult your book, now, for different ways of coping with
 such things...

 cheers,
 Christian

 --
 A little learning never caused anyone's head to explode!


 Ein wenig Lernen hat noch niemandens Kopf zum Explodieren gebracht!



   On Tuesday, April 28, 2015 8:28 PM, Benjamin Root ben.r...@ou.edu
 wrote:


 One thing I see off the bat is your addmpl() method:

 ```
 def addmpl(self, fig):
 #FigureCanvas.__init__(self, fig)
 self.canvas = FigureCanvas(fig)

 Axes3D.mouse_init(self, rotate_btn=1, zoom_btn=2)
 self.mplvl.addWidget(self.canvas)
 self.canvas.draw()
 self.toolbar = NavigationToolbar(self.canvas, self.mplwindow,
 coordinates=True)
 self.mplvl.addWidget(self.toolbar)
 ```

 You are calling Axes3D.mouse_init() on the Main object (that is `self`).
 That is completely wrong. It can only be called for the 3d axes objects.

 Also, what I see happening here is some mixing up of how to do embedding.
 There are two approaches to embedding. 1) you can embedded GUI elements
 into your canvas widget, or 2) you can embed your canvas widget into your
 GUI app. The important distinction between the two is who controls the
 mainloop. In option 1 (and in matplotlib in general), pyplot will create
 the GUI app for you automatically (it is completely transparent to you) and
 kicks it off upon call to show(). But option 2 relinquishes that control to
 the developer's GUI app. You *cannot* use pyplot for option 2, which is
 what you are doing. Rip out all of the pyplot stuff, and instantiate the
 Qt5 Figure object directly, and then obtain the axes objects from the
 figure object via calls to add_subplot(). You shouldn't even need to do the
 whole mouse_init() stuff.

 I now think this has nothing to do with Qt Designer. While I don't
 specifically cover qt5 in my book, I do make all of these distinctions very
 clear in chapter 5 of my book Interactive Applications using Matplotlib.

 Cheers!
 Ben Root


 On Tue, Apr 28, 2015 at 4:03 PM, Christian Ambros ambr...@ymail.com
 wrote:

 Hi Benjamin,

 I would do that if my task were my private stuff, but in this case it's
 work-related and my boss wants me to use the designer and he already set a
 deadline, which, I already knew, is set to tight. I told him before, that
 it would be just a try but he sold it to his boss after some pressure. You
 know how the bosses' bosses are, they don't get the idea that innovation
 can't be dictated. They don't understand the concept that software is
 written and doesn't come into existence out of nothing.

 Without PyQt5 it's working fine. I got the plots and they are gorgeous,
 but that doesn't help when presenting to the bosses. If I just would know
 how to activate the 3d-draw's mouse action again, by hand, than it has to
 last just some moments for the presentation, 

Re: [Matplotlib-users] `matplotlib`: `self._chachedRenderer` fails `assert self._cachedRenderer is not None`, when calling `draw_artist` on a patch?

2015-05-10 Thread Thomas Caswell
Please include the contents of the SO question here.  Those links are very
likely to rot due to over aggressive moderation on SO.

Tom

On Sun, May 10, 2015 at 1:49 PM bmer bhmerch...@gmail.com wrote:

 Hi all,

 I wrote up my question in detail  on StackOverflow.
 
 http://stackoverflow.com/questions/30154473/matplotlib-self-chachedrenderer-fails-assert-self-cachedrenderer-is-not
 
 , but I figured it would be a good idea to cross-post it here, by
 providing a link.

 Please feel free to respond here, or there, and thanks for your help!



 --
 View this message in context:
 http://matplotlib.1069221.n5.nabble.com/matplotlib-self-chachedRenderer-fails-assert-self-cachedRenderer-is-not-None-when-calling-draw-artis-tp45494.html
 Sent from the matplotlib - users mailing list archive at Nabble.com.


 --
 One dashboard for servers and applications across Physical-Virtual-Cloud
 Widest out-of-the-box monitoring support with 50+ applications
 Performance metrics, stats and reports that give you Actionable Insights
 Deep dive visibility with transaction tracing using APM Insight.
 http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Possible bug in padding between text and bounding box for PDF

2015-05-07 Thread Thomas Caswell
Sourish,

We no longer are updating the 1.3.x releases.  Can you reproduce this
problem using 1.4.3?

Tom

On Thu, May 7, 2015 at 11:14 AM Sourish Basu sourish.b...@gmail.com wrote:

  Hello,

 I have been fighting with this problem for some time. It seems that if, on
 a plot, I have some text inside a bounding box, it displays fine on the
 screen, saves OK as a PNG, but when I save the plot as a PDF the padding on
 the right side between the text and the box disappears. I have attached a
 minimal example with a text box, but this problem occurs for legends as
 well, if the legend text is long-ish. I am also attaching a PNG and a PDF
 output, as well as how the PDF shows up on my viewer. Has anyone else
 experienced this?

 Other relevant info:

 *$ uname -a*
 Linux Merlin 3.2.0-77-generic #114-Ubuntu SMP Tue Mar 10 17:26:03 UTC 2015
 x86_64 x86_64 x86_64 GNU/Linux

 *$ python -c 'import matplotlib; print matplotlib.__version__'*
 1.3.1

 *Where I obtained matplotlib:*
 The matplotlib SourceForge site

 *Customisations to **matplotlibrc:*
 backend  : Qt4Agg
 lines.markersize  : 10# markersize, in points
 font.sans-serif  : Ubuntu, Calibri, Liberation Sans
 font.monospace   : Consolas, Inconsolata, Ubuntu Mono, Droid Sans Mono
 axes.color_cycle : e41a1c, 377eb8, 4daf4a, 984ea3, ff7f00, 33, a65628,
 f781bf, 99
 pdf.fonttype   : 42 # Output Type 3 (Type3) or Type 42
 (TrueType) # I have tried with fonttype=3 as well, and the bug still exists

 *$ python bug_test.py --verbose-helpful  output.txt*
 output.txt attached

 Thanks,
 Sourish


 --
 One dashboard for servers and applications across Physical-Virtual-Cloud
 Widest out-of-the-box monitoring support with 50+ applications
 Performance metrics, stats and reports that give you Actionable Insights
 Deep dive visibility with transaction tracing using APM Insight.
 http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Good line plot color cycle for colorblind readers?

2015-05-15 Thread Thomas Caswell
See https://github.com/matplotlib/matplotlib/pull/2871 and the links there
in.  This colormap should be in 1.4.x as `'Wistia'`.

http://matplotlib.org/users/colormaps.html has some references.

There is an open PR to add a color-blind filter an any artist
https://github.com/matplotlib/matplotlib/pull/3279 but I am not sure of
it's state.

Tom

On Fri, May 15, 2015 at 5:43 PM Nathan Goldbaum nathan12...@gmail.com
wrote:

 Hi all,

 This is a bit of a case of lazy mailing list, but I'm hoping there might
 be some experts here who can point me in the right direction.

 Does anyone know of a good resource to pull a color cycle for line plots
 that are good for color-blind readers?  I'm currently writing a paper that
 includes a number of plots that include multiple line plots in the same
 axes, and it would be nice if I'm not alienating a significant fraction of
 my readers with a poor color choice.

 Thanks very much for your help!

 -Nathan

 --
 One dashboard for servers and applications across Physical-Virtual-Cloud
 Widest out-of-the-box monitoring support with 50+ applications
 Performance metrics, stats and reports that give you Actionable Insights
 Deep dive visibility with transaction tracing using APM Insight.
 http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Some questions regarding pcolor(mesh)/nbagg/FuncAnimate

2015-04-16 Thread Thomas Caswell
The 'animated' property is used _deep_ with in `axes.draw` (
https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/axes/_base.py#L2035)
to skip artists with the 'animated' flag set.  This makes them play nice
with blitting (which explicitly uses `axes.draw_artist`)  so they are not
drawn on a call to `ax.draw` (which sets up the background canvas).  Sorry,
I should not have included them with out a good explanation, I was feeling
too fancy with that example.

Tom

On Thu, Apr 16, 2015 at 11:27 AM Ryan Nelson rnelsonc...@gmail.com wrote:

 Ben,

 Sorry. I probably should have just dropped that entirely. In my code
 sample, it is actually commented out because it breaks the animation with
 the nbagg backend. It was in Tom's example, so I left it in because I
 wanted to find out what it was doing.

 Ryan

 On Thu, Apr 16, 2015 at 9:30 AM, Benjamin Root ben.r...@ou.edu wrote:

 I just noticed your use of animated=True. I have had trouble using that
 in the past with the animation module. It is a leftover from the days
 before the animation module and isn't actually used by it, IIRC. Try not
 supplying that argument.

 On Thu, Apr 16, 2015 at 8:18 AM, Ryan Nelson rnelsonc...@gmail.com
 wrote:

 Tom,

 Thanks for the code. As it was given, I had to change `blit=True` in the
 `FuncAnimation` call in order to get this to work in a regular Qt backend.
 It did not work with the nbagg backend; however, if I used this code it
 works fine:
 
 %matplotlib nbagg

 import numpy as np
 import matplotlib.pyplot as plt
 import matplotlib.animation as animate

 class Testing(object):
 def __init__(self, ):
 self.fig = plt.figure()
 array = np.random.rand(4,5)
 array = np.zeros((4,5))
 self.pc = plt.pcolor(array, edgecolor='k', linewidth=1.)#,
 animated=True)
 self.pc.set_clim([0, 1])
 self.points = [plt.scatter(np.random.rand(),
 np.random.rand())]#, animated=True)]

 def update(self, iter_num):
 array = np.random.rand(4*5)
 self.pc.set_array(array)
 for point in self.points:
 point.set_offsets([np.random.rand(), np.random.rand()])
 #return (self.pc, ) + tuple(self.points)


 test = Testing()
 ani = animate.FuncAnimation(test.fig, test.update, interval=250,
 blit=False, frames=50)
 plt.show()
 
 Also this code solves the problem I was having with several scatter
 points being displayed upon multiple runs of the same code cell.

 I wasn't familiar with the animated keyword, and it is not well
 documented yet. Can you give me a quick explanation of what it is doing?

 Ben: thanks for the hint about the _stop() method. I might look into
 that for my example.

 Thank you all for your assistance. Things are working pretty much as I
 need now!

 Ryan

 On Sun, Apr 12, 2015 at 9:24 AM, Thomas Caswell tcasw...@gmail.com
 wrote:

 You can


 ```

 #import matplotlib

 #matplotlib.use('nbagg')

 #%matplotlib nbagg

 import numpy as np

 import matplotlib.pyplot as plt

 import matplotlib.animation as animate


 class Testing(object):

 def __init__(self, ):

 self.fig = plt.figure()

 array = np.random.rand(4,5)

 array = np.zeros((4,5))

 self.pc = plt.pcolor(array, edgecolor='k', linewidth=1.,
 animated=True)

 self.pc.set_clim([0, 1])

 self.points = [plt.scatter(np.random.rand(), np.random.rand(),
 animated=True)]


 def update(self, iter_num):

 array = np.random.rand(4*5)

 self.pc.set_array(array)

 for point in self.points:

 point.set_offsets([np.random.rand(), np.random.rand()])


 return (self.pc, ) + tuple(self.points)



 test = Testing()

 ani = animate.FuncAnimation(test.fig, test.update, interval=10,
 blit=False, frames=50)

 plt.show()

 ```

 note the addition of the `set_clim` line in the `__init__` method.


 You can also update the scatter artist in-place.  The other changes
 will make it a bit for performant if you use bliting (which does not work
 with nbagg currently)

 Sorry I missed that part of the question first time through.

 Tom

 On Sun, Apr 12, 2015, 08:31 Ryan Nelson rnelsonc...@gmail.com wrote:

 Tom,

 Thanks for the links. It does seem like fragments of my problem are
 addressed in each of those comments, so I guess I'll have to wait for a 
 bit
 until those things get resolved. For now, I can just tell my students to
 restart the IPython kernel each time they run the animation, which isn't
 that hard. It's too bad that there isn't a 'stop' method now, but it's 
 good
 to hear that it isn't a completely terrible idea.

 I do still need help with Question #3 from my original email, though,
 because it affects both the Qt and nbagg backends, and it is a bit of a
 show stopper. I can't quite understand why initializing a pcolor(mesh) 
 with
 random numbers makes it possible to update the array in an animation, but
 if you use all zeros or ones, it seems to be immutable.

 Ryan

Re: [Matplotlib-users] Some questions regarding pcolor(mesh)/nbagg/FuncAnimate

2015-04-12 Thread Thomas Caswell
You can


```

#import matplotlib

#matplotlib.use('nbagg')

#%matplotlib nbagg

import numpy as np

import matplotlib.pyplot as plt

import matplotlib.animation as animate


class Testing(object):

def __init__(self, ):

self.fig = plt.figure()

array = np.random.rand(4,5)

array = np.zeros((4,5))

self.pc = plt.pcolor(array, edgecolor='k', linewidth=1.,
animated=True)

self.pc.set_clim([0, 1])

self.points = [plt.scatter(np.random.rand(), np.random.rand(),
animated=True)]


def update(self, iter_num):

array = np.random.rand(4*5)

self.pc.set_array(array)

for point in self.points:

point.set_offsets([np.random.rand(), np.random.rand()])


return (self.pc, ) + tuple(self.points)



test = Testing()

ani = animate.FuncAnimation(test.fig, test.update, interval=10, blit=False,
frames=50)

plt.show()

```

note the addition of the `set_clim` line in the `__init__` method.


You can also update the scatter artist in-place.  The other changes will
make it a bit for performant if you use bliting (which does not work with
nbagg currently)

Sorry I missed that part of the question first time through.

Tom

On Sun, Apr 12, 2015, 08:31 Ryan Nelson rnelsonc...@gmail.com wrote:

 Tom,

 Thanks for the links. It does seem like fragments of my problem are
 addressed in each of those comments, so I guess I'll have to wait for a bit
 until those things get resolved. For now, I can just tell my students to
 restart the IPython kernel each time they run the animation, which isn't
 that hard. It's too bad that there isn't a 'stop' method now, but it's good
 to hear that it isn't a completely terrible idea.

 I do still need help with Question #3 from my original email, though,
 because it affects both the Qt and nbagg backends, and it is a bit of a
 show stopper. I can't quite understand why initializing a pcolor(mesh) with
 random numbers makes it possible to update the array in an animation, but
 if you use all zeros or ones, it seems to be immutable.

 Ryan

 On Sat, Apr 11, 2015 at 8:35 PM, Thomas Caswell tcasw...@gmail.com
 wrote:

 Ryan,

 I have not looked at your exact issue yet, but there seems to be some
 underlying issues with animation and nbagg which we have not tracked down
 yet. See:

 https://github.com/matplotlib/matplotlib/pull/4290
 https://github.com/matplotlib/matplotlib/issues/4287
 https://github.com/matplotlib/matplotlib/issues/4288

 Running until a given condition is an interesting idea, but I think that
 means the animation objects needs to have a public 'stop' method first!

 Tom

 On Fri, Apr 10, 2015 at 3:00 PM Ryan Nelson rnelsonc...@gmail.com
 wrote:

 Good afternoon, all!

 I'm really digging the nbagg backend, and I'm trying to use it to make
 an animation. As the subject suggests, though, I'm having some issues with
 these features. I'm using Python 3.4, Matplotlib 1.4.3, and IPython 3.1.
 Below is a small code sample that emulates my system. The pcolor call can
 be substituted for pcolormesh, and I see the same behavior. (Sorry this is
 a bit long. I tried to break it up as best as possible.)

 #
 #import matplotlib
 #matplotlib.use('nbagg')
 #%matplotlib nbagg
 import numpy as np
 import matplotlib.pyplot as plt
 import matplotlib.animation as animate

 class Testing(object):
 def __init__(self, ):
 self.fig = plt.figure()
 array = np.random.rand(4,5)
 #array = np.zeros((4,5))
 self.pc = plt.pcolor(array, edgecolor='k', linewidth=1.)
 self.points = [plt.scatter(np.random.rand(), np.random.rand())]

 def update(self, iter_num):
 array = np.random.rand(4*5)
 self.pc.set_array(array)
 for point in self.points:
 point.remove()
 self.points = [plt.scatter(np.random.rand(), np.random.rand())]

 test = Testing()
 animate.FuncAnimation(test.fig, test.update, interval=1000, blit=False)
 plt.show()
 ###

 1. As is, this code runs fine with a Qt backend. It also runs fine as a
 first call in a notebook if the `show` call is commented out and the
 `%matplotlib` line is uncommented. However, if the `show` call is left in
 and the `matplotlib.use` call is uncommented, then the pcolor array
 changes, but the scatterpoint only shows on the first update and then
 disappears forever. What is the difference between these two invocations?

 2. With the `%matplotlib` magic uncommented and `show` removed, the
 first invocation of this as a cell works fine. Closing the figure (with the
 red X) and running the cell again shows two scatter plot points. Running it
 a third time shows three scatter plot points. If you call `plt.clf` in the
 next cell, I get a series of errors as follows:
 _
 ERROR:tornado.application:Exception in callback bound method
 TimerTornado._on_timer of matplotlib.backends.backend_nbagg.TimerTornado
 object at 0x7f894cb10f98
 Traceback (most recent call last):
   File /usr

Re: [Matplotlib-users] How to create ternary contour plot in matplotlib?

2015-04-11 Thread Thomas Caswell
We have a pr in to add ternary axes, but unfortunately I do not understand
it well enough to tell you of contours will work.

See https://github.com/matplotlib/matplotlib/pull/3828 and links with in.

Tom

On Sat, Apr 11, 2015, 07:47 nxkryptor nxkr nxkryp...@gmail.com wrote:

 I am trying to create ternary plots with matplotlib as shown in the figure
 (source
 http://stackoverflow.com/questions/10879361/ternary-plot-and-filled-contour).
 The axes are A, B, C and D values should be denoted by contours and the
 points need to be labelled like in figure.

 [image: enter image description here]Can such plots be created in
 matplotlib or with Python? This question is already posted on
 stackoverflow
 http://stackoverflow.com/questions/29512046/how-to-create-ternary-contour-plot-in-python
 .


 nxkr

 --
 BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
 Develop your own process in accordance with the BPMN 2 standard
 Learn Process modeling best practices with Bonita BPM through live
 exercises
 http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual-
 event?utm_

 source=Sourceforge_BPM_Camp_5_6_15utm_medium=emailutm_campaign=VA_SF___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15utm_medium=emailutm_campaign=VA_SF___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Artifacts when saving as PDF

2015-04-06 Thread Thomas Caswell
This is probaly due to issues with not all of the vector backends
supporting alpha gracefully.

This can be reproduced more simply by

x, y = np.ogrid[-5:5:.1, -5:5:.1]
dd = np.exp(-(x**2 + y**2))
dd[dd  .1] = np.nan

fig, ax = plt.subplots()
ax.imshow(dd, interpolation='none', cmap='gray_r')
plt.savefig('test.pdf')

@steven In the future it is best to report bugs with minimal copy-paste
able examples.

On Mon, Apr 6, 2015 at 5:41 PM Steven Boada bo...@physics.tamu.edu wrote:

  Getting some strange artifacts when I save a figure as a PDF in
 matplotlib. Here are some screen shots. PDF http://imgur.com/oQDXkWn
 and PNG http://imgur.com/bCw3Fn4.  Any idea why that is happening?

 Here is (most of) the source code that makes the plot. I stripped out the
 data generation, because it is long and involved, and doesn't really
 matter. Basically what the script is supposed to do is make a scatter plot
 where the density is below some threshold, and a 2d histogram when it is
 above that threshold. The code seems to work fine, but when I save the
 figure (using savefig in Ipython) it shows up funny.

 Thanks.

 import pylab as pyl

 bins = [50,50]
 thresh = 3

 xdat = #generate or load some data
 ydat = #generate or load some data

 hh, locx, locy = pyl.histogram2d(xdat, ydat, range=[[-1,4],[-26,-10]],
 bins=bins)
 posx = pyl.digitize(xdat, locx)
 posy = pyl.digitize(ydat, locy)

 # finds the bins which contain points. posx = 0 for points outside
 range
 ind = (posx  0)  (posx = bins[0])  (posy  0)  (posy = bins[1])
 # values of histogram with points in the bins.
 hhsub = hh[posx[ind] - 1, posy[ind] - 1]

 xdat1 = xdat[ind][hhsub  thresh] # low density points
 ydat1 = ydat[ind][hhsub  thresh]
 hh[hh  thresh] = pyl.nan # fill the areas with low density by NaNs

 pyl.scatter(xdat1, ydat1, s=20, c='0.8')
 pyl.imshow(pyl.log10(hh.T), cmap='gray_r',
 extent=pyl.array([[-1,4],[-26,-10]]).flatten(),
 interpolation='none')

 pyl.show()

 --

 Steven Boada

 Doctoral Student
 Dept of Physics and Astronomy
 Texas AM universitybo...@physics.tamu.edu

  
 --
 BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
 Develop your own process in accordance with the BPMN 2 standard
 Learn Process modeling best practices with Bonita BPM through live
 exercises
 http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual-
 event?utm_
 source=Sourceforge_BPM_Camp_5_6_15utm_medium=emailutm_
 campaign=VA_SF___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15utm_medium=emailutm_campaign=VA_SF___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Artifacts when saving as PDF

2015-04-07 Thread Thomas Caswell
This probably should be made into an issue on github as this is clearly a
bug.

On further consideration, the fact that in my example the bad pixels show
up only on the edge and are not symmetric makes me think that my original
suggestion is wrong.  Does `interpoltation='nearest'` work any better?

I also am not sure that the rasterzation is happening so this may be an
issue on the renderer end.

This needs more investigation that I have time for today.

Tom

On Tue, Apr 7, 2015 at 11:02 AM Steven Boada bo...@physics.tamu.edu wrote:

 Thomas,

 Thanks for the smaller example. I would have come up with one, but I
 wasn't sure what was causing it to begin with.

 Is there anything to be done to prevent this? Just use another backend?

 Steven

 On 4/6/15 8:47 PM, Thomas Caswell wrote:
  This is probaly due to issues with not all of the vector backends
  supporting alpha gracefully.
 
  This can be reproduced more simply by
 
  x, y = np.ogrid[-5:5:.1, -5:5:.1]
  dd = np.exp(-(x**2 + y**2))
  dd[dd  .1] = np.nan
 
  fig, ax = plt.subplots()
  ax.imshow(dd, interpolation='none', cmap='gray_r')
  plt.savefig('test.pdf')
 
  @steven In the future it is best to report bugs with minimal
  copy-paste able examples.
 
  On Mon, Apr 6, 2015 at 5:41 PM Steven Boada bo...@physics.tamu.edu
  mailto:bo...@physics.tamu.edu wrote:
 
  Getting some strange artifacts when I save a figure as a PDF in
  matplotlib. Here are some screen shots. PDF
  http://imgur.com/oQDXkWn and PNG http://imgur.com/bCw3Fn4. Any
  idea why that is happening?
 
  Here is (most of) the source code that makes the plot. I stripped
  out the data generation, because it is long and involved, and
  doesn't really matter. Basically what the script is supposed to do
  is make a scatter plot where the density is below some threshold,
  and a 2d histogram when it is above that threshold. The code seems
  to work fine, but when I save the figure (using savefig in
  Ipython) it shows up funny.
 
  Thanks.
 
  import pylab as pyl
 
  bins = [50,50]
  thresh = 3
 
  xdat = #generate or load some data
  ydat = #generate or load some data
 
  hh, locx, locy = pyl.histogram2d(xdat, ydat,
  range=[[-1,4],[-26,-10]], bins=bins)
  posx = pyl.digitize(xdat, locx)
  posy = pyl.digitize(ydat, locy)
 
  # finds the bins which contain points. posx = 0 for points
  outside range
  ind = (posx  0)  (posx = bins[0])  (posy  0)  (posy =
  bins[1])
  # values of histogram with points in the bins.
  hhsub = hh[posx[ind] - 1, posy[ind] - 1]
 
  xdat1 = xdat[ind][hhsub  thresh] # low density points
  ydat1 = ydat[ind][hhsub  thresh]
  hh[hh  thresh] = pyl.nan # fill the areas with low density by
  NaNs
 
  pyl.scatter(xdat1, ydat1, s=20, c='0.8')
  pyl.imshow(pyl.log10(hh.T), cmap='gray_r',
  extent=pyl.array([[-1,4],[-26,-10]]).flatten(),
  interpolation='none')
 
  pyl.show()
 
  --
 
  Steven Boada
 
  Doctoral Student
  Dept of Physics and Astronomy
  Texas AM University
  bo...@physics.tamu.edu  mailto:bo...@physics.tamu.edu
 
  
 --
  BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
  Develop your own process in accordance with the BPMN 2 standard
  Learn Process modeling best practices with Bonita BPM through live
  exercises
  http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual-
  event?utm_
  source=Sourceforge_BPM_Camp_5_6_15utm_medium=emailutm_
 campaign=VA_SF___
  Matplotlib-users mailing list
  Matplotlib-users@lists.sourceforge.net
  mailto:Matplotlib-users@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/matplotlib-users
 

 --

 Steven Boada

 Doctoral Student
 Dept of Physics and Astronomy
 Texas AM University
 bo...@physics.tamu.edu


 
 --
 BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
 Develop your own process in accordance with the BPMN 2 standard
 Learn Process modeling best practices with Bonita BPM through live
 exercises
 http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual-
 event?utm_
 source=Sourceforge_BPM_Camp_5_6_15utm_medium=emailutm_campaign=VA_SF
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live

Re: [Matplotlib-users] sharex with one figure aspect = 1.0

2015-04-08 Thread Thomas Caswell
What are the data limits you are using?

I suspect they you are over constraining the system/order of operations
issue. Try dropping the adjustable setting and pre setting both the data
limits and the approximate size in figure fraction (ex via grid spec) of
the axes.

Tom

On Tue, Apr 7, 2015, 15:54 Mark Bakker mark...@gmail.com wrote:

 Hello list,

 I want to axes above each other. They share the x-axis. The top figure has
 'aspect=1' (it is a map), the bottom figure shows a cross-section along a
 horizontal line on the map, so it doesn't have 'aspect=1'. When I do this
 with code, for example like this:

 fig, axes = plt.subplots(nrows=2,sharex=True)
 plt.setp(axes[0], aspect=1.0, adjustable='box-forced')

 then the physical size of the top axes is much sorter than the physical
 size of the bottom axes (although they are poperly linked, as they have the
 same data limit, and when zooming in the top figure, the bottom figure
 adjusts). It just looks weird, as the size of the horizontal axis of the
 bottom figure should have the same physical size as the horizontal axis of
 the top figure. This used to be possible (a few years ago; haven't tried it
 for a while). Is there a way to do it with the current matpotlib? (1.4.3)

 Thanks,

 Mark
 
 --
 BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
 Develop your own process in accordance with the BPMN 2 standard
 Learn Process modeling best practices with Bonita BPM through live
 exercises
 http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual-
 event?utm_
 source=Sourceforge_BPM_Camp_5_6_15utm_medium=emailutm_
 campaign=VA_SF___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15utm_medium=emailutm_campaign=VA_SF___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] sharex with one figure aspect = 1.0

2015-04-08 Thread Thomas Caswell
Can you please provide a minimal, but complete and runnable example of what
you are doing?

On Wed, Apr 8, 2015, 08:13 Mark Bakker mark...@gmail.com wrote:

 Thanks, Thomas.

 That works indeed, but it doesn't make the figure adjustable, which is
 what I wanted (that the physical size of the axes changes while the aspect
 ratio is fixed to 1). I guess that functionality has been taken out.

 Mark

 On Wed, Apr 8, 2015 at 12:50 PM, Thomas Caswell tcasw...@gmail.com
 wrote:

 What are the data limits you are using?

 I suspect they you are over constraining the system/order of operations
 issue. Try dropping the adjustable setting and pre setting both the data
 limits and the approximate size in figure fraction (ex via grid spec) of
 the axes.

 Tom

 On Tue, Apr 7, 2015, 15:54 Mark Bakker mark...@gmail.com wrote:

 Hello list,

 I want to axes above each other. They share the x-axis. The top figure
 has 'aspect=1' (it is a map), the bottom figure shows a cross-section along
 a horizontal line on the map, so it doesn't have 'aspect=1'. When I do this
 with code, for example like this:

 fig, axes = plt.subplots(nrows=2,sharex=True)
 plt.setp(axes[0], aspect=1.0, adjustable='box-forced')

 then the physical size of the top axes is much sorter than the physical
 size of the bottom axes (although they are poperly linked, as they have the
 same data limit, and when zooming in the top figure, the bottom figure
 adjusts). It just looks weird, as the size of the horizontal axis of the
 bottom figure should have the same physical size as the horizontal axis of
 the top figure. This used to be possible (a few years ago; haven't tried it
 for a while). Is there a way to do it with the current matpotlib? (1.4.3)

 Thanks,

 Mark
 
 --
 BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
 Develop your own process in accordance with the BPMN 2 standard
 Learn Process modeling best practices with Bonita BPM through live
 exercises
 http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual-
 event?utm_
 source=Sourceforge_BPM_Camp_5_6_15utm_medium=emailutm_
 campaign=VA_SF___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users



--
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15utm_medium=emailutm_campaign=VA_SF___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] sharex with one figure aspect = 1.0

2015-04-08 Thread Thomas Caswell
What version had this behavior?  I recall some work on how aspect worked,
but not exactly what we did.  I see why it is useful, but on the other hand
that sort of coupling seems like could cause some trouble if we are not
careful.  This all come back to we need a real layout manager/constraint
solver (which no one has yet had time to address).

For now I think this will do what you want:

import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable

fig, ax_top = plt.subplots()
ax_top.set_aspect(1)
divider = make_axes_locatable(ax_top)
bax_bottom = divider.append_axes('bottom', 1, pad=0.1,
 sharex=ax_top)


Please don't use `plt.setp`, it is a MATLABism that I think is past it's
time.

On Wed, Apr 8, 2015 at 8:21 AM Mark Bakker mark...@gmail.com wrote:

 import matplotlib.pyplot as plt
 %matplotlib qt
 fig, axes = plt.subplots(nrows=2,sharex=True)
 plt.setp(axes[0], aspect=1.0, adjustable='box-forced')
 plt.show()

 This used to create two axes of the same horizontal size. What it does now
 is that it scales the upper axis so that the aspect=1.0 by changing the
 physical size of the axis. But the physical size of the lower axis is not
 changed, while this used to be the case in the past (but that may have been
 a few years back). That sure used to be the desired behavior.

 Thanks for your help,

 Mark



 On Wed, Apr 8, 2015 at 2:16 PM, Thomas Caswell tcasw...@gmail.com wrote:

 Can you please provide a minimal, but complete and runnable example of
 what you are doing?

 On Wed, Apr 8, 2015, 08:13 Mark Bakker mark...@gmail.com wrote:

 Thanks, Thomas.

 That works indeed, but it doesn't make the figure adjustable, which is
 what I wanted (that the physical size of the axes changes while the aspect
 ratio is fixed to 1). I guess that functionality has been taken out.

 Mark

 On Wed, Apr 8, 2015 at 12:50 PM, Thomas Caswell tcasw...@gmail.com
 wrote:

 What are the data limits you are using?

 I suspect they you are over constraining the system/order of operations
 issue. Try dropping the adjustable setting and pre setting both the data
 limits and the approximate size in figure fraction (ex via grid spec) of
 the axes.

 Tom

 On Tue, Apr 7, 2015, 15:54 Mark Bakker mark...@gmail.com wrote:

 Hello list,

 I want to axes above each other. They share the x-axis. The top figure
 has 'aspect=1' (it is a map), the bottom figure shows a cross-section 
 along
 a horizontal line on the map, so it doesn't have 'aspect=1'. When I do 
 this
 with code, for example like this:

 fig, axes = plt.subplots(nrows=2,sharex=True)
 plt.setp(axes[0], aspect=1.0, adjustable='box-forced')

 then the physical size of the top axes is much sorter than the
 physical size of the bottom axes (although they are poperly linked, as 
 they
 have the same data limit, and when zooming in the top figure, the bottom
 figure adjusts). It just looks weird, as the size of the horizontal axis 
 of
 the bottom figure should have the same physical size as the horizontal 
 axis
 of the top figure. This used to be possible (a few years ago; haven't 
 tried
 it for a while). Is there a way to do it with the current matpotlib? 
 (1.4.3)

 Thanks,

 Mark
 
 --
 BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
 Develop your own process in accordance with the BPMN 2 standard
 Learn Process modeling best practices with Bonita BPM through live
 exercises
 http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual-
 event?utm_
 source=Sourceforge_BPM_Camp_5_6_15utm_medium=emailutm_
 campaign=VA_SF___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users




--
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15utm_medium=emailutm_campaign=VA_SF___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] [matplotlib-devel] 1.4.3 does not build on Ubuntu 14 with python3

2015-04-01 Thread Thomas Caswell
There were multiple PRs that toched the freetype handling (iirc from Jens
and Tony Yu), but I don't remember if either got mreged off the top of my
head.

On Wed, Apr 1, 2015 at 12:55 PM Benjamin Root ben.r...@ou.edu wrote:

 Didn't we fix that in trunk recently?

 On Wed, Apr 1, 2015 at 12:51 PM, Jens Nielsen jenshniel...@gmail.com
 wrote:

 Looking more closely at this I think it is a bug on our side. When
 freetype is not found it returns version as 'Failed to identify version.' 
 which
 it tries to compare to a version number. The version number is correctly
 converted from string to numbers using loosversion but this string just
 makes it through. The workaround at the moment is to install the freetype
 dev as Tom said.


 Jens

 ons. 1. apr. 2015 kl. 17.45 skrev Christian Ambros ambr...@ymail.com:

 Hi,

 as you can see: 14.3.1 which is the latest, because before I started
 upgrading, I read about possible issues here and upgraded the setuptools as
 conclusion.

 Python 3.4.0 (default, Apr 11 2014, 13:05:11)
 [GCC 4.8.2] on linux
 Type help, copyright, credits or license for more information.
  import setuptools
  print(setuptools.__version__)
 14.3.1
  exit()

 cheers,
 Christian
 --
 A little learning never caused anyone's head to explode!


 Ein wenig Lernen hat noch niemandens Kopf zum Explodieren gebracht!



   On Wednesday, April 1, 2015 1:25 PM, Jens Nielsen 
 jenshniel...@gmail.com wrote:


 I think we have seen this issue before and it seems to be caused by an
 out of date version of setuptools. I tried reproducing it on fresh ubuntu
 14.04 machine but was not able to reproduce the issue. Do you know which
 version of setuptools you are using?

 Jens

 ons. 1. apr. 2015 kl. 14.19 skrev Thomas Caswell tcasw...@gmail.com:

 Make sure you have `freetype-dev` installed at the system level.

 Tom

 On Wed, Apr 1, 2015 at 8:02 AM Christian Ambros ambr...@ymail.com
 wrote:

 Hi,

 I'm facing the same trouble with installing matplotlib 1.4.3 and
 1.5.dev1. running

 python3 setup.py build

 in the unarchived directory gives this:

 
 Edit setup.cfg to change the build options

 BUILDING MATPLOTLIB
 matplotlib: yes [1.5.dev1]
 python: yes [3.4.0 (default, Apr 11 2014, 13:05:11)  [GCC
 4.8.2]]
   platform: yes [linux]

 REQUIRED DEPENDENCIES AND EXTENSIONS
  numpy: yes [version 1.9.2]
six: yes [using six version 1.5.2]
   dateutil: yes [using dateutil version 2.0]
   pytz: yes [using pytz version 2012c]
tornado: yes [using tornado version 3.1.1]
  pyparsing: yes [using pyparsing version 2.0.1]
 libagg: yes [Requires patches that have not been merged
 upstream. Using local copy.]
 Traceback (most recent call last):
   File setup.py, line 153, in module
 result = package.check()
   File /home/ambrosc/Downloads/matplotlib-master/setupext.py, line
 900, in check
 min_version='2.3', version=version)
   File /home/ambrosc/Downloads/matplotlib-master/setupext.py, line
 446, in _check_for_pkg_config
 if (not is_min_version(version, min_version)):
   File /home/ambrosc/Downloads/matplotlib-master/setupext.py, line
 173, in is_min_version
 return found_version = expected_version
   File /usr/lib/python3.4/distutils/version.py, line 76, in __ge__
 c = self._cmp(other)
   File /usr/lib/python3.4/distutils/version.py, line 343, in _cmp
 if self.version  other.version:
 TypeError: unorderable types: str()  int()

 I'm running Linux Mint 17 Quina which is based on Ubuntu's trusty
 packges.

 pip3 is up to date. Running
 print(setuptools.__file__)

 gives: /usr/local/lib/python3.4/dist-packages/setuptools/__init__.py
 which is as expected.

 Using pip3 install matplotlib --upgrade #even to 1.4.3
 get's me this:


 Collecting matplotlib from
 https://pypi.python.org/packages/source/m/matplotlib/matplotlib-1.4.3.tar.gz#md5=86af2e3e3c61849ac7576a6f5ca44267
   Downloading matplotlib-1.4.3.tar.gz (50.4MB)
 100% || 50.4MB 8.0kB/s
 Traceback (most recent call last):
   File string, line 20, in module
   File /tmp/pip-build-sezmzam8/matplotlib/setup.py, line 155, in
 module
 result = package.check()
   File /tmp/pip-build-sezmzam8/matplotlib/setupext.py, line 961,
 in check
 min_version='2.3', version=version)
   File /tmp/pip-build-sezmzam8/matplotlib/setupext.py, line 445,
 in _check_for_pkg_config
 if (not is_min_version(version, min_version)):
   File /tmp/pip-build-sezmzam8/matplotlib/setupext.py, line 173,
 in is_min_version
 return found_version = expected_version
   File /usr/lib/python3.4/distutils/version.py, line 76, in __ge__
 c = self._cmp(other)
   File /usr/lib/python3.4/distutils/version.py, line 343

Re: [Matplotlib-users] What are my options for speeding up a custom function called by `FuncAnimation`?

2015-05-19 Thread Thomas Caswell
What are you plotting? How big is this list that the loops are taking
appreciable amounts of time?!?  Are we talking seconds here or ms?

Have you done enough profiling to know exactly which line in here are
slow?  I don't quite understand the `np.ravel` calls.

You might do better either with one (or many?) collection artists.

You might also look into just updating the artists you have.

Without some context of what these patches are it is really hard to help
(or even really understand why this is slow).

Tom

On Sat, May 16, 2015 at 6:44 PM bmer bhmerch...@gmail.com wrote:

 This is what my animation function (i.e. the one that gets called by
 `FuncAnimation`) looks like:

 import numpy as np
 ...
 def mpl_animation_function(n):
 print animating timestep: , n

 if n  0:
 previous_relevant_patch_indices =
 np.ravel(patch_indices_per_timestep[n-1])
 for index in previous_relevant_patch_indices:
 (patches[index]).set_visible(False)

 relevant_patch_indices =
 np.ravel(patch_indices_per_timestep[n])

 for index in relevant_patch_indices:
 (patches[index]).set_visible(True)

 return patches,

 `patches` is a pre-generated list of patches (possibly large), that have
 already been added to an `axes` instance.


 This function is awfully time-consuming as the number of patches becomes
 large.

 One idea I had was to parallelize the `for` loop, but likely that won't
 work
 because of issues with the `axes` instance being accessed and modified in
 parallel -- so I am afraid of fruitlessly spending time there. Do I have
 any
 other options, or is parallelization possible?



 --
 View this message in context:
 http://matplotlib.1069221.n5.nabble.com/What-are-my-options-for-speeding-up-a-custom-function-called-by-FuncAnimation-tp45562.html
 Sent from the matplotlib - users mailing list archive at Nabble.com.


 --
 One dashboard for servers and applications across Physical-Virtual-Cloud
 Widest out-of-the-box monitoring support with 50+ applications
 Performance metrics, stats and reports that give you Actionable Insights
 Deep dive visibility with transaction tracing using APM Insight.
 http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] [matplotlib-devel] RFC: candidates for a new default colormap

2015-06-05 Thread Thomas Caswell
Jody,

This has come up before and the consensus seemed to be that for the anomaly
data sets knowing where the zero is is very important and the default color
limits will probably get that wrong.  So long as the user has to set the
limits, they can also select one of the diverging color maps.

I also advocate for users/domains which typically plot anomaly/diverging
data sets to write helper functions like

def im_diverging(ax, data, cmap='RbBu', *args, **kwargs):
limits = some_limit_function(data)
return ax.imshow(data, cmap=cmap, vmin=limits[0], vmax=limits[1],
*args, **kwargs)

Tom

On Fri, Jun 5, 2015 at 12:18 PM Jody Klymak jkly...@uvic.ca wrote:

 Hi,

 This is a great initiative, I love colormaps and am always disatisfied.

 However, I am concerned about these proposed defaults.  As Ben says, there
 are two types of data sets: “intensity” or “density” data, and data sets
 with a natural zero (i.e. positive or negative anomaly or velocity).  I’d
 be fine with any of the proposed colormaps for “intensity” data sets, but I
 would *never* use them for anomaly data sets; I couldn’t tell where the
 middle (zero) of any of those colormaps are intuitively.

 Jet and parula, for all their sins, are decent compromises for the naive
 user (or the user in a rush) because they do a good job of representing
 both types of data.  Even in black and white jet does something reasonable,
 which is go to dark at extreme values and white-ish in the middle.  Jet
 also has a nice central green hue between blue and yellow that signals zero
 (or at least it does to me after years of looking at it). I don’t see that
 jet really loses that under colorblindness; in fact I almost prefer the
 “Moderate Deuter” version of jet to the actual jet.

 Anyways, I guess I am advocating trying to find a colormap with a very
 obvious central hue to represent zero.  Anomaly data sets are *very*
 common, so having a default colormap that doesn’t do something reasonable
 with them may be a turn off to new users.

 Cheers,   Jody



 On 5 Jun 2015, at  8:36 AM, Benjamin Root ben.r...@ou.edu wrote:

 It is funny that you mention that you prefer the warmer colors over the
 cooler colors. There has been some back-n-forth about which is better. I
 personally have found myself adverse to using just cool or just warm
 colors, preferring a mix of cool and warm colors. Perhaps it is my
 background in meteorology and viewing temperature maps?

 Another place where a mix of cool and warm colors are useful is for
 severity indications such as radar maps. It is no accident that radar maps
 are colored greens and blues for weak precipitation, then yellow for
 heavier, and then reds for heaviest (possibly severe) precipitation -- it
 came from the old FAA color guides. While we all know that that colormap is
 fundamentally flawed, there was a rationale behind it.

 Hopefully I will have some time today to play around with the D option. I
 want to see if I can shift the curve a bit to include more yellows and
 orange so that it can have a mix of cool and warm colors.

 Ben Root


 On Fri, Jun 5, 2015 at 11:21 AM, Philipp A. flying-sh...@web.de wrote:

 I vote for A and B. Only B if i get just one vote.

 C is too washed out and i like the warm colors more than the cold ones in
 D.

 It’s funny that this comes up while I’m handling colormaps in my own work
 at the moment.

 Neal Becker ndbeck...@gmail.com schrieb am Fr., 5. Juni 2015 um
 12:58 Uhr:

 I vote for D, although I like matlab's new default even better



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



 --

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



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


 --
 Jody Klymak
 http://web.uvic.ca/~jklymak/






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

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


Re: [Matplotlib-users] zorder taking an array

2015-06-23 Thread Thomas Caswell
One thing you can do which may work is to partition your plots 'by hand'.

It is not super elegant, but might get you the desired behavior.  As long
as the number of partitions is low it shouldn't hurt performance _too_ much.

def z_jitter_plot(ax, x, y, partitions=10, **kwargs):
labels = np.random.randint(0, partitions, len(y))
z_levels = 1 + np.random.rand(partitions)
lns = []
for n, z in enumerate(z_levels):
ln = ax.plot(x[labels==n], y[labels==n], zorder=z, **kwargs)
lns.extend(ln)

return lns


fig, ax = plt.subplots()
N = 2500
all_lns = []
for j, c in enumerate('rgbk'):
x = np.linspace(0, 1, N)
y = np.random.randn(N)
lns = z_jitter_plot(ax, x, y, partitions=100, color=c, ls='',
markersize=52, marker='o')
all_lns.extend(lns)

Throwing in `alpha=.5` might also help a bit.

You will have to manage the color cycle your self here as this plots many
lines (each of which wants to advance the color cycle) per data set.

Tom

On Tue, Jun 23, 2015 at 2:16 PM Benjamin Root ben.r...@ou.edu wrote:

 Right, when zorder is not explicitly specified, all the artists of the
 same type get the same default zorder (I think 2, but I can't remember). We
 then use a stable sort to determine the draw order, so two artists with the
 same zorder are drawn in the order that they were created (the exception
 being mplot3d, because it mucks about with zorders to achieve the 3d
 effect).

 Ben Root

 On Tue, Jun 23, 2015 at 1:53 PM, Jody Klymak jkly...@uvic.ca wrote:


 For my backend (nbagg), the order of the data determines the order of
 drawing.  So in the following, the third diamond covers the first two in
 the first plot, but the first diamond covers them all in the second plot.
 Perhaps not as elegant as a matrix zorder, but can achieve the effect you
 are after.

 Cheers,   Jody

 fig, ax = plt.subplots(2,1)
 x = np.arange(3)
 y = 0.*x
 ax[0].plot(x,y,'d',markersize=52)
 ax[0].set_xlim(-10.,10.)
 ax[1].plot(x[[2,1,0]],y[[2,1,0]],'d',markersize=52)
 ax[1].set_xlim(-10.,10.)


 On Jun 23, 2015, at  9:44 AM, Benjamin Root ben.r...@ou.edu wrote:

 I see what you are getting at. The issue is that artists are first sorted
 by the zorder and then drawn one at a time. The draw for a collection
 artist is an at-once operation, it can't (currently) be split out and
 interspersed with the draws from another artist. This is one of the major
 limitations for mplot3d, as it would be nice to compose a 3d scene properly
 so that everything is logically consistent.

 I have actually been working on some changes that would allow one to sort
 the draws of individual elements of a collection, but I still haven't
 figured out a way to break out the elements with other collection
 elements in a way that doesn't break the current design or introduce major
 performance penalties. Maybe I'll figure something out during SciPy2015.

 Cheers!
 Ben Root


 On Tue, Jun 23, 2015 at 5:44 AM, Simon Walker 
 s.r.walker...@googlemail.com wrote:

 When multiple datasets are plotted on the same axis, the points overlay
 each other making it hard to see the points under the most recent ones. One
 way to avoid this is to give each point a random zorder, randomising its
 position in the z axis. This way, points from the first dataset may overly
 points from the last dataset.

 This could be achieved nicely if the zorder keyword took an array so the
 random zorder values per point can be pre-computed, but currently it only
 accepts a single number for the whole dataset. Would this be a useful
 feature for others to have? How difficult would it be to implement?

 Thanks,

 Simon Walker

 --
 Monitor 25 network devices or servers for free with OpManager!
 OpManager is web-based network management software that monitors
 network devices and physical  virtual servers, alerts via email  sms
 for fault. Monitor 25 devices for free with no restriction. Download now
 http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users



 --
 Monitor 25 network devices or servers for free with OpManager!
 OpManager is web-based network management software that monitors
 network devices and physical  virtual servers, alerts via email  sms
 for fault. Monitor 25 devices for free with no restriction. Download now

 http://ad.doubleclick.net/ddm/clk/292181274;119417398;o___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users




 --
 Monitor 25 network devices or servers for free with OpManager!
 OpManager 

Re: [Matplotlib-users] Use _cntr.so in fortran?

2015-06-25 Thread Thomas Caswell
Also keep in mind that we consider all of the c extensions to be part of
the private api and do not worry so much about breaking them.

Tom

On Thu, Jun 25, 2015, 3:45 PM Benjamin Root ben.r...@ou.edu wrote:

 _cntr.so has been deprecated (it might take a couple of releases before we
 remove it entirely). _contour.so has a newer, better interface and comes
 with a python wrapper.  Don't know if that is an issue at all for you, just
 noting that is the case.

 I might also suggest looking at scikit-image, as I think it has some
 contouring algorithms that might be easier to link to.

 Ben Root

 On Thu, Jun 25, 2015 at 2:28 PM, Sterling Smith smit...@fusion.gat.com
 wrote:

 The contour finder in matplotlib is more robust than I currently have in
 a legacy fortran project.  I would like to link to matplotlib’s instead.
 Has anyone done this before?  Are there any suggestions or pitfalls for
 proceeding?

 Thanks,
 Sterling

 --
 Monitor 25 network devices or servers for free with OpManager!
 OpManager is web-based network management software that monitors
 network devices and physical  virtual servers, alerts via email  sms
 for fault. Monitor 25 devices for free with no restriction. Download now
 http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users



 --
 Monitor 25 network devices or servers for free with OpManager!
 OpManager is web-based network management software that monitors
 network devices and physical  virtual servers, alerts via email  sms
 for fault. Monitor 25 devices for free with no restriction. Download now
 http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors 
network devices and physical  virtual servers, alerts via email  sms 
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Disable the Close Button from the plot dialogue

2015-05-28 Thread Thomas Caswell
How to do that is dependent on which gui frame work you are using and may
be globally controlled at the desktop environment level.


Tom

On Thu, May 28, 2015, 12:13 Blingo petersbing...@hotmail.co.uk wrote:

 Hi there

 Just want to disable the X at the top right. It's the default frame used by
 matplotlib when plotting.
 Windows.

 Thanks

 Peter



 --
 View this message in context:
 http://matplotlib.1069221.n5.nabble.com/Disable-the-Close-Button-from-the-plot-dialogue-tp45633.html
 Sent from the matplotlib - users mailing list archive at Nabble.com.


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

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


Re: [Matplotlib-users] Using blit=True in matplotlib.animation

2015-05-31 Thread Thomas Caswell
Please keep discussion on the list.

That warning means some thing is importing pyplot before your file. You
need to make sure that you use `matplotlib.use` before anything in your
process import `pyplot`.

You may need to change your `matplotlibrc` file.

Tom

On Sun, May 31, 2015, 00:30 Peter Rowat pe...@pelican.ucsd.edu wrote:

 My file starts:
 import numpy as np
 import matplotlib
 matplotlib.use('TKAgg')
 import matplotlib.pyplot as plt
 import matplotlib.animation as animation


 and the animation works, with blit=False, but with this message:
 ==
 /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/__init__.py:1155:
 UserWarning:  This call to matplotlib.use() has no effect
 because the backend has already been chosen;
 matplotlib.use() must be called *before* pylab, matplotlib.pyplot,
 or matplotlib.backends is imported for the first time.

   warnings.warn(_use_error_msg)
 ===
 So I can live with this, but seems there is something not quite right
 about the __init__.py code
 Should I use a different backed than the OS X backend?

 — Peter

 On May 30, 2015, at 8:43 PM, Thomas Caswell tcasw...@gmail.com wrote:

 Blitting not working for the osx backend is a long standing issue due to
 differences between what is allowed in the different gui frame works.

 You have to change the backend via `use` before you import pyplot.  If you
 are still getting the error it is likely you tried to change the backend
 _after_ pyplot was imported, in which case the `use` command does nothing.

 Tom

 On Sat, May 30, 2015 at 11:03 PM Peter Rowat pe...@pelican.ucsd.edu
 wrote:

 I’m on OS X, trying to write a multi-slider-controlled animation. If I
 have blit=True in the call to matplotlib.animation,
 I get this message

 matplotlib.animation.BackendError: The current backend is 'MacOSX'
 and may go into an infinite loop with blit turned on.  Either
 turn off blit or use an alternate backend, for example, like
 'TKAgg', using the following prepended to your source code:

 import matplotlib
 matplotlib.use('TKAgg’)
 =

 When I make this change  I still get the same error message, whether blit
 is set True or False.
 At least when blit=False the animation runs, which I can live with for
 the moment.

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



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


Re: [Matplotlib-users] Using blit=True in matplotlib.animation

2015-05-30 Thread Thomas Caswell
Blitting not working for the osx backend is a long standing issue due to
differences between what is allowed in the different gui frame works.

You have to change the backend via `use` before you import pyplot.  If you
are still getting the error it is likely you tried to change the backend
_after_ pyplot was imported, in which case the `use` command does nothing.

Tom

On Sat, May 30, 2015 at 11:03 PM Peter Rowat pe...@pelican.ucsd.edu wrote:

 I’m on OS X, trying to write a multi-slider-controlled animation. If I
 have blit=True in the call to matplotlib.animation,
 I get this message

 matplotlib.animation.BackendError: The current backend is 'MacOSX'
 and may go into an infinite loop with blit turned on.  Either
 turn off blit or use an alternate backend, for example, like
 'TKAgg', using the following prepended to your source code:

 import matplotlib
 matplotlib.use('TKAgg’)
 =

 When I make this change  I still get the same error message, whether blit
 is set True or False.
 At least when blit=False the animation runs, which I can live with for the
 moment.

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

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


[Matplotlib-users] Fwd: Error on gridspec.py

2015-05-30 Thread Thomas Caswell
Jan,

Please keep discussions on the list.

See below for forwarded email

-- Forwarded message -
From: Albrecht, Jan jan.albre...@enas.fraunhofer.de
Date: Tue, May 26, 2015 at 2:58 AM
Subject: AW: [Matplotlib-users] Error on gridspec.py
To: Thomas Caswell tcasw...@gmail.com


 Dear Thomas,



sorry for the last slapdashed E-Mail.



I am using Python-Version 2.6.2 . This version is necessary, because I work
additional with the finite element simulation program ABAQUSTM.

The examples I wanted to test are from the matplot website.



Installed packages :



MatPlot: matplotlib-1.4.3

Numpy 1.6.2

PIL 1.1.7

Dateutil 1.4.1

Six 1.9.0

Pyparsing 2.0.3



I hope this will help to help me.



Mit freundlichen Grüßen/ kind regards

*Jan Albrecht*



Micro Materials Center Chemnitz at Fraunhofer Institute

for Electronic Nano Systems (ENAS)

Technologie Campus 3

09126 Chemnitz



Tel:   0371 / 45001 424

Fax:   0371 / 45001 524

Email:   jan.albre...@enas.fraunhofer.de

http://www.enas.fraunhofer.de/de/Abteilungen/MMC.html



Diese E-Mail kann Betriebs- und Geschäftsgeheimnisse, dem Anwaltsgeheimnis
unterliegende oder sonstige vertrauliche Informationen enthalten. Sollten
Sie diese E-Mail irrtümlich erhalten haben, ist Ihnen die Kenntnisnahme des
Inhalts, eine Vervielfältigung oder Weitergabe der E-Mail ausdrücklich
untersagt. Bitte benachrichtigen Sie den Absender der E-Mail und vernichten
die empfangene E-Mail. Vielen Dank.

Since this e-mail contains confidential information, it must be treated
with utmost confidentiality. Any person who may get in contact with this
information by mistake should not take any notice of the topic and should
not pass on or duplicate any part of this information. The e-mail has to be
destroyed and the sender of the e-mail has to be informed immediately.
Thank you.









*Von:* Thomas Caswell [mailto:tcasw...@gmail.com]
*Gesendet:* Sonntag, 24. Mai 2015 19:45
*An:* Albrecht, Jan; matplotlib-users@lists.sourceforge.net
*Betreff:* Re: [Matplotlib-users] Error on gridspec.py



Jan,

If you subscribe to the user list you will be able to post with out
moderation.

Can you point us to which example you are running?  From what you have sent
is is very hard to sort out what is going wrong as we have to guess what
you are doing.

Tom



On Sun, May 24, 2015 at 1:38 PM Albrecht, Jan 
jan.albre...@enas.fraunhofer.de wrote:

Hi dear all,



I have installed matplot and also six.py and so on.



If i start an example from matplot i get the following eror message:



File C:\Python26\lib\site-packages\matplotlib\pyplot.py, line 1087, in
subplots

ax0 = fig.add_subplot(gs[0, 0], **subplot_kw)

  File C:\Python26\lib\site-packages\matplotlib\figure.py, line 964, in
add_subplot

a = subplot_class_factory(projection_class)(self, *args, **kwargs)

  File C:\Python26\lib\site-packages\matplotlib\axes\_subplots.py, line
75, in __init__

self.update_params()

  File C:\Python26\lib\site-packages\matplotlib\axes\_subplots.py, line
115, in update_params

return_all=True)

 File C:\Python26\lib\site-packages\matplotlib\gridspec.py, line 425, in
get_position

gridspec.get_grid_positions(fig)

  File C:\Python26\lib\site-packages\matplotlib\gridspec.py, line 86, in
get_grid_positions

subplot_params = self.get_subplot_params(fig)

  File C:\Python26\lib\site-packages\matplotlib\gridspec.py, line 271, in
get_subplot_params

subplotpars.update(**update_kw)

TypeError: update() keywords must be strings



Maybe someone can help me, thanks a lot

JAn

--
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
--
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Automatic selection of different colormaps for anomaly intensity data

2015-07-02 Thread Thomas Caswell
This has been discussed and the consensus was that getting the heuristics
right is probably impossible (I work with dark-current subtracted image
data so it can have negative values, but using a diverging color map is
_very_ wrong, taking 0 as the center only makes sense some of the time).
Defaulting to a linear norm and sequential color map is in the worst case
not helpful, where as using the wrong center (or incorrectly using a
diverging color map) can be misleading.  We are prioritizing not being
misleading over being slightly more convenient in the core library.

A function with a call signature like you describe should definitely be in
the examples.

Also see PR https://github.com/matplotlib/matplotlib/pull/3858 which is
adding a new normalizer to make setting up non-symmetric diverging color
maps easier.

Tom

On Thu, Jul 2, 2015 at 11:49 AM George Nurser gnur...@gmail.com wrote:

 Hi,
 I've been following the discussions about the new default colormaps.
 I think it might be really helpful if the default behaviour were that
 matplotlib simply examined your data (Z, say), and if
 (1) Z.max()  Z.min() had the same sign then used a sequential colormap
 whereas if
 (2) Z.max()  Z.min() had opposite signs then it used a diverging
 colormap, centered on zero.
 Keywords e.g. Anomaly=True   centre = 10. could be extra arguments to
 override this behaviour.

 I realise that
 a) this really only requires a user to write a simple helper application.
  But 99% of users will never do this.

 b) it may not always be desired; but again 99% of the time it probably is.

 This would enable people just starting to use matplotlib perhaps to see
 that it can give 'better' plots than matlab

 Anyway, just a thought.

 George Nurser.






 --
 Don't Limit Your Business. Reach for the Cloud.
 GigeNET's Cloud Solutions provide you with the tools and support that
 you need to offload your IT needs and focus on growing your business.
 Configured For All Businesses. Start Your Cloud Today.
 https://www.gigenetcloud.com/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] How to get the value of a cell in pcolormesh

2015-05-24 Thread Thomas Caswell
To get the index of the grid you clicked on requires some knowledge of what
artist you are working with.

See https://github.com/matplotlib/matplotlib/pull/3989 for some brand new
code which makes this easier to implement in a general way.

While we catch up with that you will need to implement your own mapping of
x/y in data space - i, j See
http://matplotlib.org/examples/api/image_zcoord.html for an example.

Tom

On Tue, May 12, 2015 at 2:21 AM GoogleWind googlew...@163.com wrote:

 Hi everyone!
 It is cool to use the pcolormesh in matplotlib. However, is there a way to
 get the i, j indexes of the clicked cell?  I have try
 event.mouseevent.xdata
 and event.mouseevent.x. But they did not return the index I need.

 Thanks in advanced for your help.

 Dr. Jiacong Huang
 Nanjing Institute of Geography  Limnology
 Chinese Academy of Sciences
 73 East Beijing Road, Nanjing 210008, China
 Tel./Fax: +86-25-86882127
 Homepage: http://www.escience.cn/people/elake/index.html



 ---Code to generate pcolormesh---
 import numpy as np
 from matplotlib.pyplot import figure, show
 from numpy import ma

 n = 12
 x = np.linspace(-1.5,1.5,n)
 y = np.linspace(-1.5,1.5,n*2)
 X,Y = np.meshgrid(x,y);
 Qx = np.cos(Y) - np.cos(X)
 Qz = np.sin(Y) + np.sin(X)
 Qx = (Qx + 1.1)
 Z = np.sqrt(X**2 + Y**2)/5;
 Z = (Z - Z.min()) / (Z.max() - Z.min())

 # The color array can include masked values:
 Zm = ma.masked_where(np.fabs(Z)  100, Z)

 fig = figure()
 ax = fig.add_subplot(111)
 col = ax.pcolormesh(Qx[:5,:4],Qz[:5,:4],Zm[:4,:3])
 show()
 -



 --
 View this message in context:
 http://matplotlib.1069221.n5.nabble.com/How-to-get-the-value-of-a-cell-in-pcolormesh-tp45499.html
 Sent from the matplotlib - users mailing list archive at Nabble.com.


 --
 One dashboard for servers and applications across Physical-Virtual-Cloud
 Widest out-of-the-box monitoring support with 50+ applications
 Performance metrics, stats and reports that give you Actionable Insights
 Deep dive visibility with transaction tracing using APM Insight.
 http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Problem: AttributeError: 'module' object has no attribute '_string_to_bool'

2015-08-18 Thread Thomas Caswell
This is related to files from the previous implementation still being
around.  Please make sure you have fully removed the old mpl installation
before installing the new one.  Be aware that there is some difference in
the way pip/setuptools/distutils deal with namespace packages so look for
both `matplotlib` and `mpl_toolkits` directories.

Tom

On Tue, Aug 18, 2015 at 12:49 PM Bob Dobalina aspann...@gmail.com wrote:

 When trying to create a 3D axes, I receive this error:

 /usr/lib/pymodules/python2.7/mpl_toolkits/mplot3d/axes3d.pyc in grid(self,
 b, **kwargs)
1254 if len(kwargs) :
1255 b = True
 - 1256 self._draw_grid = maxes._string_to_bool(b)
1257
1258 def ticklabel_format(self, **kwargs) :

 AttributeError: 'module' object has no attribute '_string_to_bool'

 I'm running matplotlib 1.4.3 on linux (ubuntu-based), and was able to
 create
 3D axes until I updated last week.

 Thanks in advance.




 --
 View this message in context:
 http://matplotlib.1069221.n5.nabble.com/Problem-AttributeError-module-object-has-no-attribute-string-to-bool-tp46020.html
 Sent from the matplotlib - users mailing list archive at Nabble.com.


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

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


Re: [Matplotlib-users] Problem: AttributeError: 'module' object has no attribute '_string_to_bool'

2015-08-18 Thread Thomas Caswell
Also, please use the new mailing list at matplotlib-us...@python.org



On Tue, Aug 18, 2015 at 12:53 PM Thomas Caswell tcasw...@gmail.com wrote:

 This is related to files from the previous implementation still being
 around.  Please make sure you have fully removed the old mpl installation
 before installing the new one.  Be aware that there is some difference in
 the way pip/setuptools/distutils deal with namespace packages so look for
 both `matplotlib` and `mpl_toolkits` directories.

 Tom

 On Tue, Aug 18, 2015 at 12:49 PM Bob Dobalina aspann...@gmail.com wrote:

 When trying to create a 3D axes, I receive this error:

 /usr/lib/pymodules/python2.7/mpl_toolkits/mplot3d/axes3d.pyc in grid(self,
 b, **kwargs)
1254 if len(kwargs) :
1255 b = True
 - 1256 self._draw_grid = maxes._string_to_bool(b)
1257
1258 def ticklabel_format(self, **kwargs) :

 AttributeError: 'module' object has no attribute '_string_to_bool'

 I'm running matplotlib 1.4.3 on linux (ubuntu-based), and was able to
 create
 3D axes until I updated last week.

 Thanks in advance.




 --
 View this message in context:
 http://matplotlib.1069221.n5.nabble.com/Problem-AttributeError-module-object-has-no-attribute-string-to-bool-tp46020.html
 Sent from the matplotlib - users mailing list archive at Nabble.com.


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


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


  1   2   >