Phil Elson | 3 Feb 17:40
Picon
Gravatar

Non string projections

Some time back I asked about initialising a projection in MPL using generic
objects rather than by class name. I created a pull request associated with
this which was responded to fantastically by leejjoon which (after several
months) I have finally got around to implementing. My changes have been added
to the original pull request, which will eventually be obsoleted, but that
doesn't seem to have notified the devel mailing list, therefore I would like
to draw the list's attention to
https://github.com/matplotlib/matplotlib/pull/470#issuecomment-3743543 on
which I would greatly appreciate feedback & ultimately get onto the mpl master.

The pull request in question would pave the way for non string projections so
I thought I would play with how one might go about specifying the location of
theta_0 in a polar plot (i.e. should it be due east or due north etc.). I have
branched my changeset mentioned in the pull request above and implemented
a couple of ideas, although I am not proposing that these changes go any
further at this stage (I would be happy if someone wants to run with
them though):

Currently, one can set the theta_0 of a polar plot with:

ax = plt.axes(projection='polar')
ax.set_theta_offset(np.pi/2)
ax.plot(np.arange(100)*0.15, np.arange(100))

But internally there are some nasties going on (theta_0 is an attribute on the
axes, the transform is instantiated from within the axes and is given the axes
that is instantiating it, which is all a bit circular). I have made a branch
(https://github.com/PhilipElson/matplotlib/compare/master...polar_fun) which
alleviates the axes attribute issue and would allow something like:

(Continue reading)

Phil Elson | 3 Feb 14:40
Picon
Gravatar

Caching the results of Transform.transform_path for non-affine transforms

I'm trying to understand how the TransformedPath mechanism is working
with only limited success, and was hoping someone could help.

I have a non-affine transformation defined (subclass of
matplotlib.transforms.Transform) which takes a path and applies an
intensive transformation (path curving & cutting) which can take a
little while, but am able to guarantee that this transformation is a
one off and will never change for this transform instance, therefore
there are obvious caching opportunities.
I am aware that TransformedPath is doing some caching and would really
like to hook into this rather than rolling my own caching mechanism
but can't q
uite figure out (the probably obvious!) way to do it.

To see this problem for yourself I have attached a dummy example of
what I am working on:

import matplotlib.transforms

class SlowNonAffineTransform(matplotlib.transforms.Transform):
    input_dims = 2
    output_dims = 2
    is_separable = False
    has_inverse = True

    def transform(self, points):
        return matplotlib.transforms.IdentityTransform().transform(points)

    def transform_path(self, path):
        # pretends that it is doing something clever & time consuming,
(Continue reading)

Eric Firing | 29 Jan 22:35
Favicon
Gravatar

Re: All information about SF-filed bugs is inaccessible at SF

On 01/29/2012 10:53 AM, Fernando Perez wrote:
> Hi all,
>
> I don't know if you guys were aware of this, and if there's anything
> that can be done, but I just realized that all the bugs tagged SF:

Fernando,

Yes, this became evident right away after the transition; in addition, 
there was a coordination glitch such that quite a few bugs that I had 
closed on SF, trying to clear out some junk before the transition, ended 
up getting resurrected on github, complete with dead links.

This is a triage situation; we have to consider the cost/benefit 
tradeoff of various ways of dealing with the mess, and with the glut of 
bug and other reports.  The fact is that we were way behind in dealing 
with the SF bugs, and we are falling behind in dealing with github bugs.

I think the best approach is to be fairly brutal in closing bug reports. 
  We don't have the developer time to deal with very many.  Those that 
accumulate faster than we can deal with them merely cost us time 
whenever one of us scans the set of reports in an attempt to get the 
list under control by finding ways to close a few.

So, the dead SF links are the least of our problems; not that big a 
deal. We would lose little by simply closing all of the transfered 
reports; or at least closing all of those older than some threshold.

Eric

(Continue reading)

Fernando Perez | 29 Jan 21:53
Picon
Gravatar

All information about SF-filed bugs is inaccessible at SF

Hi all,

I don't know if you guys were aware of this, and if there's anything
that can be done, but I just realized that all the bugs tagged SF:

https://github.com/matplotlib/matplotlib/issues?labels=SF&sort=created&direction=desc&state=open&page=1

have useless links to their SF original pages, b/c SF has completely
closed access to the old tracker, e.g.:

http://sourceforge.net/tracker/?func=detail&aid=3044267&group_id=80706&atid=560723

I don't know if in the migration, the github issue has all the
information that was in the old bug.  In ipython when we migrated from
launchpad we kept links to the old issues as well:

https://github.com/ipython/ipython/issues/13 ==>
https://bugs.launchpad.net/ipython/+bug/508971

but fortunately launchpad continues to show the original bug in full.
This is useful for a number of reasons.  Launchpad is nice enough to
let you disable the bug tracker for new bug submissions while leaving
all existing bug pages still available.  This is much more sensible
than what SF seems to be doing.

I don't know there's much we can do, since this is really a
SourceForge issue.  But I wanted to mention it at least; if there's
important information buried in there, it might be possible to reopen
the SF tracker temporarily, scrape the bug pages for everything and
close it again.  I just don't know if the orignal bug transfer process
(Continue reading)

Fernando Perez | 29 Jan 10:12
Picon
Gravatar

Bug in print_figure with bbox_inches='tight'? Plots in ipython notebook losing titles and labels...

Hi all,

in ipython for the qtconsole and notebook, we send inline figures using

fig.canvas.print_figure(bytes_io, format=fmt, bbox_inches='tight')

as seen here:

https://github.com/ipython/ipython/blob/master/IPython/core/pylabtools.py#L104

However, this produces truncated figure titles.  Consider this code:

f, ax = plt.subplots()
ax.plot(rand(100))
ax.set_title('Axis title')
f.suptitle('Figure title');

###

which produces this in the notebook:

http://img546.imageshack.us/img546/5448/selection001c.png

As you can see, the figure title gets truncated.

We started using bbox_inches='tight' because otherwise in many cases
the images were coming back with insane amounts of white padding, and
Stefan vdW suggested this fix.  But it seems that in other cases it
actually loses data, which is even worse...

(Continue reading)

Tony Yu | 25 Jan 15:37
Picon
Gravatar

Re: [Matplotlib-users] Problem with cachedRenderer


On Wed, Jan 25, 2012 at 7:14 AM, andi <andisspam <at> googlemail.com> wrote:
Hi Tony,

thanks for your reply! I am not using the pdf backend, but the GTKAgg backend. Is it working with this backend in the development version?

Cheers
Andi

Hi Andi,

Unfortunately, I can't run the GTKAgg backend, but I checked your code snippet on the backends I have on my system. It seems this behavior is really inconsistent:

Works:
* agg
* qt4agg
* tkagg

Doesn't work:
* pdf
* macosx

To be honest, I don't understand the magical workings of the backends very well. I've copied the developer list since the consistency of backends seems like a relevant issue.

-Tony

P.S. Andi: Be sure to "reply all" since the mailing list doesn't automatically do this for some reason.



On 25/01/12 00:26, Tony Yu wrote:


On Tue, Jan 24, 2012 at 12:53 PM, andi <andisspam-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:
Hi all,

I have some old custom code for generating videos from matplotlib (not
using the animation module). It used to work, but is now failing.
Here is what I am doing:

-------------------
import matplotlib.pyplot as plt
import numpy as np

fig = plt.figure()
ax = fig.add_subplot(111)
im = ax.imshow(np.zeros((100, 100)))
fig.canvas.draw()
ax.draw_artist(im)
------------------

... and draw_artist from axes.py then gives me an AssertionError because
no renderer is found (assert self._cachedRenderer is not None).

Right now I am using matplotlib 1.0.1 and I think that the above used to
work with older versions in matplotlib. See e.g.
http://www.mail-archive.com/matplotlib-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org/msg06598.html

Any ideas?

Cheers
Andi


Hi Andi,

I'm running a development version of matplotlib, and your code runs without issue. That doesn't really solve your issue, but it means that it's not due to deprecation.

On a hunch, I tried running the code with
>>> import matplotlib
>>> matplotlib.use('pdf')
at the top of the file, and I got the same error. Not really sure why, though. Do you happen to have the pdf backend set as the default?

-Tony


------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@...
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
Joe Kington | 22 Jan 23:58
Picon
Gravatar

"Data cursor" for matplotilb.widgets

I've recently been playing around with a widget intended to be similar to matlab's "data cursor".

Would this be useful for inclusion into matplotlib.widgets? 

https://gist.github.com/1659108

At the moment, it doesn't inherit from the base Widget class, but that's easily changed.

On the other hand, it doesn't fit the model of the rest of the widgets in that it takes a sequence (or single) artist, instead of an axes instance.

If folks think it would be useful, I can submit a pull request.

Thanks,
-Joe

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@...
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
Dejas Ninethousand | 5 Jan 18:20
Picon

matplotlib-1.1.0.win32-py2.7.exe crashes during install

Hi,


I downloaded matplotlib-1.1.0.win32-py2.7.exe and tried to run in on Windows 7.  During the install, just after clicking "Next" on the "Ready to install" screen the program freezes and I get a message saying "matplotlib-1.1.0.win32-py2.7.exe has stopped working".  

Please advise.

Thanks.
------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@...
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
Benjamin Root | 14 Jan 20:02
Picon
Favicon

imread() in master branch doesn't work

Tried using plt.imread() today on a PNG file, and I am getting this PyCXX error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/ben/Programs/matplotlib/lib/matplotlib/pyplot.py", line 1746, in imread
    return _imread(*args, **kwargs)
  File "/home/ben/Programs/matplotlib/lib/matplotlib/image.py", line 1218, in imread
    return handler(fd)
TypeError: PyCXX: Error creating object of type N2Py6ObjectE from (nil)

Using master branch on Python 2.7 on 32-bit Ubuntu Oneric.  Seems to happen to both color and b&w images.  scipy.ndimage.imread() still works fine, though.

Ben Root

------------------------------------------------------------------------------
RSA(R) Conference 2012
Mar 27 - Feb 2
Save $400 by Jan. 27
Register now!
http://p.sf.net/sfu/rsa-sfdev2dev2
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@...
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
Gellule Xg | 12 Jan 19:37
Picon
Favicon

Test invitation: activate figure windows for non-interactive macosx backend

If you are a macosx backend user, you are welcomed to test the following 
branch: https://github.com/gellule/matplotlib. With the branch, when 
issuing a pylab.show() in non-interactive mode, the plot windows should 
appear in the foreground with focus, instead of appearing in the 
background. It should make things a little easier for you.

I am also curious to know what people think of making pylab.show() also 
yield the focus to the plot windows in -interactive- mode? All the other 
commands update the plot windows automatically, keeping the focus in the 
python interpreter. So pylab.show() would only do that: yield the focus 
to the plot windows. That is not in the branch (yet).

Cheers,

-Gellule/Julien

------------------------------------------------------------------------------
RSA(R) Conference 2012
Mar 27 - Feb 2
Save $400 by Jan. 27
Register now!
http://p.sf.net/sfu/rsa-sfdev2dev2
Mike Kaufman | 12 Jan 01:30
Picon

should the ordering of clf() matter for AxesGrid?


Given the code snippet below with clf() #1 uncommented works like one 
would expect - both plots are drawn. If #1 is commented out and #2 is 
uncommented, then the figure is cleared and neither plot is drawn. Is 
this the correct behavior? It seems like a bug to me.

M

import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import AxesGrid

f = plt.figure(1)
plt.clf() #1
grid = AxesGrid(f, 111, (1,2))
#plt.clf()  #2
grid[0].plot(np.arange(10))
grid[1].plot(np.arange(10))
plt.draw()

------------------------------------------------------------------------------
RSA(R) Conference 2012
Mar 27 - Feb 2
Save $400 by Jan. 27
Register now!
http://p.sf.net/sfu/rsa-sfdev2dev2

Gmane