[Matplotlib-users] legend--plot obj association
Hi everyone, Given a legend [1], I'm trying to figure out which plot objects it references. Is this possible at all? The reverse would also be fine, i.e., given a plot object (e.g., a line), find the legend(s) in which it is referenced. Cheers, Nico [1] http://matplotlib.org/api/legend_api.html -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] get_facecolor() returns 4-tuple, contains RGB values?
> "RGB and RGBA are sequences of, respectively, 3 or 4 floats in the range 0-1." That would explain it. It also seems that I never ever will have to worry about CMYK values as they don't seem to be used anywhere in matplotlib as a search on the website for "cmyk" suggests. --Nico On Tue, Dec 13, 2011 at 10:19 PM, Vlastimil Brom wrote: > 2011/12/13 Nico Schlömer : >> Hi, >> >> upon extracting the face color of a matplotlib.path.Path object, >> >> fc = obj.get_facecolor() >> >> I always seem to get an array of length 4. This initially led me to >> believe I'm dealing with CMYK values, but it really seems like the >> last entry is *always* 1.0 and the first three give the RGB >> representation of the respective color. >> Is there any documentation on color codes usage in matplotlib? >> >> Cheers, >> Nico >>... > > Hi, > maybe: > http://matplotlib.sourceforge.net/api/colors_api.html#module-matplotlib.colors > > "RGB and RGBA are sequences of, respectively, 3 or 4 floats in the range 0-1." > > hth, > vbr > > -- > Systems Optimization Self Assessment > Improve efficiency and utilization of IT resources. Drive out cost and > improve service delivery. Take 5 minutes to use this Systems Optimization > Self Assessment. http://www.accelacomm.com/jaw/sdnl/114/51450054/ > ___ > Matplotlib-users mailing list > Matplotlib-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Systems Optimization Self Assessment Improve efficiency and utilization of IT resources. Drive out cost and improve service delivery. Take 5 minutes to use this Systems Optimization Self Assessment. http://www.accelacomm.com/jaw/sdnl/114/51450054/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] get_facecolor() returns 4-tuple, contains RGB values?
Hi, upon extracting the face color of a matplotlib.path.Path object, fc = obj.get_facecolor() I always seem to get an array of length 4. This initially led me to believe I'm dealing with CMYK values, but it really seems like the last entry is *always* 1.0 and the first three give the RGB representation of the respective color. Is there any documentation on color codes usage in matplotlib? Cheers, Nico -- Systems Optimization Self Assessment Improve efficiency and utilization of IT resources. Drive out cost and improve service delivery. Take 5 minutes to use this Systems Optimization Self Assessment. http://www.accelacomm.com/jaw/sdnl/114/51450054/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] contourf: matplotlib.path.Path are LINETOs?
Hi all, when drawing contourf plots, I inspected the underlying matplotlib.path.Path elements that determine the curves and noticed that they are all of code LINETO (see http://matplotlib.sourceforge.net/api/path_api.html#matplotlib.path.Path) although the number of vertices is 6, actually suggesting a CURVE4. Would that be a bug? Cheers, Nico -- Systems Optimization Self Assessment Improve efficiency and utilization of IT resources. Drive out cost and improve service delivery. Take 5 minutes to use this Systems Optimization Self Assessment. http://www.accelacomm.com/jaw/sdnl/114/51450054/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] mplot3d, set_aspect('equal') doesn't work
Also, set_{x,y,z}lim3d() doesn't seem to influence the plot at all. ? --Nico On Mon, Jul 4, 2011 at 6:54 PM, Nico Schlömer wrote: > Hi all, > > this issue has come up before (see > http://www.mail-archive.com/matplotlib-users@lists.sourceforge.net/msg14255.html) > and now it was me who got bitten by it: As far as I can see, for > mplot3d axes, it is not possible to set the aspect ratio of the axes > to something other than 'auto' -- anyways, 'equal' does *not* make > sure that the units of lenght on all axes are the same. > > For me, this functionality is important as I would like to highlight > that certain angles are right angles which obviously isn't the case if > the illustrations are distorted in that way. > > Cheers, > Nico > -- All of the data generated in your IT infrastructure is seriously valuable. Why? It contains a definitive record of application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-d2d-c2 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] mplot3d, set_aspect('equal') doesn't work
Hi all, this issue has come up before (see http://www.mail-archive.com/matplotlib-users@lists.sourceforge.net/msg14255.html) and now it was me who got bitten by it: As far as I can see, for mplot3d axes, it is not possible to set the aspect ratio of the axes to something other than 'auto' -- anyways, 'equal' does *not* make sure that the units of lenght on all axes are the same. For me, this functionality is important as I would like to highlight that certain angles are right angles which obviously isn't the case if the illustrations are distorted in that way. Cheers, Nico -- All of the data generated in your IT infrastructure is seriously valuable. Why? It contains a definitive record of application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-d2d-c2 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] get_axis_off()?
Hi all, given an axes object, is there any way of telling whether set_axis_off() has been called on this object? Cheers, Nico -- Xperia(TM) PLAY It's a major breakthrough. An authentic gaming smartphone on the nation's most reliable network. And it wants your games. http://p.sf.net/sfu/verizon-sfdev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] get_tick{label}s: are tick labels drawn?
I just noticed something else now: When tick labels are explicitly supplied, that may not actually reflect in the return result of get_ticks. Specifically, I set the tick labels in a color bar, but get_ticklabels() returns a list of empty text objects Text(0,0,''). For regular axes, that seems to work better. Bug? Cheers, Nico On Sat, May 8, 2010 at 10:36 AM, Nico Schlömer wrote: > Hi, > > say, is there a way to query an axis object whether or not the tick > labels are drawn? > > I looked at -- one the x-axis -- get_xticks( and get_xticklabels() > which in two different situations would spit out a list of doubles > (the tick positions) and a list of text entries of the form > Text(0,0,''). In one plot, though, the tick labels are drawn, not in > the other one. > > Cheers, > Nico > -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] get_tick{label}s: are tick labels drawn?
Hi, say, is there a way to query an axis object whether or not the tick labels are drawn? I looked at -- one the x-axis -- get_xticks( and get_xticklabels() which in two different situations would spit out a list of doubles (the tick positions) and a list of text entries of the form Text(0,0,''). In one plot, though, the tick labels are drawn, not in the other one. Cheers, Nico -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] get_*gridlines alwys returns the same things?
> If there is a substantial need to read the grid state, we could expose > it via a suitable API at the Axis level. But is this important? Well, I'm using this for the matplotlib2tikz converter <http://github.com/nicki/matplotlib2tikz> which takes a matplotlib figure and spits out TikZ code. TikZ knows "{x,y}{major,minor}grid={on,off}", so I'd like to read this from the plot. For now, I can live with gca().xaxis._gridOnMajor as JJ proposed, but I guess I can't rely on this forever. --Nico On Wed, May 5, 2010 at 9:36 PM, Eric Firing wrote: > On 05/05/2010 08:46 AM, Chloe Lewis wrote: >> I got curious and looked for the grid command in matplotlib/axes.py. >> Looks like an inherited-from-Matlab thing. In the cla (clear axis) >> function of the Axes class: >> >> self._gridOn = rcParams['axes.grid'] >> #... >> self.grid(self._gridOn) >> >> and grid() passes its argument on to the xaxis.grid and yaxis.grid. >> >> I haven't found the code that checks any of those settings to decide >> whether the gridline objects are to be drawn or not (??) but I think >> we can rule out Harry Potter. Not magic: adaptation. (Or, if you will, >> not mystification: legacy code.) > > Exactly. > > The decision on whether to draw the gridlines is made in the draw() > method of each Tick object; even if the gridlines exist, they may not be > drawn. > There is no API for retrieving the grid state, and the grid() API, both > at the Axes and the Axis level, is a bit complicated. Although you > can't retrieve the grid state (except by reading private attributes), > you can set the grid to a known state, and you can toggle the state. > > If there is a substantial need to read the grid state, we could expose > it via a suitable API at the Axis level. But is this important? > > Eric > >> >> &C >> >> >> On May 4, 2010, at 3:27 PM, Nico Schlömer wrote: >> >>> This is weird: >>> >>> When plotting something very simple, e.g., >>> >>> t = arange( 0.0, 2.0, 0.01 ) >>> s = sin( 2*pi*t ) >>> plot( t, s, ":" ) >>> >>> I thought I can check weather the grid is on or off by >>> >>> gca().get_xgridlines() >>> >>> -- but this *always* returns >>> >>> >>> >>> with *always* the same lines >>> >>> Line2D((0,0),(0,1)) >>> Line2D((0,0),(0,1)) >>> Line2D((0,0),(0,1)) >>> Line2D((0,0),(0,1)) >>> Line2D((0,0),(0,1)) >>> >>> That's really independent of whether the grid is on or off. >>> >>> Is there any explanation for it that does not have to do with Harry >>> Potter or the Jedi? ;) >>> >>> --Nico >>> >>> -- >>> ___ >>> 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 > -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] get_*gridlines alwys returns the same things?
This is weird: When plotting something very simple, e.g., t = arange( 0.0, 2.0, 0.01 ) s = sin( 2*pi*t ) plot( t, s, ":" ) I thought I can check weather the grid is on or off by gca().get_xgridlines() -- but this *always* returns with *always* the same lines Line2D((0,0),(0,1)) Line2D((0,0),(0,1)) Line2D((0,0),(0,1)) Line2D((0,0),(0,1)) Line2D((0,0),(0,1)) That's really independent of whether the grid is on or off. Is there any explanation for it that does not have to do with Harry Potter or the Jedi? ;) --Nico -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] text annotations encircled?
Hi all, is there any way to encircle a text annotation? Looking at http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.annotate suggests tinkering with bbox I guess, but I haven't had any success with it. Hints? Cheers, Nico -- Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] arrows in contour lines?
Hi all, I'd like to make a countour plot just like in http://matplotlib.sourceforge.net/examples/pylab_examples/contour_demo.html but instead of text at the contour lines I'd like to have arrows in the in the direction of the contour lines. Does anyone know if that's possible. Cheers, Nico -- Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] TikZ/PGF backend
Well, I spend some time now setting up a framework for exporting matplotlib generated figures to TikZ code. You can find it on http://github.com/nicki/matplotlib2tikz The workflow is essentially that you generate your plot (dont show()), and then call matplotlib2tikz("myfile.tikz"); using a proper back-end has been considered not useful (b/c the information that the back-ends can access purely contain geometric information, and not semantic info such as "this color bar belongs to plot such-and-such"). What the script can do now, essentially, is line plots, images, color bars. Adding more functionality should not be too difficult and is basically just a matter of actually doing it. If you're interested in helping out then I'd think now is the time as the script is a mere 350 lines long now; just poke me on github. Cheers, Nico -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] identification of color bars
Works pretty well. I've now implemented something like == *snip* == def find_associated_colorbar( obj ): for child in obj.get_children(): try: cbar = child.colorbar except AttributeError: continue if not cbar == None: # really necessary? # if fetch was successful, cbar contains # ( reference to colorbar, reference to axis containing colorbar ) return cbar[0] return None == *snip* == How did you find out about the colormap attribute? Was that by taking a good guess in looking at the source code, or are the public attributes of a class documented? Cheers, Nico On Tue, Feb 16, 2010 at 1:18 PM, Jae-Joon Lee wrote: > set_colorbar sets colorbar attribute. So I guess you can just check if > Mappable.colorbar is None or not. > Mappable.colorbar, when set, should be a tuple whose first item is an > image for colorbar and the second item is an colorbar axes. > > Regards, > > -JJ > > On Tue, Feb 16, 2010 at 5:26 AM, Nico Schlömer > wrote: >> Alright, so I dug the sources a bit and found the snippet >> >> == *snip* == >> cb = cbar.Colorbar(cax, mappable, **kw) >> >> def on_changed(m): >> #print 'calling on changed', m.get_cmap().name >> cb.set_cmap(m.get_cmap()) >> cb.set_clim(m.get_clim()) >> cb.update_bruteforce(m) >> >> self.cbid = mappable.callbacksSM.connect('changed', on_changed) >> mappable.set_colorbar(cb, cax) >> == *snap* == >> >> I guess what happens is that a Colorbar is created, and a callback >> function registered which adapts this very color bar whenever there is >> a change in color maps/limits. >> Well. -- I reckon that means that at the moment there's no way to tell >> if a ScalarMappable has a color bar associated or not. :/ -- At least >> I don't see how it would be possible to dig up on_changed( ) from the >> list of callbacks and extract cb from it. >> >> Aaand everybody: "Fea-ture request, fea-ture request!" >> get_colorbar() for ScalarMappables :) >> >> Cheers, >> Nico >> >> >> >> >> On Mon, Feb 15, 2010 at 7:58 PM, Nico Schlömer >> wrote: >>>> As far as I can see, it is the other way around, i.e., mappables >>>> (e.g., images) know about the colorbar they are connected. >>> >>> Well yeah, that'd be even better. I'll check out the API. -- Hints >>> would still be appreciated of course. >>> >>> --Nico >>> >> > -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] identification of color bars
Alright, so I dug the sources a bit and found the snippet == *snip* == cb = cbar.Colorbar(cax, mappable, **kw) def on_changed(m): #print 'calling on changed', m.get_cmap().name cb.set_cmap(m.get_cmap()) cb.set_clim(m.get_clim()) cb.update_bruteforce(m) self.cbid = mappable.callbacksSM.connect('changed', on_changed) mappable.set_colorbar(cb, cax) == *snap* == I guess what happens is that a Colorbar is created, and a callback function registered which adapts this very color bar whenever there is a change in color maps/limits. Well. -- I reckon that means that at the moment there's no way to tell if a ScalarMappable has a color bar associated or not. :/ -- At least I don't see how it would be possible to dig up on_changed( ) from the list of callbacks and extract cb from it. Aaand everybody: "Fea-ture request, fea-ture request!" get_colorbar() for ScalarMappables :) Cheers, Nico On Mon, Feb 15, 2010 at 7:58 PM, Nico Schlömer wrote: >> As far as I can see, it is the other way around, i.e., mappables >> (e.g., images) know about the colorbar they are connected. > > Well yeah, that'd be even better. I'll check out the API. -- Hints > would still be appreciated of course. > > --Nico > -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] identification of color bars
> As far as I can see, it is the other way around, i.e., mappables > (e.g., images) know about the colorbar they are connected. Well yeah, that'd be even better. I'll check out the API. -- Hints would still be appreciated of course. --Nico -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] identification of color bars
Well, it's related to the TikZ converter I'm writing. After having created the plot, the script is of course totally oblivious to what exact commands were used. I was thinking that there is still some sort of bond between the color bar and its parent plot after their creation, e.g., for when the color map of the main plot is changed. -- Is that not the case? --Nico On Mon, Feb 15, 2010 at 6:16 PM, Jae-Joon Lee wrote: > Is there any reason that you need to find out which axes is a color > bar axes from the list of axes? Can you just keep references to > colorbars you create? > > cbar = colorbar() > cax = cbar.ax > > cax is the axes instance of the colobar you just created. > > Regards, > > -JJ > > > On Mon, Feb 15, 2010 at 12:04 PM, Nico Schlömer > wrote: >> Hi, >> >> when plotting a color bar with a plot in matplotlib, the color bar >> gets treated internally as Axes. >> >> With two main plots, each of which comes with a color bar, one structurally >> gets >> >> >> >> >> >> >> >> (that is, a Figure has for childres Axes). To find out which one of >> those is a color bar, I basically inspect their children an look for >> Arrays with shape (256,), which is what color bars look like. That's >> ugly of course, but it kind of works(tm). :) >> >> I'm having problems, though, with associating color bars with the >> specific plot. Can I rely on the rule that an Axes -- if it has a >> color bar --, is immediately followed by the corresponding (color bar) >> Axes environment? Are there any other properties I could check to >> identify color bars? (Tried get_label to no avail.) >> >> Cheers, >> Nico >> >> -- >> SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, >> Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW >> http://p.sf.net/sfu/solaris-dev2dev >> ___ >> Matplotlib-users mailing list >> Matplotlib-users@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> > -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] identification of color bars
Hi, when plotting a color bar with a plot in matplotlib, the color bar gets treated internally as Axes. With two main plots, each of which comes with a color bar, one structurally gets (that is, a Figure has for childres Axes). To find out which one of those is a color bar, I basically inspect their children an look for Arrays with shape (256,), which is what color bars look like. That's ugly of course, but it kind of works(tm). :) I'm having problems, though, with associating color bars with the specific plot. Can I rely on the rule that an Axes -- if it has a color bar --, is immediately followed by the corresponding (color bar) Axes environment? Are there any other properties I could check to identify color bars? (Tried get_label to no avail.) Cheers, Nico -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] tick labels in colorbar?
> cb.ax.set_yticklabels((r'$-\pi$', '0', r'$\pi$')) Works like a charm. Thanks! --Nico -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] save image from array?
Hi, I see that with imsave() it's possible to save an image based on its cmap. Is there also functionality in matplotlib to to store a file based on RGB(alpha) information? Cheers, Nico -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] tick labels in colorbar?
Hi, thanks for the suggestion. > ax.set_xticks((-pi,pi)) > ax.set_xticklabels(('$-\pi$','$\pi$')) I guess color bars are a little special in the sense that AttributeError: Colorbar instance has no attribute 'set_yticklabels' The tick positions are given not by set_yticks either, but as an option pylab.colorbar(ticks=(-pi,0,pi)) at the instatiation of the bar. It would indeed be very handy if the bars acted like axes. Cheers, Nico -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] tick labels in colorbar?
Hi, I'm plotting a colorbar with pylab.colorbar(ticks=(-pi,0,pi)) and trying to add proper "\pi" labels to it. Couldn't find out how to do that from the manual -- any hints here? Cheers, Nico -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Can't get interative to work
> I'm not sure, but one reason could be different backends. What kind of backend > are you using on the 2 machines? It was indeed a backend issue, fixed now. Thanks! --Nico -- Throughout its 18-year history, RSA Conference consistently attracts the world's best and brightest in the field, creating opportunities for Conference attendees to learn about information security's most important issues through interactions with peers, luminaries and emerging and established companies. http://p.sf.net/sfu/rsaconf-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Can't get interative to work
Hi, somehow I don't manage to set up matplotlib such that I can draw animations. I've been using the moving sin example from http://www.scipy.org/Cookbook/Matplotlib/Animations which spits out nicely moving sin-waves on one machine, but does nothing on the other. I'm puzzled. Checked pylab.isinteractive() which is TRUE. Any hints? Cheers, Nico -- Throughout its 18-year history, RSA Conference consistently attracts the world's best and brightest in the field, creating opportunities for Conference attendees to learn about information security's most important issues through interactions with peers, luminaries and emerging and established companies. http://p.sf.net/sfu/rsaconf-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] newbie question: type check?
> So what is it you're trying to accomplish? Maybe there is a better way. Well, I'm recursively iterating through the children of all objects, starting at gcf() (and then picking up gca(), lines, axes, everything that belongs to the plot), which is then parsed and a TikZ file is spit out. I need the type-checking exactly when I loop through the children of an object to be able to say "Now we have an axes object, plot axes.". I'm a total Python noob, so my first attempts at an implementation is likely quite shabby: http://win.ua.ac.be/~nschloe/other/websvn/filedetails.php?repname=matplotlib2tikz&path=%2Ftrunk%2Fmatplotlib2tikz.py You'll find handle_children() towards the bottom of the file. Would the type-checking as applied in there be something sensitive to do? Also, of course, hints of *all kinds very much appreciated! Cheers, Nico -- This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] newbie question: type check?
Well, I guess that's good enough for me. :) It's a bit unfortunate that the type() function wouldn't spit out this information, though. When for example iterating through the output of get_children() (iterating through a list of objects of unknown classes that is), would there be any other way (function, method?) to get more info on the matplotlib object? Cheers, Nico On Tue, Jan 12, 2010 at 12:01 PM, Matthias Michler wrote: > Hi Nico, > > I'm sorry I cannot help you, but at least I'd like to share my findings with > you: I find the following statements to be true: > isinstance(gca(), matplotlib.axes.SubplotBase) > isinstance(gca(), matplotlib.axes.Subplot) > isinstance(gca(), matplotlib.axes.Axes) > but there is no class 'AxesSubplot' in matplotlib.axes. I think this class is > somehow dynamically generated from Axes and Subplot, but I have no idea how > this works. > > Kind regards, > Matthias > > On Tuesday 12 January 2010 11:40:21 Nico Schlömer wrote: >> Hm. >> >> print type( gca() ) >> print gca().__class__ >> print isinstance( gca(), matplotlib.axes.AxesSubplots) >> >> yields >> >> >> >> Traceback (most recent call last): >> File "./testfunctions.py", line 13, in >> print isinstance( a, matplotlib.axes.AxesSubplots) >> AttributeError: 'module' object has no attribute 'AxesSubplots >> >> ?Nico >> >> On Tue, Jan 12, 2010 at 6:45 AM, Joshua J. Kugler > wrote: >> > On Monday 11 January 2010, Nico Schlömer elucidated thus: >> >> quick question from a Python noob: >> >> Suppose I have an instance of an object of matplotlib, Is there any >> >> way to check on its type, e.g., whether it is an instance of >> >> matplotlib.axes.AxesSubplots? >> > >> > Python's built-in 'isintance.' >> > >> > isinstance(var, matplotlib.axes.AxesSubplots) >> > >> > j >> > >> > -- >> > Joshua Kugler >> > Part-Time System Admin/Programmer >> > http://www.eeinternet.com >> > PGP Key: http://pgp.mit.edu/ ID 0x14EA086E > > > -- > This SF.Net email is sponsored by the Verizon Developer Community > Take advantage of Verizon's best-in-class app development support > A streamlined, 14 day to market process makes app distribution fast and easy > Join now and get one step closer to millions of Verizon customers > http://p.sf.net/sfu/verizon-dev2dev > ___ > Matplotlib-users mailing list > Matplotlib-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > -- This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] newbie question: type check?
Hm. print type( gca() ) print gca().__class__ print isinstance( gca(), matplotlib.axes.AxesSubplots) yields Traceback (most recent call last): File "./testfunctions.py", line 13, in print isinstance( a, matplotlib.axes.AxesSubplots) AttributeError: 'module' object has no attribute 'AxesSubplots ?Nico On Tue, Jan 12, 2010 at 6:45 AM, Joshua J. Kugler wrote: > On Monday 11 January 2010, Nico Schlömer elucidated thus: >> quick question from a Python noob: >> Suppose I have an instance of an object of matplotlib, Is there any >> way to check on its type, e.g., whether it is an instance of >> matplotlib.axes.AxesSubplots? > > Python's built-in 'isintance.' > > isinstance(var, matplotlib.axes.AxesSubplots) > > j > > -- > Joshua Kugler > Part-Time System Admin/Programmer > http://www.eeinternet.com > PGP Key: http://pgp.mit.edu/ ID 0x14EA086E > -- This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] newbie question: type check?
Hi, quick question from a Python noob: Suppose I have an instance of an object of matplotlib, Is there any way to check on its type, e.g., whether it is an instance of matplotlib.axes.AxesSubplots? Cheers! Nico -- This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users