Re: [Matplotlib-users] Plotting style
On Wed, Mar 4, 2015 at 6:28 AM, Tony Yu wrote: > > > > On Tue, Mar 3, 2015 at 1:37 PM, Marin GILLES wrote: >> >> Le 03/03/2015 18:53, Thomas Caswell a écrit : >>> >>> 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). > > > >> >> Maybe a dumb question, but I'm quite new to this... >> Can this be integrated in mpl afterwards? Or does it needs to be a standalone package that you install on its own? >> If it can be integrated, how? >> Thanks >> Marin Gilles > > > Any stylesheet could easily be integrated afterwards, but the separate repo would allow faster releases, as Thomas suggests above, and also more experimentation. It would probably make sense to integrate just the cream of the crop from the style repo into Matplotlib-proper, but it'd still be easy to use the less popular ones. For example, you wouldn't even have to install the style repo---you can pass a url to `matplotlib.style.use`. > > The separate repo could also incorporate a default comparison page to quickly decide on the most appropriate stylesheet; e.g.: > > https://github.com/tonysyu/matplotlib-style-gallery > > -Tony > > Another advantage of a separate repo is that it would make it easier for multiple projects to participate. The process could be set up so that projects like seaborn, ggplot, and prettyplotlib could keep their stylesheets in the same project, and have the stylesheets project have a release whenever any project needs to update stylesheets. Using a "master is always stable" development model would make that easier. -- 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 [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] repeated GUI generation generates crash
Hi, I'm new to matplotlib, trying to migrate from Matlab, so please
excuse my rookie ignorance and Matlab thinking.
My question is: why does a GUI figure crash upon repeated calls in
IPython?
Here is a detailed description:
I'm using the Enthought Python Distribution (EPD_Py25) and I enter
IPython with the command: "ipython". I then run the script below
using: %run myScript.py. Everything works fine: when I press 'Enter'
while in the GUI the figure closes and I can retrieve the data from
obj.x. However, when I run the script again using %run myScript.py a
figure is generated but nothing happens; I am forced to reset
everything using pyplot.close('all'), but cannot regain the GUI
functionality without exiting IPython.
This problem does not occur if I use EPD's PyLab (i.e. "ipython -
pylab"). Does anyone know why?
Here is the script:
from numpy.random import rand
from matplotlib import pyplot
class myGUI:
def __init__(self,x):
self.fig = pyplot.gcf()
self.x = x
#initiate figure:
self.connect()
pyplot.plot(self.x)
pyplot.show()
def connect(self):
self.cidkeypress =
self.fig.canvas.mpl_connect('key_press_event', self.keypress)
def disconnect(self):
self.fig.canvas.mpl_disconnect(self.cidkeypress)
pyplot.close(self.fig)
def keypress(self,event):
if event.key == 'enter':
self.disconnect()
else:
self.x = rand(self.x.size)
pyplot.plot(self.x)
self.fig.canvas.draw()
pyplot.figure()
obj = myGUI(rand(10))
--
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, &
iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://www.creativitycat.com
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] repeated GUI generation generates crash
Chris, thank you very much for your reply. I encountered a related
error, and was hoping you could help me understand this one too...
Using ipython -pylab I run the script below to generate a GUI, but
when the GUI finishes running (after 3 button clicks), ipython crashes
with the following error message: "Segmentation fault". This error
does not occur if I remove the call to pyplot.close in
myGUI.disconnect, nor does it occur if I use a key_press_event instead
of a button_press_event.
Why is an error generated when I try to close the figure?
Why does this error occur for button_press_events but not
key_press_events?
from numpy.random import rand
from matplotlib import pyplot
class myGUI:
def __init__(self,x):
self.fig = pyplot.gcf()
self.n = 0
self.connect()
pyplot.plot(x)
pyplot.show()
def connect(self):
self.cidbuttonpress =
self.fig.canvas.mpl_connect('button_press_event', self.buttonpress)
def disconnect(self):
self.fig.canvas.mpl_disconnect(self.cidbuttonpress)
pyplot.close(self.fig)
def buttonpress(self,event):
self.n += 1
if self.n >=2:
self.disconnect()
pyplot.figure()
obj = myGUI(rand(10))
On 22 May 2009, at 00:49, Christopher Barker wrote:
Todd Pataky wrote:
> I'm using the Enthought Python Distribution (EPD_Py25) and I enter
> IPython with the command: "ipython".
> This problem does not occur if I use EPD's PyLab (i.e. "ipython -
> pylab"). Does anyone know why?
because the whole point of the "pylab" flag to ipython is to tell
ipython to start up the MPL plotting stuff in separate thread so that it
can work like you want it to. If you don't' use that flag, then each
call to pyplot tries to start up a new app, ,but the old one is still
running, hence you problems.
ipython itself can be used for all sort of things that have nothing to
do with matplotlib, so that's not its default behavior.
Just use ipython -pylab if you want to do interactive plotting, that's
what it's for.
-Chris
--
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, &
iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://www.creativitycat.com
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Matplotlib plugin for Qt Designer
I am interested in making a python GUI that includes an axis. Qt's python bindings offers most of the GUI elements I need, and Qt designer provides a great graphical design tool for making python user interfaces. However, I notice that matplotlib is not integrated with Qt Designer. Qt Designer allows other programs to integrate with it by using plugins. However, matplotlib does not ship a Qt Designer plugin. It seems that it is possible to use one, since python (x,y) has a matplotlib Qt Designer plugin, but that is windows and I am using Linux. Is there any chance that matplotlib could ship a Qt Designer plugin? -Todd -- Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ ___ Matplotlib-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] who (F/OSS science) uses matplotlib?
On Wed, Jun 6, 2012 at 8:01 AM, Guillaume Gay wrote: > Le 05/06/2012 16:25, Tom Dimiduk a écrit : >> Is any of this stuff I should be looking to upstream or split off into >> the start of a scientific imaging library for python? > Have you had a look at skimage https://github.com/scikits-image ? > > > BTW I uses matplotlib (and the whole pylab suite) in my projects for all > the visualisation. > A (peer reviewed published) example here: > https://github.com/Kinetochore-segregation > > Best > > Guillaume The Spyder (http://code.google.com/p/spyderlib/) python-based matlab clone uses matplotlib for plotting. Python(X,Y) (http://code.google.com/p/pythonxy/) is an integrated windows python release that includes a ton of science, engineering, and mathematics-oriented python packages, including matplotlib. Numpy uses small bits of matplotlib when building the documentation, but I don't know if that counts (I think it may even use it for building matplotlib-related parts of the documentation, in which case it really doesn't count). I know someone is working on a pure python backend for the Cantor advanced mathematics software (http://edu.kde.org/cantor/). The project only started recently, however (see http://blog.filipesaraiva.info/?p=779 ). There is also already a sage backend for Cantor, which of course uses matplotlib for plotting because that is what sage uses. -Todd -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Matplotlib-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] [matplotlib-devel] ANN: mpltools 0.1 release
On Wed, Jul 11, 2012 at 5:23 PM, John Hunter wrote: > > > On Wed, Jul 11, 2012 at 10:09 AM, Damon McDougall > wrote: >> >> Well, as Ben said, that error fill plot is neato! It doesn't look too >> complicated, either. I'd be more than happy to port it over later today >> when I get bored of typing up my thesis. It'll probably only take me >> about 30 minutes. >> >> If nobody is opposed to this idea, I'll go ahead and submit a PR this >> evening (British Summer (hah!) Time). > > > > While it is a nice graph, I am not sure that the use case is common enough > to justify a new plotting method. One can get the same result with: > > > In [68]: x = np.linspace(0, 2 * np.pi) > > In [69]: y_sin = np.sin(x) > > In [70]: err = np.concatenate([y_sin + 0.2, y_sin[::-1] - 0.2]) > > In [71]: plot(x, y_sin) > Out[71]: [] > > In [72]: fill_between(np.concatenate([x, x[::-1]]), err, facecolor='red', > alpha=0.5) > Out[72]: > > Admittedly the [::-1] thing is a bit counter-intuitive, but rather than > adding a new plotting method, perhaps we would be better off with a helper > method to create the xs and ys for fill_between > > xs, ys = mlab.pad_line(x, y, 0.2) > fill_between(xs, ys) > > JDH What about adding a property to the existing errorbar to let someone change it to the filled version? This could also, potentially, be extended with other types of error bars if the need arises. -Todd -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Matplotlib-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Evolution of the interface
On Mar 15, 2013 4:01 PM, "Christophe BAL" wrote:
>
> Hello,
> I really appreciate the work done by matplotlib but I really think that
> the interface must evolve. Here is a small example.
>
> object.set_something(...)
> object.get_something()
>
> It could be easier to use a jQuery like style as in the following lines.
>
> object(...)
> object()
>
> This will considerably simplify things.
>
>
> Here is a more realistic example.
>
> fig = pylab.figure()
> ax = fig.add_subplot(1,1,1)
>
> ax.set_xlabel("xLabel")
> ax.set_ylabel("yLabel")
>
> The a jQuery like style would be as in the following lines.
>
> fig = pylab.figure()
> ax = fig.add_subplot(1,1,1)
>
> ax(xlabel = "xLabel", ylabel = "yLabel")
>
> I don't know enough matplotlib to propose other examples
> but I really think that there is a lot of things that could make
> matplotlib much more Pythonicly easy to use.
>
> Christophe BAL
>
I don't personally like this approach. Python has very clear separation
between the initialization of methods, which acts like a function that
returns an instance, and the modification of existing instances, which uses
attributes. This syntax muddies the distinction, having something that
should behave like an instance instead behaving as a function.
Is there any precedence for using this sort of syntax in python? I have
not seen it anywhere else. You mention jQuery, but that is JavaScript not
python. As far as I have seen
--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] X11 Window information for plots
On X11 systems, windows generally provide information about themselves to the system. These include things like the window title, window class, window role, and window type. These allow window managers to properly handle the windows, and in some window managers (like KDE's kwin), lets you set rules for windows of certain types. As best as I can tell, by default matplotlib does not provide most of this information. It provides the window title and the window type, but it doesn't seem to provide the window class or the window role. These two properties, however, are exactly the properties someone would want to use when trying to set up rules for particular windows. This makes it impossible to set window-specific rules for the plots. Is there something in the matplotlib configuration that would let someone set these properties, and if not is there any way matplotlib could set them itself? I'm sorry if this is a common question. -Todd -- Protect Your Site and Customers from Malware Attacks Learn about various malware tactics and how to avoid them. Understand malware threats, the impact they can have on your business, and how you can protect your company and customers by using code signing. http://p.sf.net/sfu/oracle-sfdevnl ___ Matplotlib-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] X11 Window information for plots
Maybe, I am not that familiar with X11 programming. Do you happen to know which source files I should change? -Todd On Tue, Jan 18, 2011 at 8:39 AM, Michael Droettboom wrote: > You're right -- matplotlib doesn't set any of these attributes. Fixing > this problem would involve adding a few lines of code to set them in > each GUI backend (since each GUI toolkit, gtk, qt, tk etc. presumably > handles them differently). Is this something you'd be interested in > providing a patch for? > > Mike > > On 01/15/2011 03:06 PM, todd rme wrote: >> On X11 systems, windows generally provide information about themselves >> to the system. These include things like the window title, window >> class, window role, and window type. These allow window managers to >> properly handle the windows, and in some window managers (like KDE's >> kwin), lets you set rules for windows of certain types. >> >> As best as I can tell, by default matplotlib does not provide most of >> this information. It provides the window title and the window type, >> but it doesn't seem to provide the window class or the window role. >> These two properties, however, are exactly the properties someone >> would want to use when trying to set up rules for particular windows. >> This makes it impossible to set window-specific rules for the plots. >> >> Is there something in the matplotlib configuration that would let >> someone set these properties, and if not is there any way matplotlib >> could set them itself? >> >> I'm sorry if this is a common question. >> >> -Todd >> >> -- >> Protect Your Site and Customers from Malware Attacks >> Learn about various malware tactics and how to avoid them. Understand >> malware threats, the impact they can have on your business, and how you >> can protect your company and customers by using code signing. >> http://p.sf.net/sfu/oracle-sfdevnl >> ___ >> Matplotlib-users mailing list >> [email protected] >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > > -- > Protect Your Site and Customers from Malware Attacks > Learn about various malware tactics and how to avoid them. Understand > malware threats, the impact they can have on your business, and how you > can protect your company and customers by using code signing. > http://p.sf.net/sfu/oracle-sfdevnl > ___ > Matplotlib-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > -- Protect Your Site and Customers from Malware Attacks Learn about various malware tactics and how to avoid them. Understand malware threats, the impact they can have on your business, and how you can protect your company and customers by using code signing. http://p.sf.net/sfu/oracle-sfdevnl ___ Matplotlib-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] X11 Window information for plots
I think I've found it. But now I need to know what the values should be. I assume the application name should be "matplotlib" (no quotes, with no capitalization). What about the window role? I am think either "figure" or "plot" would be good, probably the former (once again without quotes and with no capitalization). Is that reasonable? It is easy to change later, although the change should be consistent across all backends. The other issue is whether I should use the same window role for all backends, or separate roles for each backend (such as "qt4 figure"). Does anyone have an opinion on this? -Todd On Tue, Jan 18, 2011 at 12:54 PM, todd rme wrote: > Maybe, I am not that familiar with X11 programming. Do you happen to > know which source files I should change? > > -Todd > > On Tue, Jan 18, 2011 at 8:39 AM, Michael Droettboom wrote: >> You're right -- matplotlib doesn't set any of these attributes. Fixing >> this problem would involve adding a few lines of code to set them in >> each GUI backend (since each GUI toolkit, gtk, qt, tk etc. presumably >> handles them differently). Is this something you'd be interested in >> providing a patch for? >> >> Mike >> >> On 01/15/2011 03:06 PM, todd rme wrote: >>> On X11 systems, windows generally provide information about themselves >>> to the system. These include things like the window title, window >>> class, window role, and window type. These allow window managers to >>> properly handle the windows, and in some window managers (like KDE's >>> kwin), lets you set rules for windows of certain types. >>> >>> As best as I can tell, by default matplotlib does not provide most of >>> this information. It provides the window title and the window type, >>> but it doesn't seem to provide the window class or the window role. >>> These two properties, however, are exactly the properties someone >>> would want to use when trying to set up rules for particular windows. >>> This makes it impossible to set window-specific rules for the plots. >>> >>> Is there something in the matplotlib configuration that would let >>> someone set these properties, and if not is there any way matplotlib >>> could set them itself? >>> >>> I'm sorry if this is a common question. >>> >>> -Todd >>> >>> -- >>> Protect Your Site and Customers from Malware Attacks >>> Learn about various malware tactics and how to avoid them. Understand >>> malware threats, the impact they can have on your business, and how you >>> can protect your company and customers by using code signing. >>> http://p.sf.net/sfu/oracle-sfdevnl >>> ___ >>> Matplotlib-users mailing list >>> [email protected] >>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> >> >> -- >> Protect Your Site and Customers from Malware Attacks >> Learn about various malware tactics and how to avoid them. Understand >> malware threats, the impact they can have on your business, and how you >> can protect your company and customers by using code signing. >> http://p.sf.net/sfu/oracle-sfdevnl >> ___ >> Matplotlib-users mailing list >> [email protected] >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> > -- Protect Your Site and Customers from Malware Attacks Learn about various malware tactics and how to avoid them. Understand malware threats, the impact they can have on your business, and how you can protect your company and customers by using code signing. http://p.sf.net/sfu/oracle-sfdevnl ___ Matplotlib-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] X11 Window information for plots
On Tue, Jan 18, 2011 at 8:58 PM, Benjamin Root wrote: > On Tuesday, January 18, 2011, todd rme wrote: >> I think I've found it. But now I need to know what the values should >> be. I assume the application name should be "matplotlib" (no quotes, >> with no capitalization). What about the window role? I am think >> either "figure" or "plot" would be good, probably the former (once >> again without quotes and with no capitalization). Is that reasonable? >> It is easy to change later, although the change should be consistent >> across all backends. >> >> The other issue is whether I should use the same window role for all >> backends, or separate roles for each backend (such as "qt4 figure"). >> Does anyone have an opinion on this? >> >> -Todd >> > > My guess is that they should all have the same name. Any given run of > matplotlib can only use one backend at a time. I don't see a value in > distinguishing the source of the figures. > > Ben Root That is what I thought as well. There are three properties to deal with. First the window class. This contains two strings. One is simply the application name. The other, however, is a class. I can't find a good explanation of what this is supposed to be. For Firefox, this is "Navigator" for the browser and "Places" for the bookmarks manager. For libreoffice writer, it is VCLSalFrame.DocumentWindow. The third is the window role. For the firefox browser, this is "browser". For the bookmark manager, it is "organizer". So as best as I can tell, the role is a general description of the sort of application it is, such as a web browser. For matplotlib, I think this should probably be "plot" or "graph" or something along those lines. The class, on the other hand, seems to be an application-specific description of what the role is within the application. I think this should probably be "figure". Does that sound reasonable? -Todd -- Protect Your Site and Customers from Malware Attacks Learn about various malware tactics and how to avoid them. Understand malware threats, the impact they can have on your business, and how you can protect your company and customers by using code signing. http://p.sf.net/sfu/oracle-sfdevnl ___ Matplotlib-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] X11 Window information for plots
On Wed, Jan 19, 2011 at 10:22 AM, Benjamin Root wrote: > > > On Wed, Jan 19, 2011 at 4:48 AM, Jochen Deibele > wrote: >> >> Hi! >> >> todd rme wrote on 19.01.2011 04:40: >> > The class, on the other hand, seems to be an application-specific >> > description of what the role is within the application. I think this >> > should probably be "figure". >> >> Just an idea: What about exposing this (or maybe all) of the values in >> the api to be set dynamically by the user? Of course providing a useful >> default value as well. >> >> The thought behind is that it's hard to guess in what context the user >> wants to use the figure. And perhaps the user has 21 plots of some type >> and one which is different and he wants to treat differently. >> But at the same time - you also could do this if you adjust the window >> title. >> >> Jochen >> > > I agree. If we are going to do this, we might as well do it right. Anybody > who isn't using this feature will not see a difference, but those who do > manage their windows with rules can benefit significantly from just having > sensible default values and from having the ability to explicitly set the > value. Therefore, this should probably be something that is added to the > rcParams and the user can specify a value by keyword argument to the Figure > __init__ method. > > Ben Root That is far outside the scope of my capabilities. I already have wx and gtk backends set up (although it needs to be tested) with hard-coded values, and qt4 half-working (and tested, this doesn't appear to be possible in qt). I can submit patches for that, and if someone else wants to make it configurable they can do so. I'll set it up to use variables that you can then do what you want with. -Todd -- Protect Your Site and Customers from Malware Attacks Learn about various malware tactics and how to avoid them. Understand malware threats, the impact they can have on your business, and how you can protect your company and customers by using code signing. http://p.sf.net/sfu/oracle-sfdevnl ___ Matplotlib-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] [SciPy-User] (no subject)
On Wed, Jan 19, 2011 at 10:16 AM, Benjamin Root wrote: > > > On Tue, Jan 18, 2011 at 5:32 PM, Alex Liberzon > wrote: >> >> Hi, >> >> While moving from Matlab to Numpy/Scipy/Matplotlib I need sometimes to >> work with Matlab figures. It would be nice if we could load Matlab figures >> in Python, extract the data and some basic parameters of how it was looking >> in Matlab and create its "clone" in matplotlib. At present the Matlab >> figures are MAT files and in the near future it will be HDF5, both formats >> are loadable. However, I have not found any reference for such attempts to >> load and parse the FIG files. As a beginner I find it difficult to write a >> large piece of code. However, if there are other interested users that can >> cooperate on such, I'd gladly contribute some hours for this task. >> Meanwhile, to show the proof-of-concept attempt is attached below. All your >> useful comments and suggestions are very welcome. >> >> Thank you, >> Alex >> > > Alex, > > That is very interesting. I was not aware that matlab's figure files were > simply .mat files in disguise. I would presume that it would be feasible to > produce some sort of importer in such a case (provided the documentation for > Matlab's figure format is complete enough). > > I am wary of making such a function a core feature of Matplotlib, however, > because it would require creating a dependency to the scipy.io package. > However, I could see it being a toolkit package like Basemap. > > Would you mind creating a feature request ticket at: > > http://sourceforge.net/tracker/?group_id=80706 > > If you include this example code, and maybe some links to some documentation > on matlab's figure files, maybe something can grow from that. > > Thanks! > Ben Root I agree, but for a slightly different reason. I think it would be great if it would be possible to incorporate viewing matlab figures into the rest of my system, so making it more isolated would help in this regard. -Todd -- Protect Your Site and Customers from Malware Attacks Learn about various malware tactics and how to avoid them. Understand malware threats, the impact they can have on your business, and how you can protect your company and customers by using code signing. http://p.sf.net/sfu/oracle-sfdevnl ___ Matplotlib-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Fonts not found
On Thu, Jan 20, 2011 at 2:09 PM, Uri Laserson wrote: > Hi all, > I recently reinstalled MPL from scratch on top of python2.7 that I built > from scratch using homebrew on OS X Snow Leopard. Since then, I have been > getting the following types of warnings whenever I plot something: > /Users/laserson/matplotlib/lib/python2.7/site-packages/matplotlib/font_manager.py:1242: > UserWarning: findfont: Font family ['sans-serif'] not found. Falling back to > Bitstream Vera Sans > (prop.get_family(), self.defaultFamily[fontext])) > Do I need to specify some configuration parameter to point somewhere that > the installer couldn't find? > Thanks! > Uri I had the same problem when I upgraded from python 2.6 to 2.7. For me, the issue turned out to be with my matplotlib font cache, which was stored in my matplotlib config directory. On linux it is in .matplotlib directory in the home directory, I am not sure if this is where it is on a mac. I deleted the fontList.cache file and the tex.cache directory stored there, and that fixed the problem. I am not sure you need to delete both of these, but since they were just caches I went ahead and did so. -Todd -- Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)! Finally, a world-class log management solution at an even better price-free! Download using promo code Free_Logger_4_Dev2Dev. Offer expires February 28th, so secure your free ArcSight Logger TODAY! http://p.sf.net/sfu/arcsight-sfd2d ___ Matplotlib-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Feature request: automatic scaling of subplots, margins, etc
On Wed, May 11, 2011 at 1:59 PM, Benjamin Root wrote: > > > On Wed, May 11, 2011 at 12:47 PM, Brendan Barnwell > wrote: >> One thing I've always wondered: is it fundamentally impossible to >> change the fact that, in matplotlib, you cannot know how big a drawn >> object will be until you actually draw it? When I was doing some >> animation stuff a while back this caused me a lot of headache, for the >> reasons Tony Yu mentioned: it means you have to draw everything >> multiple times. It would really help if it were possible to specify >> objects' parameters and get their sizes without drawing them. >> >> -- Brendan Barnwell >> "Do not follow where the path may lead. Go, instead, where there is no >> path, and leave a trail." --author unknown >> > > Most things, we do know the sizes of. It is my understanding that it is the > text objects that is the unknown. If this could be solved, then a layout > engine would be much more feasible. The problem is that even LaTeX has to > re-render things multiple times to get this right for an arbitrary font. If > we were to restrict ourselves to particular fonts and package those fonts > with matplotlib, then we could have an internal table of size information > for each glyph and compute it on the fly and lay everything out right. But, > that would cause us to give up significant benefits for another benefit. > > I think the pain of the bootstrapping/re-rendering approach could be reduced > significantly if we could get various aspects of matplotlib figure building > to be faster. Last time I checked, there is significant amount of > processing time spent in calculating the ticks for the axes. Maybe if we > focus some efforts in improving the efficiency of certain parts of > matplotlib, maybe we could introduce a convenience function like the one > earlier in this thread that some users can choose to use with only a slight > penalty in speed. I personally would not want to make it default, but > certainly would consider highly advertising such a function. > > Just my two cents, > Ben Root Perhaps there could be three options: 1. Manual mode: current behavior 2. Database mode: uses a list of known fonts. When a font not found in the database is used, it falls back to manual mode. 3. Automatic mode: uses a list of known fonts. When a font not found in the database is used, it renders the text alone in an invisible figure to calculate the space needed, then uses that information to set the margins. Alternatively, create a temporary mini font database just for the characters needed. The former approach may be faster, but the latter may be easier to program since it could share a lot of code with the database. There could also be a function to scan a particular font and add to the database (there would probably be a separate user database in your matplotlib configuration directory that this would use, as well as probably caching the measurements from text used in automatic mode for future versions of the figure). -Todd -- Achieve unprecedented app performance and reliability What every C/C++ and Fortran developer should know. Learn how Intel has extended the reach of its next-generation tools to help boost performance applications - inlcuding clusters. http://p.sf.net/sfu/intel-dev2devmay ___ Matplotlib-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Native file format
Perry Greenfield wrote: > On Feb 7, 2007, at 10:21 AM, John Hunter wrote: > > >> On 2/7/07, Edin Salkovic <[EMAIL PROTECTED]> wrote: >> >> >>> Why can't mpl's figures be pickled? >>> >> The main thing is we need to add pickle support for all of mpl's >> extension code >> >> http://docs.python.org/lib/node321.html >> >> In earlier attempts people got stuck with trying to pickle the >> CXX extension code, which was causing some problems, but these >> problems may be fixed in more recent versions of CXX. Todd Miller was >> the last person to look at this in some detail, I think. >> >> > I think Todd did get it to work, but I'll copy him on this just to make > sure. > I looked at this in the context of numarray session saving and restoring. In that context, I believed there was a general problem with extension types not being picklable as a matter of developer expediency: first order, pickling support often doesn't get done. So my approach was to fudge a little and create "proxy" objects for things which wouldn't pickle rather than "fix all extension types." Where I left off CXX still didn't support pickling but a Python session with matplotlib and numarray could be saved; numarray arrays would be preserved, matplotlib objects would be "proxied" but unfortunately the proxies don't work in that case. Todd >> Other hinderances may come from the GUI layer, since figures store >> pointers to their canvases which in some cases come from GUI extension >> code that may not support pickling. But we can fairly easy decouple >> the figure from the canvas at pickle time and deal with pure mpl, >> numpy and python objects. The main work is to add pickle >> serialization to the mpl extension code. >> >> -- >> --- >> Using Tomcat but need to do more? Need to support web services, >> security? >> Get stuff done quickly with pre-integrated technology to make your >> job easier. >> Download IBM WebSphere Application Server v.1.0.1 based on Apache >> Geronimo >> http://sel.as-us.falkag.net/sel? >> cmd=lnk&kid=120709&bid=263057&dat=121642 >> ___ >> Matplotlib-users mailing list >> [email protected] >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> > > > - > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier. > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > ___ > Matplotlib-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier. Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Matplotlib-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Problem installing latest matplotlib + numpy win32 binaries
Hello all, My apologies if this has been brought up and solved before, but I didn't see any solutions that made sense to me in the archives. Here is my stack: python 2.4 (from python.org) numpy-1.0rc3 matplotlib-0.87.6 Everything seems to install fine. When I attempt to do 'from pylab import *' I get the following error: RuntimeError: module compiled against version 102 of C-API but this version of numpy is 109 The import of the numpy version of the nxutils module, _nsnxutils, failed. This is is either because numpy was unavailable when matplotlib was compiled, because a dependency of _nsnxutils could not be satisfied, or because the build flag for this module was turned off in setup.py. If it appears that _nsnxutils was not built, make sure you have a working copy of numpy and then re-install matplotlib. Otherwise, the following traceback gives more details: Traceback (most recent call last): File "", line 1, in File "C:\Development\Python25\Lib\site-packages\pylab.py", line 1, in from matplotlib.pylab import * File "C:\Development\Python25\Lib\site-packages\matplotlib\pylab.py", line 199 , in import mlab #so I can override hist, psd, etc... File "C:\Development\Python25\Lib\site-packages\matplotlib\mlab.py", line 64, in import nxutils File "C:\Development\Python25\Lib\site-packages\matplotlib\nxutils.py", line 1 7, in from matplotlib._ns_nxutils import * ImportError: numpy.core.multiarray failed to import I saw an e-mail in the archive that had a similar error, but the solution was apparently to install scipy-0.51? I don't need or necessarily want scipy.. is there a reason the latest win32 binaries for matplotlib and numpy don't play together? Any help is appreciated. Thanks! - Todd -- Todd Page [EMAIL PROTECTED] - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Matplotlib-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Problem installing latest matplotlib + numpy win32 binaries
Thanks Eric, That confirms my suspicions. Does anyone know where I can get an rc2 binary for win32? I only see rc3 up on sourceforge. PS: I think my original e-mail got posted to the list twice... if that's the case I apologize for the (inadvertent) spam. On 10/22/06, Eric Firing <[EMAIL PROTECTED]> wrote: > Todd Page wrote: > > Hello all, > > > > My apologies if this has been brought up and solved before, but I > > didn't see any solutions that made sense to me in the archives. Here > > is my stack: > > python 2.4 (from python.org) > > numpy-1.0rc3 > > matplotlib-0.87.6 > > > > Everything seems to install fine. When I attempt to do 'from pylab > > import *' I get the following error: > > > > RuntimeError: module compiled against version 102 of C-API but this > > version > > of numpy is 109 > > If I remember correctly, mpl 0.87.6 is compiled against numpy-1.0.rc2, > but rc3 has since come out with a C-API change so that it will not work > with 0.87.6. So, give numpy-1.0.rc2 a try. numpy 1.0 is scheduled to > come out soon, and I expect that shortly thereafter there will be an mpl > release to match it. At that point the numpy C API should be genuinely > stable and it should no longer be necessary to keep future mpl and numpy > versions in lockstep. > > Eric > -- Todd Page [EMAIL PROTECTED] - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Matplotlib-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Problem installing latest matplotlib + numpy win32 binaries
Hey all, Just in case there are people out there in the same boat as me; I found a solution. Eric pointed out that the latest matplotlib only supported numpy rc2, but they were only listing rc3 on sourceforge. Turns out you can click the rc3 download link, then just change the file name... downloads, installs & jives with matplotlib perfectly! -- Todd Page [EMAIL PROTECTED] - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Matplotlib-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Help with imshow on Mac OS X 10.6 Snow Leopoard
Greetings,
I just installed Python 2.6 (python.org), Numpy 1.4.1, and Matplotlib
0.99.1.2 all on Mac OS X 10.6 in an attempt to learn about scientific
programming in python. Go easy on me since I am a begginer. The Python and
Numpy seem to be working correctly. I can get matplotlib to make plots but
I can't get it to show images. I tried the stinkbug example in
the Matplotlib users guide documentation with no success. Errors are _NOT_
generated but neither are any results on the screen. The imread command
produces a float32 matrix that contains all 1. values so I tried creating my
own uint8 matrix with a diagnoal line. My code is below. Thanks for any
help you can provide.
# -*- coding: utf-8 -*-
from numpy import *
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
print "Numpy version: " + __version__
a = array([10,20,30,40])
print "result of a"
print a
b = arange(4)
print "result of b"
print b
c = linspace(-pi, pi, 30)
print "result of c"
print c
# this plot code works
print "plot c"
plt.plot(c)
plt.ylabel("-pi to + pi")
plt.xlabel("value of c")
plt.show()
# this image processing code does not work
print "doing image processing stuff"
# img=mpimg.imread("/Users/rovitotv/Desktop/stinkbug.png") # this does not
work
img = zeros((10, 10), dtype=uint8)
for i in range(10):
img[i,i] = 255;
plt.imshow(img)
print "data type of img:"
print img.dtype
print "size of img:" + str(img.size)
print img
--
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit. See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Help with imshow on Mac OS X 10.6 Snow Leopoard
Ben,
That worked great, thanks!!! Just a few points. The documentation under
the image tutorial section does not specify that a user has to do
"plt.show()", should I submit a bug report or something? I changed my code
and listed it below it works as long as I comment out the plot c section.
In other words if I perform a normal 2d plot then close plot window the
image plot does not product a result. If I comment out the plot c section
then the image plot works great. Any ideas?
Even the stink bug example is working when I read a image from disk.
Thanks.
# -*- coding: utf-8 -*-
from numpy import *
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
print "Numpy version: " + __version__
a = array([10,20,30,40])
print "result of a"
print a
b = arange(4)
print "result of b"
print b
c = linspace(-pi, pi, 30)
print "result of c"
print c
# this plot code works
print "plot c"
plt.plot(c)
plt.ylabel("-pi to + pi")
plt.xlabel("value of c")
plt.show()
# this image processing code does not work
print "doing image processing stuff"
img=mpimg.imread("/Users/rovitotv/Desktop/stinkbug.png") # this does not
work
##img = zeros((10, 10), dtype=uint8)
##for i in range(10):
##img[i,i] = 255;
plt.imshow(img)
plt.show()
print "data type of img:"
print img.dtype
print "size of img:" + str(img.size)
print img
On Mon, Jun 7, 2010 at 10:04 AM, Benjamin Root wrote:
> Todd,
>
> I think you are missing a "plt.show()" at the end of your code.
> matplotlib, by default on most systems, does not show a plot until you tell
> it to using plt.show() command.
>
> See if that works,
> Ben Root
>
> On Mon, Jun 7, 2010 at 7:57 AM, Todd V Rovito wrote:
>
>> Greetings,
>> I just installed Python 2.6 (python.org), Numpy 1.4.1, and Matplotlib
>> 0.99.1.2 all on Mac OS X 10.6 in an attempt to learn about scientific
>> programming in python. Go easy on me since I am a begginer. The Python and
>> Numpy seem to be working correctly. I can get matplotlib to make plots but
>> I can't get it to show images. I tried the stinkbug example in
>> the Matplotlib users guide documentation with no success. Errors are _NOT_
>> generated but neither are any results on the screen. The imread command
>> produces a float32 matrix that contains all 1. values so I tried creating my
>> own uint8 matrix with a diagnoal line. My code is below. Thanks for any
>> help you can provide.
>>
>>
>>
>> # -*- coding: utf-8 -*-
>> from numpy import *
>> import matplotlib.pyplot as plt
>> import matplotlib.image as mpimg
>>
>> print "Numpy version: " + __version__
>> a = array([10,20,30,40])
>> print "result of a"
>> print a
>>
>> b = arange(4)
>> print "result of b"
>> print b
>>
>> c = linspace(-pi, pi, 30)
>> print "result of c"
>> print c
>>
>> # this plot code works
>> print "plot c"
>> plt.plot(c)
>> plt.ylabel("-pi to + pi")
>> plt.xlabel("value of c")
>> plt.show()
>>
>> # this image processing code does not work
>> print "doing image processing stuff"
>> # img=mpimg.imread("/Users/rovitotv/Desktop/stinkbug.png") # this does not
>> work
>> img = zeros((10, 10), dtype=uint8)
>> for i in range(10):
>> img[i,i] = 255;
>>
>> plt.imshow(img)
>> print "data type of img:"
>> print img.dtype
>> print "size of img:" + str(img.size)
>> print img
>>
>>
>>
>>
>> --
>> ThinkGeek and WIRED's GeekDad team up for the Ultimate
>> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
>> lucky parental unit. See the prize list and enter to win:
>> http://p.sf.net/sfu/thinkgeek-promo
>> ___
>> Matplotlib-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>>
>
>
> --
> ThinkGeek and WIRED's GeekDad team up for the Ultimate
> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
> lucky parental unit. See the prize list and enter to win:
> http://p.sf.net/sfu/thinkgeek-promo
> ___
> Matplotlib-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
--
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit. See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
