From gallard at digimicro.ca Fri Apr 1 14:57:06 2016 From: gallard at digimicro.ca (Gilles Allard) Date: Fri, 01 Apr 2016 14:57:06 -0400 Subject: [Matplotlib-users] Lines2D documentation Message-ID: <4594129.CV6ZTEAu7D@local4.local> It seems there is a problem in 1.5.1 documentation of Lines2D. Documentatiuon mention a "visible" attribute but it do not exist. The class contain get_visible() and set_visible() but they are not documented. I hope this is the appropriate place to report documentation errors. From ayush.kesarwani at gmail.com Sat Apr 2 12:16:11 2016 From: ayush.kesarwani at gmail.com (Ayush Kesarwani) Date: Sat, 2 Apr 2016 21:46:11 +0530 Subject: [Matplotlib-users] Call for Proposals || PyCon India 2016 Message-ID: Hello Everyone The Call for Proposals (CFP) for PyCon India 2016, New Delhi are live now. We have started accepting proposals. Those interested to submit a proposal for a talk/proposal should submit the same at the given link [1]. More information about the event is present at the official website [2]. Kindly adhere to the guidelines mentioned for the submission of proposals. Please help us spread the word. Kindly use #inpycon in your social updates. Any queries regarding the CFP could be sent to contact at in.pycon.org . Regards Team InPycon [1] bit.ly/inpycon2016cfp [2] http://bit.ly/inpycon2016 -------------- next part -------------- An HTML attachment was scrubbed... URL: From antony.lee at berkeley.edu Mon Apr 4 10:14:18 2016 From: antony.lee at berkeley.edu (Antony Lee) Date: Mon, 4 Apr 2016 07:14:18 -0700 Subject: [Matplotlib-users] Circular panning Message-ID: Hi, I'm looking for a way to have interactive "circular panning": when interactively moving the axes to the left or the right, I want the data (and axes labels) to "wrap around". (An (silly) example application would be e.g. plotting annual average temperatures, and wanting to look at whether anything special is happening around New Year.) Is there a simple way to achieve this? Thanks, Antony -------------- next part -------------- An HTML attachment was scrubbed... URL: From pierre.haessig at crans.org Wed Apr 6 08:25:23 2016 From: pierre.haessig at crans.org (Pierre Haessig) Date: Wed, 6 Apr 2016 14:25:23 +0200 Subject: [Matplotlib-users] redefining color keywords in stylesheets Message-ID: <57050033.5050301@crans.org> Hello, I've a question about style sheets: /W//ould it be possible for stylesheets to redefine the colorkeywords ('r','g','b'...) to match their color design ?/ I believe this is not currently possible, is that right ? The only thing that comes close is the modification of the dict matplotlib.colors.ColorConverter.colors as discussed here (http://stackoverflow.com/a/19626339/2822346) The motivation for this would be to have a quick way to reuse colors from the default color cycle. Indeed, the new Cycler objects are powerful, but a bit heavy weight, especially for quick interactive usage. This is pseudo code for the use case I've in mind: suplot(211) plot(x, y1) # will be blue plot(x, y2) # will be green subplot(212) plot(x, y3, 'r') # y3 should stand out. will be red instead of blue With the classic style, this approach gives a coherent result, but using for example 'seaborn-deep', the default red 'r' is out of place. So to make the short color keywords useful again, it would be nice if seeborn-deep could redefine 'r' to be the one used in its color cycle (a nice dark purple red #8172B2). for now, seeborn-deep defines the rcParams axes.prop_cycle' cycler(u'color', [u'#4C72B0', u'#55A868', u'#C44E52', ... and with this proposition, it could be instead cycler(u'color', [u'b', u'g', u'r'.... like for classic style (at least for the first 3 colors, not sure for the following colors) but with extra entries in rcParams to define what b, g, r, ... should mean. (Also, I apologize in advance if this kind of proposition has been discussed already on the mailing list or on github. I understand there was much discussion on the topic of style change and I was not much following the discussion these last months.) best, Pierre -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben.v.root at gmail.com Wed Apr 6 10:52:19 2016 From: ben.v.root at gmail.com (Benjamin Root) Date: Wed, 6 Apr 2016 10:52:19 -0400 Subject: [Matplotlib-users] redefining color keywords in stylesheets In-Reply-To: <57050033.5050301@crans.org> References: <57050033.5050301@crans.org> Message-ID: Pierre, We are working on a couple different features that would better address your problem. First, we are working on implementing a shorthand notation for properties that would reference elements in the property cycle. So, specifying `color='[0]'` and `linewidth='[0]'` would set those properties from the first element of the property cycle. There are some details that are still being worked out, though, and would likely land in version 2.1, but a preview/beta pared-down version might appear in v2.0. Another feature that has been discussed, but hasn't gotten very far is a "palette" concept. This would allow one to have multiple versions of that ColorConverter dictionary that would map the names to different rgb specs. I don't think this idea has gotten a pull request yet, and I would imagine that it shouldn't be too difficult to implement for those who might be interested in taking it on. Cheers! Ben Root On Wed, Apr 6, 2016 at 8:25 AM, Pierre Haessig wrote: > Hello, > > > I've a question about style sheets: > > *W**ould it be possible for stylesheets to redefine the colorkeywords > ('r','g','b'...) to match their color design ?* > > I believe this is not currently possible, is that right ? > > The only thing that comes close is the modification of the dict > matplotlib.colors.ColorConverter.colors as discussed here ( > http://stackoverflow.com/a/19626339/2822346) > > The motivation for this would be to have a quick way to reuse colors from > the default color cycle. Indeed, the new Cycler objects are powerful, but a > bit heavy weight, especially for quick interactive usage. This is pseudo > code for the use case I've in mind: > > suplot(211) > plot(x, y1) # will be blue > plot(x, y2) # will be green > > subplot(212) > plot(x, y3, 'r') # y3 should stand out. will be red instead of blue > > > With the classic style, this approach gives a coherent result, but using > for example 'seaborn-deep', the default red 'r' is out of place. So to make > the short color keywords useful again, it would be nice if seeborn-deep > could redefine 'r' to be the one used in its color cycle (a nice dark > purple red #8172B2). > > for now, seeborn-deep defines the rcParams axes.prop_cycle' > cycler(u'color', [u'#4C72B0', u'#55A868', u'#C44E52', ... > > and with this proposition, it could be instead > cycler(u'color', [u'b', u'g', u'r'.... like for classic style (at least > for the first 3 colors, not sure for the following colors) > but with extra entries in rcParams to define what b, g, r, ... should mean. > > > (Also, I apologize in advance if this kind of proposition has been > discussed already on the mailing list or on github. I understand there was > much discussion on the topic of style change and I was not much following > the discussion these last months.) > > > best, > Pierre > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pmhobson at gmail.com Wed Apr 6 11:37:06 2016 From: pmhobson at gmail.com (Paul Hobson) Date: Wed, 6 Apr 2016 08:37:06 -0700 Subject: [Matplotlib-users] redefining color keywords in stylesheets In-Reply-To: References: <57050033.5050301@crans.org> Message-ID: I believe that seaborn achieves this through its set_color_codes function: https://github.com/mwaskom/seaborn/blob/10bdb18f47bb5fc0a30d34954ff6f174b4cf5881/seaborn/palettes.py#L900 On Wed, Apr 6, 2016 at 7:52 AM, Benjamin Root wrote: > Pierre, > > We are working on a couple different features that would better address > your problem. First, we are working on implementing a shorthand notation > for properties that would reference elements in the property cycle. So, > specifying `color='[0]'` and `linewidth='[0]'` would set those properties > from the first element of the property cycle. There are some details that > are still being worked out, though, and would likely land in version 2.1, > but a preview/beta pared-down version might appear in v2.0. > > Another feature that has been discussed, but hasn't gotten very far is a > "palette" concept. This would allow one to have multiple versions of that > ColorConverter dictionary that would map the names to different rgb specs. > I don't think this idea has gotten a pull request yet, and I would imagine > that it shouldn't be too difficult to implement for those who might be > interested in taking it on. > > Cheers! > Ben Root > > > On Wed, Apr 6, 2016 at 8:25 AM, Pierre Haessig > wrote: > >> Hello, >> >> >> I've a question about style sheets: >> >> *W**ould it be possible for stylesheets to redefine the colorkeywords >> ('r','g','b'...) to match their color design ?* >> >> I believe this is not currently possible, is that right ? >> >> The only thing that comes close is the modification of the dict >> matplotlib.colors.ColorConverter.colors as discussed here ( >> http://stackoverflow.com/a/19626339/2822346) >> >> The motivation for this would be to have a quick way to reuse colors from >> the default color cycle. Indeed, the new Cycler objects are powerful, but a >> bit heavy weight, especially for quick interactive usage. This is pseudo >> code for the use case I've in mind: >> >> suplot(211) >> plot(x, y1) # will be blue >> plot(x, y2) # will be green >> >> subplot(212) >> plot(x, y3, 'r') # y3 should stand out. will be red instead of blue >> >> >> With the classic style, this approach gives a coherent result, but using >> for example 'seaborn-deep', the default red 'r' is out of place. So to make >> the short color keywords useful again, it would be nice if seeborn-deep >> could redefine 'r' to be the one used in its color cycle (a nice dark >> purple red #8172B2). >> >> for now, seeborn-deep defines the rcParams axes.prop_cycle' >> cycler(u'color', [u'#4C72B0', u'#55A868', u'#C44E52', ... >> >> and with this proposition, it could be instead >> cycler(u'color', [u'b', u'g', u'r'.... like for classic style (at least >> for the first 3 colors, not sure for the following colors) >> but with extra entries in rcParams to define what b, g, r, ... should >> mean. >> >> >> (Also, I apologize in advance if this kind of proposition has been >> discussed already on the mailing list or on github. I understand there was >> much discussion on the topic of style change and I was not much following >> the discussion these last months.) >> >> >> best, >> Pierre >> >> _______________________________________________ >> Matplotlib-users mailing list >> Matplotlib-users at python.org >> https://mail.python.org/mailman/listinfo/matplotlib-users >> >> > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pierre.haessig at crans.org Thu Apr 7 04:55:37 2016 From: pierre.haessig at crans.org (Pierre Haessig) Date: Thu, 7 Apr 2016 10:55:37 +0200 Subject: [Matplotlib-users] redefining color keywords in stylesheets In-Reply-To: References: <57050033.5050301@crans.org> Message-ID: <57062089.9020102@crans.org> Le 06/04/2016 17:37, Paul Hobson a ?crit : > I believe that seaborn achieves this through its set_color_codes > function: > https://github.com/mwaskom/seaborn/blob/10bdb18f47bb5fc0a30d34954ff6f174b4cf5881/seaborn/palettes.py#L900 > Interesting ! Thank! So the functionality is available in seaborn (though not activated as default if I understand it right). Putting the ability to redefine the short codes in Matplotlib's rcParams could be a logical next step... best, Pierre From pierre.haessig at crans.org Thu Apr 7 05:03:12 2016 From: pierre.haessig at crans.org (Pierre Haessig) Date: Thu, 7 Apr 2016 11:03:12 +0200 Subject: [Matplotlib-users] redefining color keywords in stylesheets In-Reply-To: References: <57050033.5050301@crans.org> Message-ID: <57062250.2010701@crans.org> Thanks for the update ! The ability to use properties 0,1,2 looks very useful. The notation '[n]' looks a bit heavy, but I guess this is necessary to avoid clashing with the existing behavior (linewidth=0 vs. linewidth='[0]'...). As for the palette, I think it's very similar to what I was proposing. Only putting things in the rcParams is maybe simpler because it is compatible with the existing stylesheet mechanism. For me, the palette should just be one aspect of the style. Things could be as simple as having 'color.b', 'color.g', ... keys added to rcParams. (or 'palette.b'...) best, Pierre Le 06/04/2016 16:52, Benjamin Root a ?crit : > Pierre, > > We are working on a couple different features that would better > address your problem. First, we are working on implementing a > shorthand notation for properties that would reference elements in the > property cycle. So, specifying `color='[0]'` and `linewidth='[0]'` > would set those properties from the first element of the property > cycle. There are some details that are still being worked out, though, > and would likely land in version 2.1, but a preview/beta pared-down > version might appear in v2.0. > > Another feature that has been discussed, but hasn't gotten very far is > a "palette" concept. This would allow one to have multiple versions of > that ColorConverter dictionary that would map the names to different > rgb specs. I don't think this idea has gotten a pull request yet, and > I would imagine that it shouldn't be too difficult to implement for > those who might be interested in taking it on. > > Cheers! > Ben Root From SAyers at stanfordhealthcare.org Tue Apr 12 12:11:51 2016 From: SAyers at stanfordhealthcare.org (Ayers, Stephen) Date: Tue, 12 Apr 2016 16:11:51 +0000 Subject: [Matplotlib-users] Commercial Use Message-ID: Hi All: I?m working with a group who would like to use Matplotlib as part of a software solution for clinical interpretation of genomic data. Has anyone gone through similar processes? Are there any special licensing provisions for commercial use, or we all good? Thanks! ? Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben.v.root at gmail.com Tue Apr 12 12:16:35 2016 From: ben.v.root at gmail.com (Benjamin Root) Date: Tue, 12 Apr 2016 12:16:35 -0400 Subject: [Matplotlib-users] Commercial Use In-Reply-To: References: Message-ID: Matplotlib and NumPy are both licensed similarly to Python, so commercial use is fine. I think all of the major dependencies are BSD (the AGG renderer) or LGPL (gtk, qt, etc.), so you should be good there, too. Technically speaking, Continuum Analytics and Enthought both sell commerical Python distributions that includes these packages without any problems. Cheers! Ben Root On Tue, Apr 12, 2016 at 12:11 PM, Ayers, Stephen < SAyers at stanfordhealthcare.org> wrote: > Hi All: > > I?m working with a group who would like to use Matplotlib as part of a > software solution for clinical interpretation of genomic data. Has anyone > gone through similar processes? Are there any special licensing provisions > for commercial use, or we all good? > > Thanks! > ? > Steve > > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tcaswell at gmail.com Wed Apr 13 11:11:11 2016 From: tcaswell at gmail.com (Thomas Caswell) Date: Wed, 13 Apr 2016 15:11:11 +0000 Subject: [Matplotlib-users] Commercial Use In-Reply-To: References: Message-ID: The biggest gotcha would be if you use `pyqt4` or `pyqt5` which are dual licensed as commercial or GPL (you need to talk to riverbank about that), however pyside / pyside2 are licensed as LGPL. To be clear, I am not a lawyer. If you plan to sell your software you really need to consult an IP lawyer about these sorts of things. If you do not have one already, I suspect that numfocus can refer you to counsel with open source experience. Tom On Tue, Apr 12, 2016 at 12:17 PM Benjamin Root wrote: > Matplotlib and NumPy are both licensed similarly to Python, so commercial > use is fine. I think all of the major dependencies are BSD (the AGG > renderer) or LGPL (gtk, qt, etc.), so you should be good there, too. > > Technically speaking, Continuum Analytics and Enthought both sell > commerical Python distributions that includes these packages without any > problems. > > Cheers! > Ben Root > > On Tue, Apr 12, 2016 at 12:11 PM, Ayers, Stephen < > SAyers at stanfordhealthcare.org> wrote: > >> Hi All: >> >> I?m working with a group who would like to use Matplotlib as part of a >> software solution for clinical interpretation of genomic data. Has anyone >> gone through similar processes? Are there any special licensing provisions >> for commercial use, or we all good? >> >> Thanks! >> ? >> Steve >> >> >> _______________________________________________ >> Matplotlib-users mailing list >> Matplotlib-users at python.org >> https://mail.python.org/mailman/listinfo/matplotlib-users >> >> > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jslavin at cfa.harvard.edu Thu Apr 14 09:22:52 2016 From: jslavin at cfa.harvard.edu (Slavin, Jonathan) Date: Thu, 14 Apr 2016 09:22:52 -0400 Subject: [Matplotlib-users] enhancement suggestion for figure window Message-ID: Hi all, One of the things I like about matplotlib is the flexibility of the interactive figure window - panning, zooming, etc. One thing that I would really like is for the ability to set, perhaps via a slider, the limits in a displayed image (clim values, or vmin, vmax arguments in call to imshow). I know that one can do this on the command line via the set_clim method of the AxesImage object, but having a readily available way to do it from the plot window would be really nice. In QtAgg, which I use, there is already the capability to change other plot attributes via a pop-up (axis limits, scale, label). I'm not sure how difficult such an addition would be. Regards, Jon -- ________________________________________________________ Jonathan D. Slavin Harvard-Smithsonian CfA jslavin at cfa.harvard.edu 60 Garden Street, MS 83 phone: (617) 496-7981 Cambridge, MA 02138-1516 cell: (781) 363-0035 USA ________________________________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: From lorenzo.isella at gmail.com Fri Apr 15 03:47:18 2016 From: lorenzo.isella at gmail.com (Lorenzo Isella) Date: Fri, 15 Apr 2016 09:47:18 +0200 Subject: [Matplotlib-users] Convex Hull -- Question about Point Size Message-ID: <20160415074718.GA3273@localhost.localdomain> Dear All, Thanks to what I found here http://bit.ly/1qJlWkP I discovered how to plot the convex hull around a set of points (please have a look at the script pasted at the end of the email). Everything is almost done,but I have a problem: my "points" are not really point-like: they are sphere whose radius is 1 and they almost touch each other. I do not know how to tune the parameter s so that the radius of the points is equal to one in the same units in which I measure the positions of the points themselves. Any help is appreciated. Cheers Lorenzo ################################################################? import numpy as np import pylab as pl import scipy as sp from scipy.spatial import ConvexHull from scipy.spatial.distance import euclidean import matplotlib.pyplot as plt import mpl_toolkits.mplot3d as a3 cluster_agglomerate=np.array([[ 0.14513811, -0.18930948, -1.44428171], [ 0.88042945, 1.67057596, -1.45742688], [-1.66682741, -0.99554261, -1.70267889], [-0.95535694, 2.3159907 , -1.93637881], [ 1.09396798, 1.7987614 , -3.44524095], [-2.63620654, 0.16588691, -3.02436539], [ 0.19027056, 2.70740725, 0.11479029], [ 2.77638842, 1.70535678, -2.10208878], [-0.09149779, -0.81908733, 2.07425244], [-0.48408772, 0.96793567, 1.26652603], [ 0.67499278, -2.5386008 , 1.39914827], [ 1.02571108, -1.60932884, -0.34500693], [ 2.78789155, -1.42050584, 0.59682802], [-0.14688239, -2.36883246, 3.35177362], [-1.71507089, 0.19184887, 2.68408562], [-1.87886026, -1.58255618, 3.97006406], [ 6.61540229, 1.98324725, 0.82767368], [ 7.46818823, 3.00950487, -0.66214223], [ 4.80777628, 1.97159273, 1.68344958], [ 6.3548727 , 2.26459561, 2.92819854], [ 4.70026626, 0.44618044, 0.3866837 ], [ 3.44366671, 1.87939977, -0.2203051 ], [ 2.92460648, 1.98510457, 2.37510769], [ 5.07053866, -0.10349542, -1.51041234], [ 7.21643437, -1.32050186, -0.70707322], [ 6.93292243, 0.58458074, -1.2458508 ], [ 7.84238244, -2.97562362, -1.63914669], [ 7.43212373, 0.10620418, 0.68315389], [ 9.59692827, -2.0843759 , -1.26623658], [ 8.34540867, -1.14927294, 1.95073173], [ 6.57425162, -2.13797392, -2.94804639], [ 6.93340304, -4.4591665 , -0.63578546]]) # see http://bit.ly/1qJlWkP # Generate random points & convex hull points = cluster_agglomerate # np.random.rand(20,3) print "points are, ", points hull = ConvexHull(points) print "I calculated the convex hull" ax = a3.Axes3D(pl.figure()) facetCol = [1, 0.0, 0.0] ax.plot_trisurf(points[:,0], points[:,1], points[:,2], triangles=hull.simplices) ax.scatter(points[:,0], points[:,1], points[:,2], s=100) plt.axis('off') plt.show() From lyzhangjm at 163.com Sun Apr 3 23:24:23 2016 From: lyzhangjm at 163.com (lyzhangjm) Date: Sun, 3 Apr 2016 20:24:23 -0700 (MST) Subject: [Matplotlib-users] ImportError: No module named axes_grid1 Message-ID: <1459740263201-46936.post@n5.nabble.com> Hi, I have installed matplotlib. However, the following is error. from mpl_toolkits.axes_grid1 import make_axes_locatable what is the reason ? thanks -- View this message in context: http://matplotlib.1069221.n5.nabble.com/ImportError-No-module-named-axes-grid1-tp46936.html Sent from the matplotlib - users mailing list archive at Nabble.com. From coquelicot at walla.com Mon Apr 4 16:24:23 2016 From: coquelicot at walla.com (coquelicot) Date: Mon, 4 Apr 2016 13:24:23 -0700 (MST) Subject: [Matplotlib-users] Matplotlib set_array slow in comparison with cv2 Message-ID: <1459801463648-46938.post@n5.nabble.com> Compare the following 2 codes: import matplotlib.pyplot as plt import cv2 def grab_frame(i): #this function simply grab frame i from an image folder or a video ... return img_array_like_returned_by_imread_or_cv2.imread #remove the following two lines to test with opencv: fr = grab_frame(0) img = plt.imshow(fr) for i in range(0,300): fr = grab_frame(i) img.set_array(fr) plt.pause(0.001) #replace the previous 2 lines by the following 2 lines to #compare with opencv: #cv2.imshow('frame', fr) #if cv2.waitKey(1) & 0xFF == ord('q'): break My questions are: 1) why is set_array much slower than cv2.imshow ? 2) is it possible to improve this, say by tricking some function of matplotlib ? -- View this message in context: http://matplotlib.1069221.n5.nabble.com/Matplotlib-set-array-slow-in-comparison-with-cv2-tp46938.html Sent from the matplotlib - users mailing list archive at Nabble.com. From fley at astro.puc.cl Mon Apr 4 20:06:43 2016 From: fley at astro.puc.cl (Francisco Ley) Date: Mon, 4 Apr 2016 21:06:43 -0300 Subject: [Matplotlib-users] Question about Crash Report Ipython - Error Message-ID: <57030193.4040905@astro.puc.cl> Hi, My name is Francisco and I'm a python and ipython user. Today I was coding in python a little bit, in particular with the function quiver, in matplotlib. I got an error when I tried to use the option angles='xy' A problem related with the broadcasting arose. It was really strange because if I used another arrays it worked. Anyways, when I continued trying some options another error arose, Ipython crashes and a report file was created. I was wondering if you could help me with that, or tell me where can I ask for help, honestly I don't know what else I can do for now. The file is attached. Thank you in advance, Regards, Francisco -------------- next part -------------- *************************************************************************** IPython post-mortem report {'commit_hash': '8ff8693', 'commit_source': 'installation', 'default_encoding': 'UTF-8', 'ipython_path': '/home/chinoley/anaconda3/lib/python3.5/site-packages/IPython', 'ipython_version': '4.0.3', 'os_name': 'posix', 'platform': 'Linux-3.19.0-32-generic-x86_64-with-debian-jessie-sid', 'sys_executable': '/home/chinoley/anaconda3/bin/python3', 'sys_platform': 'linux', 'sys_version': '3.5.1 |Anaconda 2.5.0 (64-bit)| (default, Dec 7 2015, ' '11:16:01) \n' '[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)]'} *************************************************************************** *************************************************************************** Crash traceback: --------------------------------------------------------------------------- --------------------------------------------------------------------------- ValueError Python 3.5.1: /home/chinoley/anaconda3/bin/python3 Mon Apr 4 20:31:55 2016 A problem occurred executing Python code. Here is the sequence of function calls leading up to the error, with the most recent (innermost) call last. /home/chinoley/anaconda3/lib/python3.5/site-packages/matplotlib/backends/backend_qt5agg.py in __draw_idle_agg(self=, *args=()) 161 def draw_idle(self): 162 """ 163 Queue redraw of the Agg buffer and request Qt paintEvent. 164 """ 165 # The Agg draw needs to be handled by the same thread matplotlib 166 # modifies the scene graph from. Post Agg draw request to the 167 # current event loop in order to ensure thread affinity and to 168 # accumulate multiple draw requests from event handling. 169 # TODO: queued signal connection might be safer than singleShot 170 if not self._agg_draw_pending: 171 self._agg_draw_pending = True 172 QtCore.QTimer.singleShot(0, self.__draw_idle_agg) 173 174 def __draw_idle_agg(self, *args): 175 try: --> 176 FigureCanvasAgg.draw(self) global FigureCanvasAgg.draw = self = 177 self.update() 178 finally: 179 self._agg_draw_pending = False 180 181 def blit(self, bbox=None): 182 """ 183 Blit the region in bbox 184 """ 185 # If bbox is None, blit the entire canvas. Otherwise 186 # blit only the area defined by the bbox. 187 if bbox is None and self.figure: 188 bbox = self.figure.bbox 189 190 self.blitbox = bbox 191 l, b, w, h = bbox.bounds /home/chinoley/anaconda3/lib/python3.5/site-packages/matplotlib/backends/backend_agg.py in draw(self=) 459 def restore_region(self, region, bbox=None, xy=None): 460 renderer = self.get_renderer() 461 return renderer.restore_region(region, bbox, xy) 462 463 def draw(self): 464 """ 465 Draw the figure using the renderer 466 """ 467 if __debug__: verbose.report('FigureCanvasAgg.draw', 'debug-annoying') 468 469 self.renderer = self.get_renderer(cleared=True) 470 # acquire a lock on the shared font cache 471 RendererAgg.lock.acquire() 472 473 try: --> 474 self.figure.draw(self.renderer) self.figure.draw = .draw_wrapper of > self.renderer = 475 finally: 476 RendererAgg.lock.release() 477 478 def get_renderer(self, cleared=False): 479 l, b, w, h = self.figure.bbox.bounds 480 key = w, h, self.figure.dpi 481 try: self._lastKey, self.renderer 482 except AttributeError: need_new_renderer = True 483 else: need_new_renderer = (self._lastKey != key) 484 485 if need_new_renderer: 486 self.renderer = RendererAgg(w, h, self.figure.dpi) 487 self._lastKey = key 488 elif cleared: 489 self.renderer.clear() /home/chinoley/anaconda3/lib/python3.5/site-packages/matplotlib/artist.py in draw_wrapper(artist=, renderer=, *args=(), **kwargs={}) 46 47 if artist.get_agg_filter() is not None: 48 renderer.start_filter() 49 50 def after(artist, renderer): 51 52 if artist.get_agg_filter() is not None: 53 renderer.stop_filter(artist.get_agg_filter()) 54 55 if artist.get_rasterized(): 56 renderer.stop_rasterizing() 57 58 # the axes class has a second argument inframe for its draw method. 59 def draw_wrapper(artist, renderer, *args, **kwargs): 60 before(artist, renderer) ---> 61 draw(artist, renderer, *args, **kwargs) global draw = undefined artist = renderer = args = () kwargs = {} 62 after(artist, renderer) 63 64 # "safe wrapping" to exactly replicate anything we haven't overridden above 65 draw_wrapper.__name__ = draw.__name__ 66 draw_wrapper.__dict__ = draw.__dict__ 67 draw_wrapper.__doc__ = draw.__doc__ 68 draw_wrapper._supports_rasterization = True 69 return draw_wrapper 70 71 72 def _stale_axes_callback(self, val): 73 if self.axes: 74 self.axes.stale = val 75 76 /home/chinoley/anaconda3/lib/python3.5/site-packages/matplotlib/figure.py in draw(self=, renderer=) 1144 1145 # render the axes 1146 for a in self.axes: 1147 dsu.append((a.get_zorder(), a, a.draw, [renderer])) 1148 1149 # render the figure text 1150 for a in self.texts: 1151 dsu.append((a.get_zorder(), a, a.draw, [renderer])) 1152 1153 for a in self.legends: 1154 dsu.append((a.get_zorder(), a, a.draw, [renderer])) 1155 1156 dsu = [row for row in dsu if not row[1].get_animated()] 1157 dsu.sort(key=itemgetter(0)) 1158 for zorder, a, func, args in dsu: -> 1159 func(*args) func = .draw_wrapper of > args = [] 1160 1161 renderer.close_group('figure') 1162 self.stale = False 1163 1164 self._cachedRenderer = renderer 1165 self.canvas.draw_event(renderer) 1166 1167 def draw_artist(self, a): 1168 """ 1169 draw :class:`matplotlib.artist.Artist` instance *a* only -- 1170 this is available only after the figure is drawn 1171 """ 1172 if self._cachedRenderer is None: 1173 msg = ('draw_artist can only be used after an initial draw which' 1174 ' caches the render') /home/chinoley/anaconda3/lib/python3.5/site-packages/matplotlib/artist.py in draw_wrapper(artist=, renderer=, *args=(), **kwargs={}) 46 47 if artist.get_agg_filter() is not None: 48 renderer.start_filter() 49 50 def after(artist, renderer): 51 52 if artist.get_agg_filter() is not None: 53 renderer.stop_filter(artist.get_agg_filter()) 54 55 if artist.get_rasterized(): 56 renderer.stop_rasterizing() 57 58 # the axes class has a second argument inframe for its draw method. 59 def draw_wrapper(artist, renderer, *args, **kwargs): 60 before(artist, renderer) ---> 61 draw(artist, renderer, *args, **kwargs) global draw = undefined artist = renderer = args = () kwargs = {} 62 after(artist, renderer) 63 64 # "safe wrapping" to exactly replicate anything we haven't overridden above 65 draw_wrapper.__name__ = draw.__name__ 66 draw_wrapper.__dict__ = draw.__dict__ 67 draw_wrapper.__doc__ = draw.__doc__ 68 draw_wrapper._supports_rasterization = True 69 return draw_wrapper 70 71 72 def _stale_axes_callback(self, val): 73 if self.axes: 74 self.axes.stale = val 75 76 /home/chinoley/anaconda3/lib/python3.5/site-packages/matplotlib/axes/_base.py in draw(self=, renderer=, inframe=False) 2309 gc = renderer.new_gc() 2310 gc.set_clip_rectangle(self.bbox) 2311 gc.set_clip_path(mtransforms.TransformedPath( 2312 self.patch.get_path(), 2313 self.patch.get_transform())) 2314 2315 renderer.draw_image(gc, round(l), round(b), im) 2316 gc.restore() 2317 2318 if dsu_rasterized: 2319 for zorder, a in dsu_rasterized: 2320 a.draw(renderer) 2321 renderer.stop_rasterizing() 2322 2323 for zorder, a in dsu: -> 2324 a.draw(renderer) a.draw = .draw_wrapper of > renderer = 2325 2326 renderer.close_group('axes') 2327 self._cachedRenderer = renderer 2328 self.stale = False 2329 2330 def draw_artist(self, a): 2331 """ 2332 This method can only be used after an initial draw which 2333 caches the renderer. It is used to efficiently update Axes 2334 data (axis ticks, labels, etc are not updated) 2335 """ 2336 if self._cachedRenderer is None: 2337 msg = ('draw_artist can only be used after an initial draw which' 2338 ' caches the render') 2339 raise AttributeError(msg) /home/chinoley/anaconda3/lib/python3.5/site-packages/matplotlib/artist.py in draw_wrapper(artist=, renderer=, *args=(), **kwargs={}) 46 47 if artist.get_agg_filter() is not None: 48 renderer.start_filter() 49 50 def after(artist, renderer): 51 52 if artist.get_agg_filter() is not None: 53 renderer.stop_filter(artist.get_agg_filter()) 54 55 if artist.get_rasterized(): 56 renderer.stop_rasterizing() 57 58 # the axes class has a second argument inframe for its draw method. 59 def draw_wrapper(artist, renderer, *args, **kwargs): 60 before(artist, renderer) ---> 61 draw(artist, renderer, *args, **kwargs) global draw = undefined artist = renderer = args = () kwargs = {} 62 after(artist, renderer) 63 64 # "safe wrapping" to exactly replicate anything we haven't overridden above 65 draw_wrapper.__name__ = draw.__name__ 66 draw_wrapper.__dict__ = draw.__dict__ 67 draw_wrapper.__doc__ = draw.__doc__ 68 draw_wrapper._supports_rasterization = True 69 return draw_wrapper 70 71 72 def _stale_axes_callback(self, val): 73 if self.axes: 74 self.axes.stale = val 75 76 /home/chinoley/anaconda3/lib/python3.5/site-packages/matplotlib/quiver.py in draw(self=, renderer=) 512 513 self._initialized = True 514 515 def get_datalim(self, transData): 516 trans = self.get_transform() 517 transOffset = self.get_offset_transform() 518 full_transform = (trans - transData) + (transOffset - transData) 519 XY = full_transform.transform(self.XY) 520 bbox = transforms.Bbox.null() 521 bbox.update_from_data_xy(XY, ignore=True) 522 return bbox 523 524 @allow_rasterization 525 def draw(self, renderer): 526 self._init() --> 527 verts = self._make_verts(self.U, self.V) verts = undefined self._make_verts = > self.U = array([ 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0.26315789, 0.26315789, 0.26315789, 0.26315789, 0.26315789, 0.26315789, 0.26315789, 0.26315789, 0.26315789, 0.26315789, 0.26315789, 0.26315789, 0.26315789, 0.26315789, 0.26315789, 0.26315789, 0.26315789, 0.26315789, 0.26315789, 0.26315789, 0.52631579, 0.52631579, 0.52631579, 0.52631579, 0.52631579, 0.52631579, 0.52631579, 0.52631579, 0.52631579, 0.52631579, 0.52631579, 0.52631579, 0.52631579, 0.52631579, 0.52631579, 0.52631579, 0.52631579, 0.52631579, 0.52631579, 0.52631579, 0.78947368, 0.78947368, 0.78947368, 0.78947368, 0.78947368, 0.78947368, 0.78947368, 0.78947368, 0.78947368, 0.78947368, 0.78947368, 0.78947368, 0.78947368, 0.78947368, 0.78947368, 0.78947368, 0.78947368, 0.78947368, 0.78947368, 0.78947368, 1.05263158, 1.05263158, 1.05263158, 1.05263158, 1.05263158, 1.05263158, 1.05263158, 1.05263158, 1.05263158, 1.05263158, 1.05263158, 1.05263158, 1.05263158, 1.05263158, 1.05263158, 1.05263158, 1.05263158, 1.05263158, 1.05263158, 1.05263158, 1.31578947, 1.31578947, 1.31578947, 1.31578947, 1.31578947, 1.31578947, 1.31578947, 1.31578947, 1.31578947, 1.31578947, 1.31578947, 1.31578947, 1.31578947, 1.31578947, 1.31578947, 1.31578947, 1.31578947, 1.31578947, 1.31578947, 1.31578947, 1.57894737, 1.57894737, 1.57894737, 1.57894737, 1.57894737, 1.57894737, 1.57894737, 1.57894737, 1.57894737, 1.57894737, 1.57894737, 1.57894737, 1.57894737, 1.57894737, 1.57894737, 1.57894737, 1.57894737, 1.57894737, 1.57894737, 1.57894737, 1.84210526, 1.84210526, 1.84210526, 1.84210526, 1.84210526, 1.84210526, 1.84210526, 1.84210526, 1.84210526, 1.84210526, 1.84210526, 1.84210526, 1.84210526, 1.84210526, 1.84210526, 1.84210526, 1.84210526, 1.84210526, 1.84210526, 1.84210526, 2.10526316, 2.10526316, 2.10526316, 2.10526316, 2.10526316, 2.10526316, 2.10526316, 2.10526316, 2.10526316, 2.10526316, 2.10526316, 2.10526316, 2.10526316, 2.10526316, 2.10526316, 2.10526316, 2.10526316, 2.10526316, 2.10526316, 2.10526316, 2.36842105, 2.36842105, 2.36842105, 2.36842105, 2.36842105, 2.36842105, 2.36842105, 2.36842105, 2.36842105, 2.36842105, 2.36842105, 2.36842105, 2.36842105, 2.36842105, 2.36842105, 2.36842105, 2.36842105, 2.36842105, 2.36842105, 2.36842105, 2.63157895, 2.63157895, 2.63157895, 2.63157895, 2.63157895, 2.63157895, 2.63157895, 2.63157895, 2.63157895, 2.63157895, 2.63157895, 2.63157895, 2.63157895, 2.63157895, 2.63157895, 2.63157895, 2.63157895, 2.63157895, 2.63157895, 2.63157895, 2.89473684, 2.89473684, 2.89473684, 2.89473684, 2.89473684, 2.89473684, 2.89473684, 2.89473684, 2.89473684, 2.89473684, 2.89473684, 2.89473684, 2.89473684, 2.89473684, 2.89473684, 2.89473684, 2.89473684, 2.89473684, 2.89473684, 2.89473684, 3.15789474, 3.15789474, 3.15789474, 3.15789474, 3.15789474, 3.15789474, 3.15789474, 3.15789474, 3.15789474, 3.15789474, 3.15789474, 3.15789474, 3.15789474, 3.15789474, 3.15789474, 3.15789474, 3.15789474, 3.15789474, 3.15789474, 3.15789474, 3.42105263, 3.42105263, 3.42105263, 3.42105263, 3.42105263, 3.42105263, 3.42105263, 3.42105263, 3.42105263, 3.42105263, 3.42105263, 3.42105263, 3.42105263, 3.42105263, 3.42105263, 3.42105263, 3.42105263, 3.42105263, 3.42105263, 3.42105263, 3.68421053, 3.68421053, 3.68421053, 3.68421053, 3.68421053, 3.68421053, 3.68421053, 3.68421053, 3.68421053, 3.68421053, 3.68421053, 3.68421053, 3.68421053, 3.68421053, 3.68421053, 3.68421053, 3.68421053, 3.68421053, 3.68421053, 3.68421053, 3.94736842, 3.94736842, 3.94736842, 3.94736842, 3.94736842, 3.94736842, 3.94736842, 3.94736842, 3.94736842, 3.94736842, 3.94736842, 3.94736842, 3.94736842, 3.94736842, 3.94736842, 3.94736842, 3.94736842, 3.94736842, 3.94736842, 3.94736842, 4.21052632, 4.21052632, 4.21052632, 4.21052632, 4.21052632, 4.21052632, 4.21052632, 4.21052632, 4.21052632, 4.21052632, 4.21052632, 4.21052632, 4.21052632, 4.21052632, 4.21052632, 4.21052632, 4.21052632, 4.21052632, 4.21052632, 4.21052632, 4.47368421, 4.47368421, 4.47368421, 4.47368421, 4.47368421, 4.47368421, 4.47368421, 4.47368421, 4.47368421, 4.47368421, 4.47368421, 4.47368421, 4.47368421, 4.47368421, 4.47368421, 4.47368421, 4.47368421, 4.47368421, 4.47368421, 4.47368421, 4.73684211, 4.73684211, 4.73684211, 4.73684211, 4.73684211, 4.73684211, 4.73684211, 4.73684211, 4.73684211, 4.73684211, 4.73684211, 4.73684211, 4.73684211, 4.73684211, 4.73684211, 4.73684211, 4.73684211, 4.73684211, 4.73684211, 4.73684211, 5. , 5. , 5. , 5. , 5. , 5. , 5. , 5. , 5. , 5. , 5. , 5. , 5. , 5. , 5. , 5. , 5. , 5. , 5. , 5. ]) self.V = array([ 0. , 0.26315789, 0.52631579, 0.78947368, 1.05263158, 1.31578947, 1.57894737, 1.84210526, 2.10526316, 2.36842105, 2.63157895, 2.89473684, 3.15789474, 3.42105263, 3.68421053, 3.94736842, 4.21052632, 4.47368421, 4.73684211, 5. , 0.18421053, 0.44736842, 0.71052632, 0.97368421, 1.23684211, 1.5 , 1.76315789, 2.02631579, 2.28947368, 2.55263158, 2.81578947, 3.07894737, 3.34210526, 3.60526316, 3.86842105, 4.13157895, 4.39473684, 4.65789474, 4.92105263, 5.18421053, 0.36842105, 0.63157895, 0.89473684, 1.15789474, 1.42105263, 1.68421053, 1.94736842, 2.21052632, 2.47368421, 2.73684211, 3. , 3.26315789, 3.52631579, 3.78947368, 4.05263158, 4.31578947, 4.57894737, 4.84210526, 5.10526316, 5.36842105, 0.55263158, 0.81578947, 1.07894737, 1.34210526, 1.60526316, 1.86842105, 2.13157895, 2.39473684, 2.65789474, 2.92105263, 3.18421053, 3.44736842, 3.71052632, 3.97368421, 4.23684211, 4.5 , 4.76315789, 5.02631579, 5.28947368, 5.55263158, 0.73684211, 1. , 1.26315789, 1.52631579, 1.78947368, 2.05263158, 2.31578947, 2.57894737, 2.84210526, 3.10526316, 3.36842105, 3.63157895, 3.89473684, 4.15789474, 4.42105263, 4.68421053, 4.94736842, 5.21052632, 5.47368421, 5.73684211, 0.92105263, 1.18421053, 1.44736842, 1.71052632, 1.97368421, 2.23684211, 2.5 , 2.76315789, 3.02631579, 3.28947368, 3.55263158, 3.81578947, 4.07894737, 4.34210526, 4.60526316, 4.86842105, 5.13157895, 5.39473684, 5.65789474, 5.92105263, 1.10526316, 1.36842105, 1.63157895, 1.89473684, 2.15789474, 2.42105263, 2.68421053, 2.94736842, 3.21052632, 3.47368421, 3.73684211, 4. , 4.26315789, 4.52631579, 4.78947368, 5.05263158, 5.31578947, 5.57894737, 5.84210526, 6.10526316, 1.28947368, 1.55263158, 1.81578947, 2.07894737, 2.34210526, 2.60526316, 2.86842105, 3.13157895, 3.39473684, 3.65789474, 3.92105263, 4.18421053, 4.44736842, 4.71052632, 4.97368421, 5.23684211, 5.5 , 5.76315789, 6.02631579, 6.28947368, 1.47368421, 1.73684211, 2. , 2.26315789, 2.52631579, 2.78947368, 3.05263158, 3.31578947, 3.57894737, 3.84210526, 4.10526316, 4.36842105, 4.63157895, 4.89473684, 5.15789474, 5.42105263, 5.68421053, 5.94736842, 6.21052632, 6.47368421, 1.65789474, 1.92105263, 2.18421053, 2.44736842, 2.71052632, 2.97368421, 3.23684211, 3.5 , 3.76315789, 4.02631579, 4.28947368, 4.55263158, 4.81578947, 5.07894737, 5.34210526, 5.60526316, 5.86842105, 6.13157895, 6.39473684, 6.65789474, 1.84210526, 2.10526316, 2.36842105, 2.63157895, 2.89473684, 3.15789474, 3.42105263, 3.68421053, 3.94736842, 4.21052632, 4.47368421, 4.73684211, 5. , 5.26315789, 5.52631579, 5.78947368, 6.05263158, 6.31578947, 6.57894737, 6.84210526, 2.02631579, 2.28947368, 2.55263158, 2.81578947, 3.07894737, 3.34210526, 3.60526316, 3.86842105, 4.13157895, 4.39473684, 4.65789474, 4.92105263, 5.18421053, 5.44736842, 5.71052632, 5.97368421, 6.23684211, 6.5 , 6.76315789, 7.02631579, 2.21052632, 2.47368421, 2.73684211, 3. , 3.26315789, 3.52631579, 3.78947368, 4.05263158, 4.31578947, 4.57894737, 4.84210526, 5.10526316, 5.36842105, 5.63157895, 5.89473684, 6.15789474, 6.42105263, 6.68421053, 6.94736842, 7.21052632, 2.39473684, 2.65789474, 2.92105263, 3.18421053, 3.44736842, 3.71052632, 3.97368421, 4.23684211, 4.5 , 4.76315789, 5.02631579, 5.28947368, 5.55263158, 5.81578947, 6.07894737, 6.34210526, 6.60526316, 6.86842105, 7.13157895, 7.39473684, 2.57894737, 2.84210526, 3.10526316, 3.36842105, 3.63157895, 3.89473684, 4.15789474, 4.42105263, 4.68421053, 4.94736842, 5.21052632, 5.47368421, 5.73684211, 6. , 6.26315789, 6.52631579, 6.78947368, 7.05263158, 7.31578947, 7.57894737, 2.76315789, 3.02631579, 3.28947368, 3.55263158, 3.81578947, 4.07894737, 4.34210526, 4.60526316, 4.86842105, 5.13157895, 5.39473684, 5.65789474, 5.92105263, 6.18421053, 6.44736842, 6.71052632, 6.97368421, 7.23684211, 7.5 , 7.76315789, 2.94736842, 3.21052632, 3.47368421, 3.73684211, 4. , 4.26315789, 4.52631579, 4.78947368, 5.05263158, 5.31578947, 5.57894737, 5.84210526, 6.10526316, 6.36842105, 6.63157895, 6.89473684, 7.15789474, 7.42105263, 7.68421053, 7.94736842, 3.13157895, 3.39473684, 3.65789474, 3.92105263, 4.18421053, 4.44736842, 4.71052632, 4.97368421, 5.23684211, 5.5 , 5.76315789, 6.02631579, 6.28947368, 6.55263158, 6.81578947, 7.07894737, 7.34210526, 7.60526316, 7.86842105, 8.13157895, 3.31578947, 3.57894737, 3.84210526, 4.10526316, 4.36842105, 4.63157895, 4.89473684, 5.15789474, 5.42105263, 5.68421053, 5.94736842, 6.21052632, 6.47368421, 6.73684211, 7. , 7.26315789, 7.52631579, 7.78947368, 8.05263158, 8.31578947, 3.5 , 3.76315789, 4.02631579, 4.28947368, 4.55263158, 4.81578947, 5.07894737, 5.34210526, 5.60526316, 5.86842105, 6.13157895, 6.39473684, 6.65789474, 6.92105263, 7.18421053, 7.44736842, 7.71052632, 7.97368421, 8.23684211, 8.5 ]) 528 self.set_verts(verts, closed=False) 529 self._new_UV = False 530 mcollections.PolyCollection.draw(self, renderer) 531 self.stale = False 532 533 def set_UVC(self, U, V, C=None): 534 # We need to ensure we have a copy, not a reference 535 # to an array that might change before draw(). 536 U = ma.masked_invalid(U, copy=True).ravel() 537 V = ma.masked_invalid(V, copy=True).ravel() 538 mask = ma.mask_or(U.mask, V.mask, copy=False, shrink=True) 539 if C is not None: 540 C = ma.masked_invalid(C, copy=True).ravel() 541 mask = ma.mask_or(mask, C.mask, copy=False, shrink=True) 542 if mask is ma.nomask: /home/chinoley/anaconda3/lib/python3.5/site-packages/matplotlib/quiver.py in _make_verts(self=, U=array([ 0. , 0. , 0. , 0... , 5. , 5. , 5. ]), V=array([ 0. , 0.26315789, 0.52631579, 0...71052632, 7.97368421, 8.23684211, 8.5 ])) 642 widthu_per_lenu = dx / self._trans_scale 643 if self.scale is None: 644 self.scale = scale * widthu_per_lenu 645 length = a * (widthu_per_lenu / (self.scale * self.width)) 646 X, Y = self._h_arrows(length) 647 if self.angles == 'xy': 648 theta = angles 649 elif self.angles == 'uv': 650 theta = np.angle(uv) 651 else: 652 # Make a copy to avoid changing the input array. 653 theta = ma.masked_invalid(self.angles, copy=True).filled(0) 654 theta = theta.ravel() 655 theta *= (np.pi / 180.0) 656 theta.shape = (theta.shape[0], 1) # for broadcasting --> 657 xy = (X + Y * 1j) * np.exp(1j * theta) * self.width xy = undefined X = array([[ 5.00000000e-01, 2.50000000e-01, -2.50000000e-01, ..., 2.50000000e-01, 5.00000000e-01, 2.50000000e-01], [ 0.00000000e+00, 2.42541838e+00, 0.00000000e+00, ..., 2.42541838e+00, 0.00000000e+00, 0.00000000e+00], [ 0.00000000e+00, 9.08234295e+00, 6.58234295e+00, ..., 9.08234295e+00, 0.00000000e+00, 0.00000000e+00], ..., [ 0.00000000e+00, 3.87231325e+02, 3.84731325e+02, ..., 3.87231325e+02, 0.00000000e+00, 0.00000000e+00], [ 0.00000000e+00, 3.90840896e+02, 3.88340896e+02, ..., 3.90840896e+02, 0.00000000e+00, 0.00000000e+00], [ 0.00000000e+00, 3.94533403e+02, 3.92033403e+02, ..., 3.94533403e+02, 0.00000000e+00, 0.00000000e+00]]) Y = array([[ 0.00000000e+00, 4.33012702e-01, 4.33012702e-01, ..., -4.33012702e-01, -1.22464680e-16, 4.33012702e-01], [ 4.85083677e-01, 4.85083677e-01, 1.45525103e+00, ..., -4.85083677e-01, -4.85083677e-01, 4.85083677e-01], [ 5.00000000e-01, 5.00000000e-01, 1.50000000e+00, ..., -5.00000000e-01, -5.00000000e-01, 5.00000000e-01], ..., [ 5.00000000e-01, 5.00000000e-01, 1.50000000e+00, ..., -5.00000000e-01, -5.00000000e-01, 5.00000000e-01], [ 5.00000000e-01, 5.00000000e-01, 1.50000000e+00, ..., -5.00000000e-01, -5.00000000e-01, 5.00000000e-01], [ 5.00000000e-01, 5.00000000e-01, 1.50000000e+00, ..., -5.00000000e-01, -5.00000000e-01, 5.00000000e-01]]) global np.exp = theta = array([[ 0.00000000e+00], [ 8.95159981e+00], [ 1.79031996e+01], [ 2.68547994e+01], [ 3.58063992e+01], [ 4.47579990e+01], [ 5.37095988e+01], [ 6.26611987e+01], [ 7.16127985e+01], [ 8.05643983e+01], [ 8.95159981e+01], [ 9.84675979e+01], [ 1.07419198e+02], [ 1.16370798e+02], [ 1.25322397e+02], [ 1.34273997e+02], [ 1.43225597e+02], [ 1.52177197e+02], [ 1.61128797e+02], [ 1.70080396e+02], [ 1.79031996e+02], [ 1.87983596e+02], [ 1.96935196e+02], [ 2.05886796e+02], [ 2.14838395e+02], [ 2.23789995e+02], [ 2.32741595e+02], [ 2.41693195e+02], [ 2.50644795e+02], [ 2.59596394e+02], [ 2.68547994e+02], [ 2.77499594e+02], [ 2.86451194e+02], [ 2.95402794e+02], [ 3.04354393e+02], [ 3.13305993e+02], [ 3.22257593e+02], [ 3.31209193e+02], [ 3.40160793e+02], [ 3.49112393e+02], [ 3.58063992e+02], [ 3.67015592e+02], [ 3.75967192e+02], [ 3.84918792e+02], [ 3.93870392e+02], [ 4.02821991e+02], [ 3.69599136e-01], [ 9.32119894e+00], [ 1.82727988e+01], [ 2.72243986e+01], [ 3.61759984e+01], [ 4.51275982e+01], [ 5.40791980e+01], [ 6.30307978e+01], [ 7.19823976e+01], [ 8.09339974e+01], [ 8.98855972e+01], [ 9.88371970e+01], [ 1.07788797e+02], [ 1.16740397e+02], [ 1.25691996e+02], [ 1.34643596e+02], [ 1.43595196e+02], [ 1.52546796e+02], [ 1.61498396e+02], [ 1.70449995e+02], [ 1.79401595e+02], [ 1.88353195e+02], [ 1.97304795e+02], [ 2.06256395e+02], [ 2.15207995e+02], [ 2.24159594e+02], [ 2.33111194e+02], [ 2.42062794e+02], [ 2.51014394e+02], [ 2.59965994e+02], [ 2.68917593e+02], [ 2.77869193e+02], [ 2.86820793e+02], [ 2.95772393e+02], [ 3.04723993e+02], [ 3.13675592e+02], [ 3.22627192e+02], [ 3.31578792e+02], [ 3.40530392e+02], [ 3.49481992e+02], [ 3.58433591e+02], [ 3.67385191e+02], [ 3.76336791e+02], [ 3.85288391e+02], [ 3.94239991e+02], [ 4.03191590e+02], [ 7.39198271e-01], [ 9.69079808e+00], [ 1.86423979e+01], [ 2.75939977e+01], [ 3.65455975e+01], [ 4.54971973e+01], [ 5.44487971e+01], [ 6.34003969e+01], [ 7.23519967e+01], [ 8.13035965e+01], [ 9.02551964e+01], [ 9.92067962e+01], [ 1.08158396e+02], [ 1.17109996e+02], [ 1.26061596e+02], [ 1.35013195e+02], [ 1.43964795e+02], [ 1.52916395e+02], [ 1.61867995e+02], [ 1.70819595e+02], [ 1.79771194e+02], [ 1.88722794e+02], [ 1.97674394e+02], [ 2.06625994e+02], [ 2.15577594e+02], [ 2.24529193e+02], [ 2.33480793e+02], [ 2.42432393e+02], [ 2.51383993e+02], [ 2.60335593e+02], [ 2.69287193e+02], [ 2.78238792e+02], [ 2.87190392e+02], [ 2.96141992e+02], [ 3.05093592e+02], [ 3.14045192e+02], [ 3.22996791e+02], [ 3.31948391e+02], [ 3.40899991e+02], [ 3.49851591e+02], [ 3.58803191e+02], [ 3.67754790e+02], [ 3.76706390e+02], [ 3.85657990e+02], [ 3.94609590e+02], [ 4.03561190e+02], [ 1.10879741e+00], [ 1.00603972e+01], [ 1.90119970e+01], [ 2.79635968e+01], [ 3.69151966e+01], [ 4.58667964e+01], [ 5.48183963e+01], [ 6.37699961e+01], [ 7.27215959e+01], [ 8.16731957e+01], [ 9.06247955e+01], [ 9.95763953e+01], [ 1.08527995e+02], [ 1.17479595e+02], [ 1.26431195e+02], [ 1.35382795e+02], [ 1.44334394e+02], [ 1.53285994e+02], [ 1.62237594e+02], [ 1.71189194e+02], [ 1.80140794e+02], [ 1.89092393e+02], [ 1.98043993e+02], [ 2.06995593e+02], [ 2.15947193e+02], [ 2.24898793e+02], [ 2.33850392e+02], [ 2.42801992e+02], [ 2.51753592e+02], [ 2.60705192e+02], [ 2.69656792e+02], [ 2.78608391e+02], [ 2.87559991e+02], [ 2.96511591e+02], [ 3.05463191e+02], [ 3.14414791e+02], [ 3.23366390e+02], [ 3.32317990e+02], [ 3.41269590e+02], [ 3.50221190e+02], [ 3.59172790e+02], [ 3.68124390e+02], [ 3.77075989e+02], [ 3.86027589e+02], [ 3.94979189e+02], [ 4.03930789e+02], [ 1.47839654e+00], [ 1.04299964e+01], [ 1.93815962e+01], [ 2.83331960e+01], [ 3.72847958e+01], [ 4.62363956e+01], [ 5.51879954e+01], [ 6.41395952e+01], [ 7.30911950e+01], [ 8.20427948e+01], [ 9.09943946e+01], [ 9.99459944e+01], [ 1.08897594e+02], [ 1.17849194e+02], [ 1.26800794e+02], [ 1.35752394e+02], [ 1.44703993e+02], [ 1.53655593e+02], [ 1.62607193e+02], [ 1.71558793e+02], [ 1.80510393e+02], [ 1.89461993e+02], [ 1.98413592e+02], [ 2.07365192e+02], [ 2.16316792e+02], [ 2.25268392e+02], [ 2.34219992e+02], [ 2.43171591e+02], [ 2.52123191e+02], [ 2.61074791e+02], [ 2.70026391e+02], [ 2.78977991e+02], [ 2.87929590e+02], [ 2.96881190e+02], [ 3.05832790e+02], [ 3.14784390e+02], [ 3.23735990e+02], [ 3.32687589e+02], [ 3.41639189e+02], [ 3.50590789e+02], [ 3.59542389e+02], [ 3.68493989e+02], [ 3.77445588e+02], [ 3.86397188e+02], [ 3.95348788e+02], [ 4.04300388e+02], [ 1.84799568e+00], [ 1.07995955e+01], [ 1.97511953e+01], [ 2.87027951e+01], [ 3.76543949e+01], [ 4.66059947e+01], [ 5.55575945e+01], [ 6.45091943e+01], [ 7.34607941e+01], [ 8.24123940e+01], [ 9.13639938e+01], [ 1.00315594e+02], [ 1.09267193e+02], [ 1.18218793e+02], [ 1.27170393e+02], [ 1.36121993e+02], [ 1.45073593e+02], [ 1.54025192e+02], [ 1.62976792e+02], [ 1.71928392e+02], [ 1.80879992e+02], [ 1.89831592e+02], [ 1.98783191e+02], [ 2.07734791e+02], [ 2.16686391e+02], [ 2.25637991e+02], [ 2.34589591e+02], [ 2.43541190e+02], [ 2.52492790e+02], [ 2.61444390e+02], [ 2.70395990e+02], [ 2.79347590e+02], [ 2.88299190e+02], [ 2.97250789e+02], [ 3.06202389e+02], [ 3.15153989e+02], [ 3.24105589e+02], [ 3.33057189e+02], [ 3.42008788e+02], [ 3.50960388e+02], [ 3.59911988e+02], [ 3.68863588e+02], [ 3.77815188e+02], [ 3.86766787e+02], [ 3.95718387e+02], [ 4.04669987e+02], [ 2.21759481e+00], [ 1.11691946e+01], [ 2.01207944e+01], [ 2.90723942e+01], [ 3.80239940e+01], [ 4.69755939e+01], [ 5.59271937e+01], [ 6.48787935e+01], [ 7.38303933e+01], [ 8.27819931e+01], [ 9.17335929e+01], [ 1.00685193e+02], [ 1.09636793e+02], [ 1.18588392e+02], [ 1.27539992e+02], [ 1.36491592e+02], [ 1.45443192e+02], [ 1.54394792e+02], [ 1.63346391e+02], [ 1.72297991e+02], [ 1.81249591e+02], [ 1.90201191e+02], [ 1.99152791e+02], [ 2.08104390e+02], [ 2.17055990e+02], [ 2.26007590e+02], [ 2.34959190e+02], [ 2.43910790e+02], [ 2.52862389e+02], [ 2.61813989e+02], [ 2.70765589e+02], [ 2.79717189e+02], [ 2.88668789e+02], [ 2.97620388e+02], [ 3.06571988e+02], [ 3.15523588e+02], [ 3.24475188e+02], [ 3.33426788e+02], [ 3.42378388e+02], [ 3.51329987e+02], [ 3.60281587e+02], [ 3.69233187e+02], [ 3.78184787e+02], [ 3.87136387e+02], [ 3.96087986e+02], [ 4.05039586e+02], [ 2.58719395e+00], [ 1.15387938e+01], [ 2.04903936e+01], [ 2.94419934e+01], [ 3.83935932e+01], [ 4.73451930e+01], [ 5.62967928e+01], [ 6.52483926e+01], [ 7.41999924e+01], [ 8.31515922e+01], [ 9.21031920e+01], [ 1.01054792e+02], [ 1.10006392e+02], [ 1.18957991e+02], [ 1.27909591e+02], [ 1.36861191e+02], [ 1.45812791e+02], [ 1.54764391e+02], [ 1.63715990e+02], [ 1.72667590e+02], [ 1.81619190e+02], [ 1.90570790e+02], [ 1.99522390e+02], [ 2.08473990e+02], [ 2.17425589e+02], [ 2.26377189e+02], [ 2.35328789e+02], [ 2.44280389e+02], [ 2.53231989e+02], [ 2.62183588e+02], [ 2.71135188e+02], [ 2.80086788e+02], [ 2.89038388e+02], [ 2.97989988e+02], [ 3.06941587e+02], [ 3.15893187e+02], [ 3.24844787e+02], [ 3.33796387e+02], [ 3.42747987e+02], [ 3.51699586e+02], [ 3.60651186e+02], [ 3.69602786e+02], [ 3.78554386e+02], [ 3.87505986e+02], [ 3.96457586e+02], [ 4.05409185e+02], [ 2.95679309e+00], [ 1.19083929e+01], [ 2.08599927e+01], [ 2.98115925e+01], [ 3.87631923e+01], [ 4.77147921e+01], [ 5.66663919e+01], [ 6.56179917e+01], [ 7.45695915e+01], [ 8.35211914e+01], [ 9.24727912e+01], [ 1.01424391e+02], [ 1.10375991e+02], [ 1.19327591e+02], [ 1.28279190e+02], [ 1.37230790e+02], [ 1.46182390e+02], [ 1.55133990e+02], [ 1.64085590e+02], [ 1.73037189e+02], [ 1.81988789e+02], [ 1.90940389e+02], [ 1.99891989e+02], [ 2.08843589e+02], [ 2.17795188e+02], [ 2.26746788e+02], [ 2.35698388e+02], [ 2.44649988e+02], [ 2.53601588e+02], [ 2.62553188e+02], [ 2.71504787e+02], [ 2.80456387e+02], [ 2.89407987e+02], [ 2.98359587e+02], [ 3.07311187e+02], [ 3.16262786e+02], [ 3.25214386e+02], [ 3.34165986e+02], [ 3.43117586e+02], [ 3.52069186e+02], [ 3.61020785e+02], [ 3.69972385e+02], [ 3.78923985e+02], [ 3.87875585e+02], [ 3.96827185e+02], [ 4.05778784e+02], [ 3.32639222e+00], [ 1.22779920e+01], [ 2.12295918e+01], [ 3.01811916e+01], [ 3.91327915e+01], [ 4.80843913e+01], [ 5.70359911e+01], [ 6.59875909e+01], [ 7.49391907e+01], [ 8.38907905e+01], [ 9.28423903e+01], [ 1.01793990e+02], [ 1.10745590e+02], [ 1.19697190e+02], [ 1.28648790e+02], [ 1.37600389e+02], [ 1.46551989e+02], [ 1.55503589e+02], [ 1.64455189e+02], [ 1.73406789e+02], [ 1.82358388e+02], [ 1.91309988e+02], [ 2.00261588e+02], [ 2.09213188e+02], [ 2.18164788e+02], [ 2.27116387e+02], [ 2.36067987e+02], [ 2.45019587e+02], [ 2.53971187e+02], [ 2.62922787e+02], [ 2.71874386e+02], [ 2.80825986e+02], [ 2.89777586e+02], [ 2.98729186e+02], [ 3.07680786e+02], [ 3.16632386e+02], [ 3.25583985e+02], [ 3.34535585e+02], [ 3.43487185e+02], [ 3.52438785e+02], [ 3.61390385e+02], [ 3.70341984e+02], [ 3.79293584e+02], [ 3.88245184e+02], [ 3.97196784e+02], [ 4.06148384e+02], [ 3.69599136e+00], [ 1.26475912e+01], [ 2.15991910e+01], [ 3.05507908e+01], [ 3.95023906e+01], [ 4.84539904e+01], [ 5.74055902e+01], [ 6.63571900e+01], [ 7.53087898e+01], [ 8.42603896e+01], [ 9.32119894e+01], [ 1.02163589e+02], [ 1.11115189e+02], [ 1.20066789e+02], [ 1.29018389e+02], [ 1.37969988e+02], [ 1.46921588e+02], [ 1.55873188e+02], [ 1.64824788e+02], [ 1.73776388e+02], [ 1.82727988e+02], [ 1.91679587e+02], [ 2.00631187e+02], [ 2.09582787e+02], [ 2.18534387e+02], [ 2.27485987e+02], [ 2.36437586e+02], [ 2.45389186e+02], [ 2.54340786e+02], [ 2.63292386e+02], [ 2.72243986e+02], [ 2.81195585e+02], [ 2.90147185e+02], [ 2.99098785e+02], [ 3.08050385e+02], [ 3.17001985e+02], [ 3.25953584e+02], [ 3.34905184e+02], [ 3.43856784e+02], [ 3.52808384e+02], [ 3.61759984e+02], [ 3.70711583e+02], [ 3.79663183e+02], [ 3.88614783e+02], [ 3.97566383e+02], [ 4.06517983e+02], [ 4.06559049e+00], [ 1.30171903e+01], [ 2.19687901e+01], [ 3.09203899e+01], [ 3.98719897e+01], [ 4.88235895e+01], [ 5.77751893e+01], [ 6.67267891e+01], [ 7.56783890e+01], [ 8.46299888e+01], [ 9.35815886e+01], [ 1.02533188e+02], [ 1.11484788e+02], [ 1.20436388e+02], [ 1.29387988e+02], [ 1.38339588e+02], [ 1.47291187e+02], [ 1.56242787e+02], [ 1.65194387e+02], [ 1.74145987e+02], [ 1.83097587e+02], [ 1.92049186e+02], [ 2.01000786e+02], [ 2.09952386e+02], [ 2.18903986e+02], [ 2.27855586e+02], [ 2.36807186e+02], [ 2.45758785e+02], [ 2.54710385e+02], [ 2.63661985e+02], [ 2.72613585e+02], [ 2.81565185e+02], [ 2.90516784e+02], [ 2.99468384e+02], [ 3.08419984e+02], [ 3.17371584e+02], [ 3.26323184e+02], [ 3.35274783e+02], [ 3.44226383e+02], [ 3.53177983e+02], [ 3.62129583e+02], [ 3.71081183e+02], [ 3.80032782e+02], [ 3.88984382e+02], [ 3.97935982e+02], [ 4.06887582e+02], [ 4.43518963e+00], [ 1.33867894e+01], [ 2.23383892e+01], [ 3.12899891e+01], [ 4.02415889e+01], [ 4.91931887e+01], [ 5.81447885e+01], [ 6.70963883e+01], [ 7.60479881e+01], [ 8.49995879e+01], [ 9.39511877e+01], [ 1.02902788e+02], [ 1.11854387e+02], [ 1.20805987e+02], [ 1.29757587e+02], [ 1.38709187e+02], [ 1.47660787e+02], [ 1.56612386e+02], [ 1.65563986e+02], [ 1.74515586e+02], [ 1.83467186e+02], [ 1.92418786e+02], [ 2.01370385e+02], [ 2.10321985e+02], [ 2.19273585e+02], [ 2.28225185e+02], [ 2.37176785e+02], [ 2.46128384e+02], [ 2.55079984e+02], [ 2.64031584e+02], [ 2.72983184e+02], [ 2.81934784e+02], [ 2.90886383e+02], [ 2.99837983e+02], [ 3.08789583e+02], [ 3.17741183e+02], [ 3.26692783e+02], [ 3.35644383e+02], [ 3.44595982e+02], [ 3.53547582e+02], [ 3.62499182e+02], [ 3.71450782e+02], [ 3.80402382e+02], [ 3.89353981e+02], [ 3.98305581e+02], [ 4.07257181e+02], [ 4.80478876e+00], [ 1.37563886e+01], [ 2.27079884e+01], [ 3.16595882e+01], [ 4.06111880e+01], [ 4.95627878e+01], [ 5.85143876e+01], [ 6.74659874e+01], [ 7.64175872e+01], [ 8.53691870e+01], [ 9.43207868e+01], [ 1.03272387e+02], [ 1.12223986e+02], [ 1.21175586e+02], [ 1.30127186e+02], [ 1.39078786e+02], [ 1.48030386e+02], [ 1.56981986e+02], [ 1.65933585e+02], [ 1.74885185e+02], [ 1.83836785e+02], [ 1.92788385e+02], [ 2.01739985e+02], [ 2.10691584e+02], [ 2.19643184e+02], [ 2.28594784e+02], [ 2.37546384e+02], [ 2.46497984e+02], [ 2.55449583e+02], [ 2.64401183e+02], [ 2.73352783e+02], [ 2.82304383e+02], [ 2.91255983e+02], [ 3.00207582e+02], [ 3.09159182e+02], [ 3.18110782e+02], [ 3.27062382e+02], [ 3.36013982e+02], [ 3.44965581e+02], [ 3.53917181e+02], [ 3.62868781e+02], [ 3.71820381e+02], [ 3.80771981e+02], [ 3.89723581e+02], [ 3.98675180e+02], [ 4.07626780e+02], [ 5.17438790e+00], [ 1.41259877e+01], [ 2.30775875e+01], [ 3.20291873e+01], [ 4.09807871e+01], [ 4.99323869e+01], [ 5.88839867e+01], [ 6.78355866e+01], [ 7.67871864e+01], [ 8.57387862e+01], [ 9.46903860e+01], [ 1.03641986e+02], [ 1.12593586e+02], [ 1.21545185e+02], [ 1.30496785e+02], [ 1.39448385e+02], [ 1.48399985e+02], [ 1.57351585e+02], [ 1.66303184e+02], [ 1.75254784e+02], [ 1.84206384e+02], [ 1.93157984e+02], [ 2.02109584e+02], [ 2.11061183e+02], [ 2.20012783e+02], [ 2.28964383e+02], [ 2.37915983e+02], [ 2.46867583e+02], [ 2.55819183e+02], [ 2.64770782e+02], [ 2.73722382e+02], [ 2.82673982e+02], [ 2.91625582e+02], [ 3.00577182e+02], [ 3.09528781e+02], [ 3.18480381e+02], [ 3.27431981e+02], [ 3.36383581e+02], [ 3.45335181e+02], [ 3.54286780e+02], [ 3.63238380e+02], [ 3.72189980e+02], [ 3.81141580e+02], [ 3.90093180e+02], [ 3.99044779e+02], [ 4.07996379e+02], [ 5.54398704e+00], [ 1.44955868e+01], [ 2.34471867e+01], [ 3.23987865e+01], [ 4.13503863e+01], [ 5.03019861e+01], [ 5.92535859e+01], [ 6.82051857e+01], [ 7.71567855e+01], [ 8.61083853e+01], [ 9.50599851e+01], [ 1.04011585e+02], [ 1.12963185e+02], [ 1.21914785e+02], [ 1.30866384e+02], [ 1.39817984e+02], [ 1.48769584e+02], [ 1.57721184e+02], [ 1.66672784e+02], [ 1.75624383e+02], [ 1.84575983e+02], [ 1.93527583e+02], [ 2.02479183e+02], [ 2.11430783e+02], [ 2.20382382e+02], [ 2.29333982e+02], [ 2.38285582e+02], [ 2.47237182e+02], [ 2.56188782e+02], [ 2.65140381e+02], [ 2.74091981e+02], [ 2.83043581e+02], [ 2.91995181e+02], [ 3.00946781e+02], [ 3.09898381e+02], [ 3.18849980e+02], [ 3.27801580e+02], [ 3.36753180e+02], [ 3.45704780e+02], [ 3.54656380e+02], [ 3.63607979e+02], [ 3.72559579e+02], [ 3.81511179e+02], [ 3.90462779e+02], [ 3.99414379e+02], [ 4.08365978e+02], [ 5.91358617e+00], [ 1.48651860e+01], [ 2.38167858e+01], [ 3.27683856e+01], [ 4.17199854e+01], [ 5.06715852e+01], [ 5.96231850e+01], [ 6.85747848e+01], [ 7.75263846e+01], [ 8.64779844e+01], [ 9.54295843e+01], [ 1.04381184e+02], [ 1.13332784e+02], [ 1.22284384e+02], [ 1.31235983e+02], [ 1.40187583e+02], [ 1.49139183e+02], [ 1.58090783e+02], [ 1.67042383e+02], [ 1.75993983e+02], [ 1.84945582e+02], [ 1.93897182e+02], [ 2.02848782e+02], [ 2.11800382e+02], [ 2.20751982e+02], [ 2.29703581e+02], [ 2.38655181e+02], [ 2.47606781e+02], [ 2.56558381e+02], [ 2.65509981e+02], [ 2.74461580e+02], [ 2.83413180e+02], [ 2.92364780e+02], [ 3.01316380e+02], [ 3.10267980e+02], [ 3.19219579e+02], [ 3.28171179e+02], [ 3.37122779e+02], [ 3.46074379e+02], [ 3.55025979e+02], [ 3.63977578e+02], [ 3.72929178e+02], [ 3.81880778e+02], [ 3.90832378e+02], [ 3.99783978e+02], [ 4.08735578e+02], [ 6.28318531e+00], [ 1.52347851e+01], [ 2.41863849e+01], [ 3.31379847e+01], [ 4.20895845e+01], [ 5.10411843e+01], [ 5.99927842e+01], [ 6.89443840e+01], [ 7.78959838e+01], [ 8.68475836e+01], [ 9.57991834e+01], [ 1.04750783e+02], [ 1.13702383e+02], [ 1.22653983e+02], [ 1.31605583e+02], [ 1.40557182e+02], [ 1.49508782e+02], [ 1.58460382e+02], [ 1.67411982e+02], [ 1.76363582e+02], [ 1.85315181e+02], [ 1.94266781e+02], [ 2.03218381e+02], [ 2.12169981e+02], [ 2.21121581e+02], [ 2.30073181e+02], [ 2.39024780e+02], [ 2.47976380e+02], [ 2.56927980e+02], [ 2.65879580e+02], [ 2.74831180e+02], [ 2.83782779e+02], [ 2.92734379e+02], [ 3.01685979e+02], [ 3.10637579e+02], [ 3.19589179e+02], [ 3.28540778e+02], [ 3.37492378e+02], [ 3.46443978e+02], [ 3.55395578e+02], [ 3.64347178e+02], [ 3.73298777e+02], [ 3.82250377e+02], [ 3.91201977e+02], [ 4.00153577e+02], [ 4.09105177e+02]]) self.width = 0.0030000000000000001 658 xy = xy[:, :, np.newaxis] 659 XY = np.concatenate((xy.real, xy.imag), axis=2) 660 if self.Umask is not ma.nomask: 661 XY = ma.array(XY) 662 XY[self.Umask] = ma.masked 663 # This might be handled more efficiently with nans, given 664 # that nans will end up in the paths anyway. 665 666 return XY 667 668 def _h_arrows(self, length): 669 """ length is in arrow width units """ 670 # It might be possible to streamline the code 671 # and speed it up a bit by using complex (x,y) 672 # instead of separate arrays; but any gain would be slight. ValueError: operands could not be broadcast together with shapes (400,8) (828,1) *************************************************************************** History of session input:X,Y=mgrid[0:5:20j , 0:10:20j]U = X ; V = 0.7*X + 0.5*Yplt.quiver(Z , Y , hyper_bz_trunc_half[0,:,:] , hyper_by_trunc_half[0,:,:] , hyper_by_trunc_half[0,:,:], cmap=cm.Reds, scale=0.05, headwidth=8, headlength=8, angles='xy')plt.quiver(X, Y, U, V, # data U, # colour the arrows based on this array cmap=cm.seismic, # colour map headlength=7, # length of the arrows angles='xy', scale_units='xy', scale=1)figure()angles = (X * 20 + Y * 20).ravel() plt.quiver(X, Y, U, V, # data U, # colour the arrows based on this array cmap=cm.seismic, # colour map headlength=7, # length of the arrows angles=angles, scale_units='xy', scale=1)plt.quiver(X, Y, U, V, # data U, # colour the arrows based on this array cmap=cm.seismic, # colour map headlength=7, # length of the arrows angles='xy', scale=1., scale=1)plt.quiver(X, Y, U, V, # data U, # colour the arrows based on this array cmap=cm.seismic, # colour map headlength=7, # length of the arrows angles='xy', scale=1)plt.quiver(X, Y, U, V, # data U, # colour the arrows based on this array cmap=cm.seismic, # colour map headlength=7, # length of the arrows angles='xy', scale=10)plt.quiver(X, Y, U, V, # data U, # colour the arrows based on this array cmap=cm.seismic, # colour map headlength=7, # length of the arrows angles='xy', scale=30)plt.quiver(X, Y, U, V, # data U, # colour the arrows based on this array cmap=cm.seismic, # colour map headlength=7, # length of the arrows angles='xy', scale=50)plt.quiver(X, Y, U, V, # data U, # colour the arrows based on this array cmap=cm.seismic, # colour map headlength=7, # length of the arrows angles='xy', scale=60)angles = (X * 20 + Y * 20).ravel() #plt.quiver(X, Y, U, V, # data U, # colour the arrows based on this array cmap=cm.seismic, # colour map headlength=7, # length of the arrows angles=angles, scale_units='xy', scale=1)figure()#plt.quiver(X, Y, U, V, # data U, # colour the arrows based on this array cmap=cm.seismic, # colour map headlength=7, # length of the arrows angles=angles, scale_units='xy', scale=1)plt.quiver(X, Y, U, V, # data U, # colour the arrows based on this array cmap=cm.seismic, # colour map headlength=7, # length of the arrows angles=angles, scale_units='xy', scale=1)plt.quiver(X, Y, U, V, # data U, # colour the arrows based on this array cmap=cm.seismic, # colour map headlength=7, # length of the arrows angles=angles, scale_units='xy', scale=1)x = arange(4) y = arange(5) X, Y = meshgrid(x, y) u = ones_like(X) v = zeros_like(X) c = arange(u.size) # values mapped to colors angles = (X * 20 + Y * 20).ravel() quiver(X, Y, u, v, c, angles=angles) x = N.linspace(0, 1, 10)y = N.linspace(0, 1, 10)x = linspace(0, 1, 10)y = linspace(0, 1, 10)angles =linspace(0, 360, 10)P.quiver(x, y, 1, 0, angles=angles)quiver(x, y, 1, 0, angles=angles)import globimport h5pyarchivos = np.sort(glob.glob('../comp5ppc80_L1100_wces1200_nt100//*flds.tot*')) #names of the fields files in orderN = 30 #Number of snaps we want to loadistep=1if istep == 1: point=2 ghost1=2 #2 ghosts At the beginning of each array ghost2=3 #3 ghosts At the end of each array #Here we create the Hypercube containing the magnetic field of each snaphyper_bx = np.array([ np.array(h5py.File(archivos[i]).get('bx')) for i in range(N) ])hyper_by = np.array([ np.array(h5py.File(archivos[i]).get('by')) for i in range(N) ])hyper_bz = np.array([ np.array(h5py.File(archivos[i]).get('bz')) for i in range(N) ])#Here we create the Hypercube containing the electric field of each snaphyper_ex = np.array([ np.array(h5py.File(archivos[i]).get('ex')) for i in range(N) ])hyper_ey = np.array([ np.array(h5py.File(archivos[i]).get('ey')) for i in range(N) ])hyper_ez = np.array([ np.array(h5py.File(archivos[i]).get('ez')) for i in range(N) ])#Here we clean the arrays from the ghosts cellstam0 = np.shape(hyper_bx)[1]-ghost2 #z-axis (16 cells + 5 ghosts)tam1 = np.shape(hyper_bx)[2]-ghost2 #y-axis (1152 cells + 5 ghosts) #With ghost2 I wipe out the three last ghost cells#tam2 = np.shape(hyper_bx)[3]-ghost2 #x-axis (1 cell + 6 ghosts)hyper_bx_trunc=np.array([ hyper_bx[i,ghost1:tam0,ghost1:tam1,point] for i in range(N) ])hyper_by_trunc=np.array([ hyper_by[i,ghost1:tam0,ghost1:tam1,point] for i in range(N) ])hyper_bz_trunc=np.array([ hyper_bz[i,ghost1:tam0,ghost1:tam1,point] for i in range(N) ])hyper_ex_trunc=np.array([ hyper_ex[i,ghost1:tam0,ghost1:tam1,point] for i in range(N) ])hyper_ey_trunc=np.array([ hyper_ey[i,ghost1:tam0,ghost1:tam1,point] for i in range(N) ])hyper_ez_trunc=np.array([ hyper_ez[i,ghost1:tam0,ghost1:tam1,point] for i in range(N) ])nn = 25Z , Y = np.mgrid[0:tam0:(tam0*1j) , 0:tam1:(tam1*1j)/nn ]angles = (X * 20 + Y * 20).ravel() hyper_bz_trunc_half = np.array([ hyper_bz_trunc[i,:,::nn] for i in range(N) ]) #Reduce the elements taking elements nn by nnhyper_by_trunc_half = np.array([ hyper_by_trunc[i,:,::nn] for i in range(N) ]) angles = (Z * 20 + Y * 20).ravel()plt.quiver(Z , Y , hyper_bz_trunc_half[0,:,:] , hyper_by_trunc_half[0,:,:] , hyper_by_trunc_half[0,:,:], cmap=cm.Reds, scale=0.05, headwidth=8, headlength=8)plt.quiver(Z , Y , hyper_bz_trunc_half[0,:,:] , hyper_by_trunc_half[0,:,:] , hyper_by_trunc_half[0,:,:], cmap=cm.Reds, scale=0.05, headwidth=8, headlength=8, angles='xy')get_ipython().magic('config Application.verbose_crash=True')get_ipython().magic('debug')X, Y = meshgrid(x, y)X,Y=mgrid[0:5:20j , 0:10:20j]U = X ; V = 0.7*X + 0.5*Yplt.quiver(X, Y, U, V, # data U, # colour the arrows based on this array cmap=cm.seismic, # colour map headlength=7, # length of the arrows angles=angles, scale_units='xy', scale=1) *** Last line of input (may not be in above history): U = X ; V = 0.7*X + 0.5*Y From main at rassylka-info.ru Wed Apr 6 05:01:51 2016 From: main at rassylka-info.ru (Ildar Galimov) Date: Wed, 06 Apr 2016 09:01:51 +0000 Subject: [Matplotlib-users] =?utf-8?b?0JrQsNC6INC/0L7QtNC90Y/RgtGMINGN0YQ=?= =?utf-8?b?0YTQtdC60YLQuNCy0L3QvtGB0YLRjCDRgNCw0LHQvtGC0Ysg0LzQtdC00YY=?= =?utf-8?b?0LXQvdGC0YDQsCDigJMg0YDQtdCw0LvRjNC90YvQtSDQv9GA0LjQvNC10YA=?= =?utf-8?b?0Ysg0LjQtyDQv9GA0LDQutGC0LjQutC4?= Message-ID: <2694c2cf070ac944b9029f581ff96dab@rassylka-info.ru> ???????????? ??? ?????????? ????????? ??????, ??????? ?????? ? ???????????? ?? ??? ?????????? ??????-????? ?????????? ? ???????????? ????????. ????????? ????????????? ??????????????, ??????? ??????? 14 ?????? ? 13.00 (???). ??????? ??????-?????? - ?????? ??????? (?????????? ? ??????? ?????????? ? ??????????????????????? ???????) ? ????????? ?????????? (???????????? ???????? ????? ??????????? ??????? ?????, ??????????, ????????). ??????????????? ????? ???????, ????? ???? ??????????: http://information3.ru/dvexobt/low-price31425.html ??? ???? ??????-?????? ?? ????? ????????????? ???????? ?????????? ? ???????????? ???????? - ????????????? ?? ???????? ???????? ?? ????????. ?? ???????? ???????? ??????????? ?????????? ? ????????????? ??????????, ??????????? ???????? ?????????? ? ??????? ??????? ? ????????? ???. ??????? ????????? ? ??????-??????: http://information3.ru/dvexobt/low-price31425.html ?????? ?? ???????? ??? ????? ????????, ??????? ????? ??????????? ?? ??????-??????, ??????? ?????????? (???????? ? 2001 ?) ??????????? ???????? ???????????? ? ??????? ????? ?? 4 ???? (2011-2015 ??): * ????? ????????? ?????????? ? 10 000 ????????? ? ????? ?? 40 000 ????????? * ??????? ??????? ?????????? ????? 1000%, ??? ????????? ??????????? ? 10 ??? ?????? ??????? ?????? ?? ?????????? ? ????? ???????? ?????? ????????? ?? ??????-????? ? ???????? ??????? ????????????? ???? ???????? ?????????. ? ?????????, ?????? ??????? P.S. ???? ?? ?? ??????? ???????? ???????, ??? ????? ???????????????, ?? ?????? ??? ?????? ?????????: http://information3.ru/dvexobt/low-price31425.html -------------- next part -------------- An HTML attachment was scrubbed... URL: From don.morton at borealscicomp.com Fri Apr 8 19:49:25 2016 From: don.morton at borealscicomp.com (Don Morton) Date: Fri, 8 Apr 2016 16:49:25 -0700 (MST) Subject: [Matplotlib-users] Blue marble doesn't map to regional ortho projection correctly Message-ID: <1460159365106-46944.post@n5.nabble.com> Hello, I could easily be doing something wrong. I posted this issue about two years ago and never saw a response, so I'll try again. It's more of an academic question - I can work around the issue. In the following code, I'm trying to plot a regional ortho projection over central Europe (I've commented out the global projection), and then trying to use a bluemarble background. As you can see from the attached image, global bluemarble background is plotted, not a regional one. This also happens with shadedrelief and etopo. import mpl_toolkits.basemap as bm import matplotlib.pyplot as plt import numpy as np """ theMap = bm.Basemap(projection='ortho', lat_0=48.2, lon_0=16.4) """ theMap = bm.Basemap(projection='ortho', lat_0=48.2, lon_0=16.4, llcrnry=-1000000.0, llcrnrx=-1000000.0, urcrnry=1000000.0, urcrnrx=1000000.0, resolution='l', area_thresh=1000) theMap.drawcoastlines() theMap.bluemarble() plt.show() -- View this message in context: http://matplotlib.1069221.n5.nabble.com/Blue-marble-doesn-t-map-to-regional-ortho-projection-correctly-tp46944.html Sent from the matplotlib - users mailing list archive at Nabble.com. From stevenyee64 at gmail.com Sat Apr 9 22:09:05 2016 From: stevenyee64 at gmail.com (steeeve12) Date: Sat, 9 Apr 2016 19:09:05 -0700 (MST) Subject: [Matplotlib-users] 'Poly3DCollection' object has no attribute '_facecolors2d' In-Reply-To: References: Message-ID: <1460254145760-46945.post@n5.nabble.com> I am still receiving this same error message when executing the line below. hb_made is a hexbin PolyCollection that I am trying to convert into a Poly3DCollection. I think this is an unresolved issue (https://github.com/matplotlib/matplotlib/pull/4090 and https://github.com/matplotlib/matplotlib/issues/4067) ax.add_collection3d(hb_made, zs=shotNumber.get_array(), zdir='y') -- View this message in context: http://matplotlib.1069221.n5.nabble.com/Poly3DCollection-object-has-no-attribute-facecolors2d-tp44809p46945.html Sent from the matplotlib - users mailing list archive at Nabble.com. From pmhobson at gmail.com Sun Apr 17 10:17:36 2016 From: pmhobson at gmail.com (Paul Hobson) Date: Sun, 17 Apr 2016 07:17:36 -0700 Subject: [Matplotlib-users] ImportError: No module named axes_grid1 In-Reply-To: <1459740263201-46936.post@n5.nabble.com> References: <1459740263201-46936.post@n5.nabble.com> Message-ID: Can you provide more details? How did you install matplotlib? What version? What version of python? What operating system? etc etc On Sun, Apr 3, 2016 at 8:24 PM, lyzhangjm wrote: > Hi, I have installed matplotlib. However, the following is error. > > from mpl_toolkits.axes_grid1 import make_axes_locatable > > what is the reason ? > thanks > > > > -- > View this message in context: > http://matplotlib.1069221.n5.nabble.com/ImportError-No-module-named-axes-grid1-tp46936.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben.v.root at gmail.com Sun Apr 17 10:43:25 2016 From: ben.v.root at gmail.com (Benjamin Root) Date: Sun, 17 Apr 2016 10:43:25 -0400 Subject: [Matplotlib-users] Question about Crash Report Ipython - Error In-Reply-To: <57030193.4040905@astro.puc.cl> References: <57030193.4040905@astro.puc.cl> Message-ID: The key message is in the crash report: "ValueError: operands could not be broadcast together with shapes (400,8) (828,1)" Quite likely, this may have been part of the problem for the original bug, too. On Mon, Apr 4, 2016 at 8:06 PM, Francisco Ley wrote: > Hi, > > My name is Francisco and I'm a python and ipython user. Today I was coding > in python a little bit, in particular with the function quiver, in > matplotlib. I got an error when I tried to use the option > > angles='xy' > > A problem related with the broadcasting arose. It was really strange > because if I used another arrays it worked. Anyways, when I continued > trying some options another error arose, Ipython crashes and a report file > was created. I was wondering if you could help me with that, or tell me > where can I ask for help, honestly I don't know what else I can do for now. > The file is attached. > > Thank you in advance, > Regards, > > Francisco > > > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben.v.root at gmail.com Sun Apr 17 10:51:28 2016 From: ben.v.root at gmail.com (Benjamin Root) Date: Sun, 17 Apr 2016 10:51:28 -0400 Subject: [Matplotlib-users] perspective In-Reply-To: <6F355DF7-0518-484D-A066-6519E47462BA@gmail.com> References: <6F355DF7-0518-484D-A066-6519E47462BA@gmail.com> Message-ID: Sorry for the long delay in replying. It seems like your email got held up on the listserve. Looking at perps(), it seems like it is just doing ax.plot_wireframe() and some camera angle settings, which can be set via ax.view_init(): | view_init(self, elev=None, azim=None) | Set the elevation and azimuth of the axes. | | This can be used to rotate the axes programatically. | | 'elev' stores the elevation angle in the z plane. | 'azim' stores the azimuth angle in the x,y plane. | | if elev or azim are None (default), then the initial value | is used which was specified in the :class:`Axes3D` constructor. Does that help? Cheers! Ben Root On Mon, Mar 21, 2016 at 5:37 AM, Eric Gayer wrote: > Hi all, > I am not sure this is the right place for my question, but I don?t really > know where to ask? > I would like to know if there is a chance for matplolib to provide the > same 3D plot perspective as the perp() function in R or from the > plot3D package from Karline Soetaert (based on persp()) in R > > http://www.r-bloggers.com/creating-surface-plots/ > > http://www.r-bloggers.com/3d-plots-in-r/ > > I found nothing on how to change perspective aspect in mplot3d. I am > afraid it is not possible to work on the depth of the perspective in a > mplot3d plot, is anyone knows how to do it ? > > Does anyone think it would be possible in a near future ? > > Thanks > Eric > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben.v.root at gmail.com Sun Apr 17 11:04:33 2016 From: ben.v.root at gmail.com (Benjamin Root) Date: Sun, 17 Apr 2016 11:04:33 -0400 Subject: [Matplotlib-users] Matplotlib set_array slow in comparison with cv2 In-Reply-To: <1459801463648-46938.post@n5.nabble.com> References: <1459801463648-46938.post@n5.nabble.com> Message-ID: Which version of matplotlib are you using? We recently overhauled our image architecture, so displaying should be faster. There may also be other issues at play here, such as whether the interactivity mode is on or off, which backend is in use, and also all of the additional rendering that may be needed (ticks, plotting area, etc., that opencv may not be handling. Also, it would be good to know what your benchmark results are. We would be concerned if there was a significant difference in performance (orders of magnitude), but it isn't like we are aiming for doing playback of 4K videos at 100fps, either... Cheers! Ben Root On Mon, Apr 4, 2016 at 4:24 PM, coquelicot wrote: > Compare the following 2 codes: > > import matplotlib.pyplot as plt > import cv2 > > def grab_frame(i): #this function simply grab frame i from an image > folder or a video > ... > return img_array_like_returned_by_imread_or_cv2.imread > > #remove the following two lines to test with opencv: > fr = grab_frame(0) > img = plt.imshow(fr) > > for i in range(0,300): > fr = grab_frame(i) > img.set_array(fr) > plt.pause(0.001) > > #replace the previous 2 lines by the following 2 lines to > #compare with opencv: > > #cv2.imshow('frame', fr) > #if cv2.waitKey(1) & 0xFF == ord('q'): break > My questions are: > > 1) why is set_array much slower than cv2.imshow ? > > 2) is it possible to improve this, say by tricking some function of > matplotlib ? > > > > -- > View this message in context: > http://matplotlib.1069221.n5.nabble.com/Matplotlib-set-array-slow-in-comparison-with-cv2-tp46938.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben.v.root at gmail.com Sun Apr 17 12:27:24 2016 From: ben.v.root at gmail.com (Benjamin Root) Date: Sun, 17 Apr 2016 12:27:24 -0400 Subject: [Matplotlib-users] perspective In-Reply-To: References: <6F355DF7-0518-484D-A066-6519E47462BA@gmail.com> Message-ID: I see what you mean. There have been some people asking for that feature. And there is some preliminary support for it built in, in fact. In mplot3d.proj3d, there is: ``` def persp_transformation(zfront, zback): a = (zfront+zback)/(zfront-zback) b = -2*(zfront*zback)/(zfront-zback) return np.array([[1,0,0,0], [0,1,0,0], [0,0,a,b], [0,0,-1,0] ]) ``` However, I haven't looked into integrating it into mplot3d (pull requests are welcomed). Some people have done some hacking, but I never heard back on the results of it. I think if you search the mailing list archives for perspective projection, you might find some tidbits. Seriously, projections are not my specialty, so pull requests would be greatly welcomed! Ben Root On Sun, Apr 17, 2016 at 12:17 PM, Eric Gayer wrote: > Hi Ben, > > Thanks for your answer, maybe I didn?t well explained what I was looking > for, I did play around with ax.view_init() but there is no elevation or > angle that change anything in the way the perspective is presented. > What I am looking for is to find a way (and I am actually not sure it is > possible) to change apparent depth of the 3D view. > I attached an image that show the difference between the two > representations (persp() and plot_wireframe with ax_init(60,30)) > We feel a greater depth with the R figure than with matplotlib. Closest > thing seems bigger in the R plot. Comparing R plot to Matplolib plot it is > like comparing perspective view to orthographic view. > > I hope you see what I mean :) I don?t really know how to explain it > actually. > Basically it would be awesome if we could change something like the > perspective factor with matplotlib, so we could chose how big would appear > closest things and then how small would appear farthest things. > > Thanks again for your help > Eric > > > > On Apr 17, 2016, at 4:51 PM, Benjamin Root wrote: > > Sorry for the long delay in replying. It seems like your email got held up > on the listserve. > > Looking at perps(), it seems like it is just doing ax.plot_wireframe() and > some camera angle settings, which can be set via ax.view_init(): > > | view_init(self, elev=None, azim=None) > | Set the elevation and azimuth of the axes. > | > | This can be used to rotate the axes programatically. > | > | 'elev' stores the elevation angle in the z plane. > | 'azim' stores the azimuth angle in the x,y plane. > | > | if elev or azim are None (default), then the initial value > | is used which was specified in the :class:`Axes3D` constructor. > > Does that help? > > Cheers! > Ben Root > > > > On Mon, Mar 21, 2016 at 5:37 AM, Eric Gayer wrote: > >> Hi all, >> I am not sure this is the right place for my question, but I don?t really >> know where to ask? >> I would like to know if there is a chance for matplolib to provide the >> same 3D plot perspective as the perp() function in R or from the >> plot3D package from Karline Soetaert (based on persp()) in R >> >> http://www.r-bloggers.com/creating-surface-plots/ >> >> http://www.r-bloggers.com/3d-plots-in-r/ >> >> I found nothing on how to change perspective aspect in mplot3d. I am >> afraid it is not possible to work on the depth of the perspective in a >> mplot3d plot, is anyone knows how to do it ? >> >> Does anyone think it would be possible in a near future ? >> >> Thanks >> Eric >> >> _______________________________________________ >> Matplotlib-users mailing list >> Matplotlib-users at python.org >> https://mail.python.org/mailman/listinfo/matplotlib-users >> >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: example.png Type: image/png Size: 149748 bytes Desc: not available URL: From selasley at icloud.com Sun Apr 17 16:58:10 2016 From: selasley at icloud.com (Scott Lasley) Date: Sun, 17 Apr 2016 16:58:10 -0400 Subject: [Matplotlib-users] New matplotlib book: Mastering matplotlib In-Reply-To: <1458846438461-46920.post@n5.nabble.com> References: <1458846438461-46920.post@n5.nabble.com> Message-ID: From the Preface - "For this book, you will need Python 3.4.2 or a later version of this as is available with Ubuntu 15.04 and Mac OS X 10.10. This book was written using Python 3.4.2 on Mac OS X." Do you have python 3.4 installed? The book points out that make will not work with python 2 and it didn't work on my mac with python 3.5 installed but no python 3.4 installed. make worked on my mac after installing python 3.4.4. Hope this helps, Scott > On Mar 24, 2016, at 15:07, jungleb77 wrote: > > Hi Duncan, > > I just bought your book, I'm excited to get through it. I'm wondering if the > 'make' commands are supposed to work in OS X? I tried following the > examples in the first couple of chapters and the make errors out with some > files not found. > > Any ideas? > > thanks again, > > John Brodie From ben.v.root at gmail.com Mon Apr 18 12:31:10 2016 From: ben.v.root at gmail.com (Benjamin Root) Date: Mon, 18 Apr 2016 12:31:10 -0400 Subject: [Matplotlib-users] Blue marble doesn't map to regional ortho projection correctly In-Reply-To: <1460159365106-46944.post@n5.nabble.com> References: <1460159365106-46944.post@n5.nabble.com> Message-ID: Indeed, that is obviously wrong. Could you file a bug report up on basemap's github page? Basemap is now under new management, so I will see what I can do to address the problem for you. Cheers! Ben Root On Fri, Apr 8, 2016 at 7:49 PM, Don Morton wrote: > Hello, > > I could easily be doing something wrong. I posted this issue about two > years ago and never saw a response, so I'll try again. It's more of an > academic question - I can work around the issue. In the following code, > I'm > trying to plot a regional ortho projection over central Europe (I've > commented out the global projection), and then trying to use a bluemarble > background. As you can see from the attached image, global bluemarble > background is plotted, not a regional one. This also happens with > shadedrelief and etopo. > > > > import mpl_toolkits.basemap as bm > import matplotlib.pyplot as plt > import numpy as np > > """ > theMap = bm.Basemap(projection='ortho', > lat_0=48.2, lon_0=16.4) > """ > > theMap = bm.Basemap(projection='ortho', > lat_0=48.2, lon_0=16.4, > llcrnry=-1000000.0, llcrnrx=-1000000.0, > urcrnry=1000000.0, urcrnrx=1000000.0, > resolution='l', area_thresh=1000) > > theMap.drawcoastlines() > theMap.bluemarble() > > plt.show() > > > > > -- > View this message in context: > http://matplotlib.1069221.n5.nabble.com/Blue-marble-doesn-t-map-to-regional-ortho-projection-correctly-tp46944.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From selasley at icloud.com Mon Apr 18 12:35:33 2016 From: selasley at icloud.com (Scott Lasley) Date: Mon, 18 Apr 2016 12:35:33 -0400 Subject: [Matplotlib-users] New matplotlib book: Mastering matplotlib In-Reply-To: References: <1458846438461-46920.post@n5.nabble.com> Message-ID: <8DAC739C-F800-4844-A56E-4F926F03F615@icloud.com> Here's how I got the first couple of notebooks to run under python 3.5 - Run the make command. This will a few install .mk files in the include directory but fail because python3.4 and pip3.4 are not available. Edit the Makefile and all files in the include directory and change all occurrences of python3.4 to python3 and all occurrences of pip3.4 to pip3. Run make again. On my mac it worked but venv overwrote packages in my site-packages directory with the older versions specified in the files in the requirements directory. I thought venv environments were isolated from the installed packages so I'm not sure why it did that. After that it just seemed easier to install python 3.4 from python.org I suppose you could make your own virtual environment named .venv-mmpl in a directory containing the cloned git directories and populate it with the packages in the various requirements files but I didn't try that. Anaconda may install enough of the required packages that the notebooks would work with anaconda's ipython/jupyter without running make or making a virtual envionment, but I didn't try that either. Best regards, Scott > On Apr 18, 2016, at 09:54, John Brodie wrote: > > Thanks Scott, > > I'm running 3.5.1 (Anaconda). > I'll think about installing 3.4 or perhaps digging deeper into the problem to see if I can make it work on 3.5. > > --John > > On Sun, Apr 17, 2016 at 1:58 PM Scott Lasley wrote: > From the Preface - "For this book, you will need Python 3.4.2 or a later version of this as is available with Ubuntu 15.04 and Mac OS X 10.10. This book was written using Python 3.4.2 on Mac OS X." > > Do you have python 3.4 installed? The book points out that make will not work with python 2 and it didn't work on my mac with python 3.5 installed but no python 3.4 installed. make worked on my mac after installing python 3.4.4. > > Hope this helps, > Scott > > > On Mar 24, 2016, at 15:07, jungleb77 wrote: > > > > Hi Duncan, > > > > I just bought your book, I'm excited to get through it. I'm wondering if the > > 'make' commands are supposed to work in OS X? I tried following the > > examples in the first couple of chapters and the make errors out with some > > files not found. > > > > Any ideas? > > > > thanks again, > > > > John Brodie > From ben.v.root at gmail.com Mon Apr 18 12:39:37 2016 From: ben.v.root at gmail.com (Benjamin Root) Date: Mon, 18 Apr 2016 12:39:37 -0400 Subject: [Matplotlib-users] Has label grouping made it into the matplotlib features yet? In-Reply-To: References: Message-ID: I have seen fleeting suggestions for it a long time ago, but I don't think anybody ever ran with it. Feel free to file a feature request for it on the github pages. Cheers! Ben Root P.S. - The mailing list has moved to python.org now, so the sourceforge mailing list doesn't get much monitoring anymore. On Sat, Apr 16, 2016 at 9:20 PM, Dino Bekte?evi? wrote: > I've run into this SO question a year or so ago > > > http://stackoverflow.com/questions/19184484/how-to-add-group-labels-for-bar-charts-in-matplotlib > > and have recently run into several questions similar to it again. I'm not > aware that this is available in any form or fashion from the matplotlib > main features unless users reuse his code or make their own. > > My question is: does this feature exist somewhere in mpl and I'm just > unaware of it? If there's not is it in the planned features list? > > I think it's a worthwhile feature to have and from what I see there's a > lot of people asking similar questions already. > > Thanks, > Dino > > > ------------------------------------------------------------------------------ > Find and fix application performance issues faster with Applications > Manager > Applications Manager provides deep performance insights into multiple > tiers of > your business applications. It resolves application problems quickly and > reduces your MTTR. Get your free trial! > https://ad.doubleclick.net/ddm/clk/302982198;130105516;z > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ljetibo at gmail.com Tue Apr 19 20:54:17 2016 From: ljetibo at gmail.com (=?UTF-8?B?RGlubyBCZWt0ZcWhZXZpxIc=?=) Date: Wed, 20 Apr 2016 02:54:17 +0200 Subject: [Matplotlib-users] Has label grouping made it into the matplotlib features yet? Message-ID: I forgot to open the feature request for this. Will try to open one tomorrow morning. With the way my schedule looks lately I doubt I'd make a lot of progress but if I were to find some time and try, where would I start? Dino > Message: 3 > Date: Mon, 18 Apr 2016 12:39:37 -0400 > From: Benjamin Root > To: Dino Bekte?evi? , matplotlib-users at python.org > Subject: Re: [Matplotlib-users] Has label grouping made it into the > matplotlib features yet? > Message-ID: > < CANNq6Fnw6xw4nqyB1zD0GNiug-drpdUvY0bYC2e05oqnkd9Dbw at mail.gmail.com> > Content-Type: text/plain; charset="utf-8" > > I have seen fleeting suggestions for it a long time ago, but I don't think > anybody ever ran with it. Feel free to file a feature request for it on the > github pages. > > Cheers! > Ben Root > > P.S. - The mailing list has moved to python.org now, so the sourceforge > mailing list doesn't get much monitoring anymore. > > > On Sat, Apr 16, 2016 at 9:20 PM, Dino Bekte?evi? wrote: > > > I've run into this SO question a year or so ago > > > > > > http://stackoverflow.com/questions/19184484/how-to-add-group-labels-for-bar-charts-in-matplotlib > > > > and have recently run into several questions similar to it again. I'm not > > aware that this is available in any form or fashion from the matplotlib > > main features unless users reuse his code or make their own. > > > > My question is: does this feature exist somewhere in mpl and I'm just > > unaware of it? If there's not is it in the planned features list? > > > > I think it's a worthwhile feature to have and from what I see there's a > > lot of people asking similar questions already. > > > > Thanks, > > Dino > > > > > > ------------------------------------------------------------------------------ > > Find and fix application performance issues faster with Applications > > Manager > > Applications Manager provides deep performance insights into multiple > > tiers of > > your business applications. It resolves application problems quickly and > > reduces your MTTR. Get your free trial! > > https://ad.doubleclick.net/ddm/clk/302982198;130105516;z > > _______________________________________________ > > Matplotlib-users mailing list > > Matplotlib-users at lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < http://mail.python.org/pipermail/matplotlib-users/attachments/20160418/4f5180a1/attachment-0001.html > > > ------------------------------ > > Subject: Digest Footer > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > > > ------------------------------ > > End of Matplotlib-users Digest, Vol 9, Issue 15 > *********************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben.v.root at gmail.com Tue Apr 19 21:05:55 2016 From: ben.v.root at gmail.com (Benjamin Root) Date: Tue, 19 Apr 2016 21:05:55 -0400 Subject: [Matplotlib-users] Has label grouping made it into the matplotlib features yet? In-Reply-To: References: Message-ID: For something like this, I would first focus on the api design. We do not treat API changes lightly, so you will want to make sure that the API makes sense and is easy to use. Also, one needs to think about how to validate such inputs and properly detect malformed inputs. What should happen if one changes tick labels? Should one be able to set these via a separate method as well as through bar()? Are there other plotting functions that should be augmented? The notes one would usually make in this process usually becomes the basis for the documentation and unit tests. Cheers! Ben Root On Tue, Apr 19, 2016 at 8:54 PM, Dino Bekte?evi? wrote: > I forgot to open the feature request for this. Will try to open one > tomorrow morning. With the way my schedule looks lately I doubt I'd make a > lot of progress but if I were to find some time and try, where would I > start? > > Dino > > > > Message: 3 > > Date: Mon, 18 Apr 2016 12:39:37 -0400 > > From: Benjamin Root > > To: Dino Bekte?evi? , matplotlib-users at python.org > > Subject: Re: [Matplotlib-users] Has label grouping made it into the > > matplotlib features yet? > > Message-ID: > > < > CANNq6Fnw6xw4nqyB1zD0GNiug-drpdUvY0bYC2e05oqnkd9Dbw at mail.gmail.com> > > Content-Type: text/plain; charset="utf-8" > > > > I have seen fleeting suggestions for it a long time ago, but I don't > think > > anybody ever ran with it. Feel free to file a feature request for it on > the > > github pages. > > > > Cheers! > > Ben Root > > > > P.S. - The mailing list has moved to python.org now, so the sourceforge > > mailing list doesn't get much monitoring anymore. > > > > > > On Sat, Apr 16, 2016 at 9:20 PM, Dino Bekte?evi? > wrote: > > > > > I've run into this SO question a year or so ago > > > > > > > > > > http://stackoverflow.com/questions/19184484/how-to-add-group-labels-for-bar-charts-in-matplotlib > > > > > > and have recently run into several questions similar to it again. I'm > not > > > aware that this is available in any form or fashion from the matplotlib > > > main features unless users reuse his code or make their own. > > > > > > My question is: does this feature exist somewhere in mpl and I'm just > > > unaware of it? If there's not is it in the planned features list? > > > > > > I think it's a worthwhile feature to have and from what I see there's a > > > lot of people asking similar questions already. > > > > > > Thanks, > > > Dino > > > > > > > > > > ------------------------------------------------------------------------------ > > > Find and fix application performance issues faster with Applications > > > Manager > > > Applications Manager provides deep performance insights into multiple > > > tiers of > > > your business applications. It resolves application problems quickly > and > > > reduces your MTTR. Get your free trial! > > > https://ad.doubleclick.net/ddm/clk/302982198;130105516;z > > > _______________________________________________ > > > Matplotlib-users mailing list > > > Matplotlib-users at lists.sourceforge.net > > > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > > > > > > > -------------- next part -------------- > > An HTML attachment was scrubbed... > > URL: < > http://mail.python.org/pipermail/matplotlib-users/attachments/20160418/4f5180a1/attachment-0001.html > > > > > > ------------------------------ > > > > Subject: Digest Footer > > > > _______________________________________________ > > Matplotlib-users mailing list > > Matplotlib-users at python.org > > https://mail.python.org/mailman/listinfo/matplotlib-users > > > > > > ------------------------------ > > > > End of Matplotlib-users Digest, Vol 9, Issue 15 > > *********************************************** > > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pmhobson at gmail.com Wed Apr 20 10:22:49 2016 From: pmhobson at gmail.com (Paul Hobson) Date: Wed, 20 Apr 2016 07:22:49 -0700 Subject: [Matplotlib-users] [ANN] New release of mpl-probscale (v0.1.1) Message-ID: Just wanted to let everyone know that I cut a new release of mpl-probscales. http://phobson.github.io/mpl-probscale/ It's available through my conda channel and now pip: conda install mpl-probscale --channel=phobson or pip install probscale What Is It? mpl-probscale let's you use probability scales in on matplotlib axes. In addition to the scales themselves, mpl-probscale has a high-level plotting function for creating probability, quantile, and percentile plots and adding best-fit line. Probability plots, in this case, use the same scale as a quantile plot. However, the values are represented as (non-exceedance) probabilities rather than z-scores, making them a bit more intuitive. What's New? * top-level probability plot function is mappable across seaborn FacetGrids[1] * removed dependency on scipy * users can now specify how plotting positions should be computed ? la scipy.stats.mstats.plotting_positions[2] [1] http://phobson.github.io/mpl-probscale/tutorial/getting_started.html#working-with-seaborn-facetgrids [2] http://phobson.github.io/mpl-probscale/viz.html#probscale.viz.plot_pos Python 2.7, 3.4, and 3.5 are supported. Documentation: http://phobson.github.io/mpl-probscale/ Github: https://github.com/phobson/mpl-probscale Anaconda: https://anaconda.org/phobson/mpl-probscale PyPI: https://pypi.python.org/pypi/probscale/0.1.1 Cheers, Paul -------------- next part -------------- An HTML attachment was scrubbed... URL: From john.kelley at idcastings.com Wed Apr 20 17:45:12 2016 From: john.kelley at idcastings.com (jkelleyus) Date: Wed, 20 Apr 2016 14:45:12 -0700 (MST) Subject: [Matplotlib-users] Logging Data to SQL server Message-ID: <1461188712864-46975.post@n5.nabble.com> All, Please forgive me if this has been asked and answered..I couldn't locate any information in the archives. We have an application running on Raspian which plots metal cooling times and uses the data to present several results. These results are presented on the plot. What I'd like to do is grab these numbers and log them into a SQL DB with timestamp. Is this easily done...and if so, can anyone point me in the right direction? If I could get the data written to something as a text file, I could use our SQL server to grab it from there...or are there more elegant solutions? Any help and or advice would be greatly appreciated. Thanks!!! -- View this message in context: http://matplotlib.1069221.n5.nabble.com/Logging-Data-to-SQL-server-tp46975.html Sent from the matplotlib - users mailing list archive at Nabble.com. From pmhobson at gmail.com Wed Apr 20 18:07:35 2016 From: pmhobson at gmail.com (Paul Hobson) Date: Wed, 20 Apr 2016 15:07:35 -0700 Subject: [Matplotlib-users] Logging Data to SQL server In-Reply-To: <1461188712864-46975.post@n5.nabble.com> References: <1461188712864-46975.post@n5.nabble.com> Message-ID: This logging the values to a DB seems orthogonal to the fact that you've plotted them. Your application is reading in the data from somewhere before feeding it to the plot, so there's no reason matplotlib needs to be involved at all. You could use an ORM like SQLAlchemy to write your data to the DB. I would post this question that mailing list. -p On Wed, Apr 20, 2016 at 2:45 PM, jkelleyus wrote: > All, > > Please forgive me if this has been asked and answered..I couldn't locate > any > information in the archives. > > We have an application running on Raspian which plots metal cooling times > and uses the data to present several results. These results are presented > on > the plot. > > What I'd like to do is grab these numbers and log them into a SQL DB with > timestamp. Is this easily done...and if so, can anyone point me in the > right > direction? > > If I could get the data written to something as a text file, I could use > our > SQL server to grab it from there...or are there more elegant solutions? > > Any help and or advice would be greatly appreciated. Thanks!!! > > > > -- > View this message in context: > http://matplotlib.1069221.n5.nabble.com/Logging-Data-to-SQL-server-tp46975.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gml at garymlewis.com Thu Apr 21 11:00:14 2016 From: gml at garymlewis.com (gml at garymlewis.com) Date: Thu, 21 Apr 2016 11:00:14 -0400 Subject: [Matplotlib-users] errors when mp4 files played in browser Message-ID: <7b1d841b898522d5f8555e1188bb6bca@garymlewis.com> I've been using matplotlib's animation capability to produce mp4 files. No problems when the mp4 is viewed in a video player. But viewing the files in a browser is another story. With Ubuntu 15.10 and Firefox 45.0.2, for example, I get a message "Video can't be played because the file is corrupt." The problem is easily reproducible with several of the animation examples on matplotlib; eg, see: http://matplotlib.org/examples/animation/basic_example_writer.html. This produces two mp4 files: lines.mp4 (created with FuncAnimation) and im.mp4 (created with ArtistAnimation). Neither mp4 opens in Firefox for me. I also get the same result when using an animation saved with extra_args=['-vcodec', 'libx264'] that Jake Vanderplas recommends. My wife gets the same result on her Mac when using Firefox and Safari, but Chrome works fine. From a web search, I'd say the problem is browser related. For more details, see: https://bugzilla.mozilla.org/show_bug.cgi?id=987894 or https://support.mozilla.org/en-US/questions/1047078 So I'm not expecting the folks at matplotlib to have a solution for a browser issue. But I'd really like to make a few animations available on the web. That seems to imply the use of a web browser to view the files. Certainly that would be the most natural action; just click on the link to view the animation. My question then comes to this: does anyone on the matplotlib forum have experience with viewing mp4 files in a browser? If so, do you have any suggestions for a work-around? I've literally spent months getting a few matplotlib animations to the point where they may be useful to others. It never occurred to me that I'd have problems at the very last link in the chain. Thanks very much for your thoughts. Sorry this is so long. Gary From rmay31 at gmail.com Fri Apr 22 00:45:06 2016 From: rmay31 at gmail.com (Ryan May) Date: Thu, 21 Apr 2016 22:45:06 -0600 Subject: [Matplotlib-users] errors when mp4 files played in browser In-Reply-To: <7b1d841b898522d5f8555e1188bb6bca@garymlewis.com> References: <7b1d841b898522d5f8555e1188bb6bca@garymlewis.com> Message-ID: > > > My question then comes to this: does anyone on the matplotlib forum have > experience with viewing mp4 files in a browser? If so, do you have any > suggestions for a work-around? I've literally spent months getting a few > matplotlib animations to the point where they may be useful to others. It > never occurred to me that I'd have problems at the very last link in the > chain. > > Thanks very much for your thoughts. Sorry this is so long. > I've put some effort into making sure the animations will render in the Jupyter Notebook, so I'm curious: on the platforms where you're seeing problems, what do they do with the movie at the bottom of this notebook http://nbviewer.jupyter.org/gist/dopplershift/356f2e14832e9b676207 ? Ryan -- Ryan May -------------- next part -------------- An HTML attachment was scrubbed... URL: From sebastian at sipsolutions.net Fri Apr 22 02:33:55 2016 From: sebastian at sipsolutions.net (Sebastian Berg) Date: Fri, 22 Apr 2016 08:33:55 +0200 Subject: [Matplotlib-users] errors when mp4 files played in browser In-Reply-To: References: <7b1d841b898522d5f8555e1188bb6bca@garymlewis.com> Message-ID: <1461306835.2479.1.camel@sipsolutions.net> I had similar problems recently due to ffmpeg changing some defaults for the encoding. After realizing this was the problem, searching for it and adding the correct extra arguments for the movie creation to be passed to ffmpeg quickly solved the issue. - Sebastian On Do, 2016-04-21 at 22:45 -0600, Ryan May wrote: > > My question then comes to this: does anyone on the matplotlib forum > > have experience with viewing mp4 files in a browser? If so, do you > > have any suggestions for a work-around? I've literally spent months > > getting a few matplotlib animations to the point where they may be > > useful to others. It never occurred to me that I'd have problems at > > the very last link in the chain. > > > > Thanks very much for your thoughts. Sorry this is so long. > I've put some effort into making sure the animations will render in > the Jupyter Notebook, so I'm curious: on the platforms where you're > seeing problems, what do they do with the movie at the bottom of this > notebook > > http://nbviewer.jupyter.org/gist/dopplershift/356f2e14832e9b676207 > > ? > > Ryan > > -- > Ryan May > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: This is a digitally signed message part URL: From alain.muls at gmail.com Fri Apr 22 05:28:59 2016 From: alain.muls at gmail.com (amuls) Date: Fri, 22 Apr 2016 02:28:59 -0700 (MST) Subject: [Matplotlib-users] fille area under a step function Message-ID: <1461317339526-46991.post@n5.nabble.com> Hi All I make a plot of visible satellites at a ground station where calculations are performed every X minutes (eg 10 minutes). From these calculations I make a plot which,among other info, displays the number of visible satellites as a function of time using the drwa-style 'steps-post' (cfr line below) ax2.plot(predDates, nrVisSats, linewidth=3, color='black', drawstyle='steps-post', label='#Visible', alpha=.6) I would like to color the area between the time-axis and this line but I cannot find how to do that for a 'step' function. Tx for any help. Alain -- View this message in context: http://matplotlib.1069221.n5.nabble.com/fille-area-under-a-step-function-tp46991.html Sent from the matplotlib - users mailing list archive at Nabble.com. From sdupree at computational-astronomer.com Fri Apr 22 13:07:45 2016 From: sdupree at computational-astronomer.com (Samuel Dupree) Date: Fri, 22 Apr 2016 13:07:45 -0400 Subject: [Matplotlib-users] Attempting to get animated plot to work in this example Message-ID: <02dae52c-2815-9da5-e583-96d5ce2a5ec5@computational-astronomer.com> I'm running matplotlib ver. 1.5.1 in an anaconda distribution on a MacBook Pro running Mac OS X ver. 10.11.4 (El Capitan). I'm attempting to get the animation portion of the example attached to this note running. I've looked through the on-line documentation on plot() and plot3d() but have turned up empty. Any thoughts. Sam Dupree. -------------- next part -------------- #!/usr/bin/env python # -*- coding: utf-8 -*- from numpy import radians from scipy.constants import kilo from orbital import earth, KeplerianElements, Maneuver, plot, plot3d import matplotlib.pyplot as plt plt.switch_backend('QT4Agg') # Create molniya orbit from period and eccentricity from orbital import earth_sidereal_day molniya = KeplerianElements.with_period( earth_sidereal_day / 2, e=0.741, i=radians(63.4), arg_pe=radians(270), body=earth) # Simple circular orbit orbit = KeplerianElements.with_altitude(1000 * kilo, body=earth) ## Simple plots plot(molniya) plot3d(molniya) ## Animation plot(molniya, title='Molniya 1', animate=True) plot3d(molniya, title='Molniya 2', animate=True) ## Maneuvers man = Maneuver.hohmann_transfer_to_altitude(10000 * kilo) plot(orbit, title='Maneuver 1', maneuver=man) plot3d(orbit, title='Maneuver 2', maneuver=man) import matplotlib.pyplot as plt plt.show() From sdupree at computational-astronomer.com Fri Apr 22 13:21:02 2016 From: sdupree at computational-astronomer.com (Samuel Dupree) Date: Fri, 22 Apr 2016 13:21:02 -0400 Subject: [Matplotlib-users] Attempting to get animated plot to work in this example In-Reply-To: <571A5BB9.5090005@gmx.com> References: <02dae52c-2815-9da5-e583-96d5ce2a5ec5@computational-astronomer.com> <571A5BB9.5090005@gmx.com> Message-ID: <042e54a5-a619-3318-6fad-b347fb9f97a3@computational-astronomer.com> Static plots are output, but for the ones that are supposed to show a satellite orbiting the Earth, no animated plot appears. Sam Dupree. On 4/22/16 13:13:29, Heaven Hodges wrote: > Were there error messages, no output, etc.? What exactly is the problem? > > On 04/22/2016 10:07 AM, Samuel Dupree wrote: >> I'm running matplotlib ver. 1.5.1 in an anaconda distribution on a >> MacBook Pro running Mac OS X ver. 10.11.4 (El Capitan). I'm >> attempting to get the animation portion of the example attached to >> this note running. I've looked through the on-line documentation on >> plot() and plot3d() but have turned up empty. >> >> Any thoughts. >> >> Sam Dupree. >> >> >> >> >> _______________________________________________ >> Matplotlib-users mailing list >> Matplotlib-users at python.org >> https://mail.python.org/mailman/listinfo/matplotlib-users > > > -- > Thanks, > Heaven Hodges -- mail-signature ------------------------------------------------------------------------ Samuel H. Dupree, Jr. sdupree at computational-astronomer.com 10501 Rising Ridge Road Apartment 201 http://users.speakeasy.net/~sdupree/ Fredericksburg, VA 22407, USA HOME: 540-693-1240 WORK: 540-653-6509 FAX: 866-514-9629 / "The Greatest Show on Earth" is not on Earth. It's in Space!/ ------------------------------------------------------------------------ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: IYA-2009.jpg Type: image/jpeg Size: 10005 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: mmb_emblem-2.gif Type: image/gif Size: 3793 bytes Desc: not available URL: From pmhobson at gmail.com Fri Apr 22 13:48:45 2016 From: pmhobson at gmail.com (Paul Hobson) Date: Fri, 22 Apr 2016 10:48:45 -0700 Subject: [Matplotlib-users] Attempting to get animated plot to work in this example In-Reply-To: References: <02dae52c-2815-9da5-e583-96d5ce2a5ec5@computational-astronomer.com> Message-ID: Can you reduce this problem down to an example that doesn't involve this "orbital" module? For all we know, the issue is in there On Fri, Apr 22, 2016 at 10:41 AM, Samuel Dupree < sdupree at computational-astronomer.com> wrote: > There are two plots that should output plots showing a satellite orbiting > about the Earth. Instead the plots are static which they sjouldn't be. > > Hope this helps. > > Sam Dupree. > > > > > > On 4/22/16 13:37:17, Paul Hobson wrote: > > On Fri, Apr 22, 2016 at 10:07 AM, Samuel Dupree < > sdupree at computational-astronomer.com> wrote: > >> I'm running matplotlib ver. 1.5.1 in an anaconda distribution on a >> MacBook Pro running Mac OS X ver. 10.11.4 (El Capitan). I'm attempting to >> get the animation portion of the example attached to this note running. >> I've looked through the on-line documentation on plot() and plot3d() but >> have turned up empty. >> >> Any thoughts. >> >> Sam Dupree. >> > > What specific problems are you encountering? Does the script halt with > some error messages? If so, what are they? > > Does the script run, but fails to produce output? > > Does the script produce output, but it is not as expected? > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sdupree at computational-astronomer.com Fri Apr 22 14:06:20 2016 From: sdupree at computational-astronomer.com (Samuel Dupree) Date: Fri, 22 Apr 2016 14:06:20 -0400 Subject: [Matplotlib-users] Attempting to get animated plot to work in this example In-Reply-To: References: <02dae52c-2815-9da5-e583-96d5ce2a5ec5@computational-astronomer.com> Message-ID: <425db1f7-27b7-72ee-9927-3515976f277f@computational-astronomer.com> I can't reduce the example to a point that demonstrates my problem without the "orbital" module. However, I've done some deeper digging into the "orbital" module to find the functions that support the plotting. I've attached that source file to this note, and if you could point out any issues you may see dealing with the animate function, I would appreciate it. Sam Dupree. On 4/22/16 13:48:45, Paul Hobson wrote: > Can you reduce this problem down to an example that doesn't involve > this "orbital" module? For all we know, the issue is in there > > On Fri, Apr 22, 2016 at 10:41 AM, Samuel Dupree > > wrote: > > There are two plots that should output plots showing a satellite > orbiting about the Earth. Instead the plots are static which they > sjouldn't be. > > Hope this helps. > > Sam Dupree. > > > > > > On 4/22/16 13:37:17, Paul Hobson wrote: >> On Fri, Apr 22, 2016 at 10:07 AM, Samuel Dupree >> > > wrote: >> >> I'm running matplotlib ver. 1.5.1 in an anaconda distribution >> on a MacBook Pro running Mac OS X ver. 10.11.4 (El Capitan). >> I'm attempting to get the animation portion of the example >> attached to this note running. I've looked through the >> on-line documentation on plot() and plot3d() but have turned >> up empty. >> >> Any thoughts. >> >> Sam Dupree. >> >> >> What specific problems are you encountering? Does the script halt >> with some error messages? If so, what are they? >> >> Does the script run, but fails to produce output? >> >> Does the script produce output, but it is not as expected? > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- """plotting module for orbital This implementation was inspired by poliastro (c) 2012 Juan Luis Cano (BSD License) """ # encoding: utf-8 from __future__ import absolute_import, division, print_function from copy import copy import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np from matplotlib import animation from matplotlib.patches import Circle from mpl_toolkits.mplot3d.axes3d import Axes3D from numpy import cos, sin from scipy.constants import kilo, pi from .maneuver import TimeOperation from .utilities import ( lookahead, orbit_radius, saved_state, uvw_from_elements) __all__ = [ 'plot2d', 'plot3d', 'plot', 'Plotter2D', 'Plotter3D', ] def plot2d(orbit, title='', maneuver=None, animate=False, speedup=5000): """Convenience function to 2D plot orbit in a new figure.""" plotter = Plotter2D() if animate: return plotter.animate(orbit, title=title, speedup=speedup) else: plotter.plot(orbit, title=title, maneuver=maneuver) def plot3d(orbit, title='', maneuver=None, animate=False, speedup=5000): """Convenience function to 3D plot orbit in a new figure.""" plotter = Plotter3D() if animate: return plotter.animate(orbit, title=title, speedup=speedup) else: plotter.plot(orbit, title=title, maneuver=maneuver) plot = plot2d class Plotter2D(): """2D Plotter Handles still and animated plots of an orbit. """ def __init__(self, axes=None, num_points=100): if axes: self.fig = axes.get_figure() else: self.fig = plt.figure() axes = self.fig.add_subplot(111) self.axes = axes self.axes.set_aspect(1) self.axes.set_xlabel("$p$ [km]") self.axes.set_ylabel("$q$ [km]") self.points_per_rad = num_points / (2 * pi) def plot(self, orbit, maneuver=None, title=''): self._plot_body(orbit) if maneuver is None: self._plot_orbit(orbit) self.pos_dot = self._plot_position(orbit) else: self._plot_orbit(orbit, label='Initial orbit') self.propagate_counter = 1 states = lookahead( orbit.apply_maneuver(maneuver, iter=True, copy=True), fillvalue=(None, None)) with saved_state(orbit): for (orbit, operation), (_, next_operation) in states: with saved_state(orbit): operation.plot(orbit, self, next_operation) self.axes.legend() self.axes.set_title(title) def animate(self, orbit, speedup=5000, title=''): # Copy orbit, because it will be modified in the animation callback. orbit = copy(orbit) self.plot(orbit) p = orbit.a * (1 - orbit.e ** 2) def fpos(f): pos = np.array([cos(f), sin(f), 0 * f]) * p / (1 + orbit.e * cos(f)) pos /= kilo return pos time_per_orbit = orbit.T / speedup interval = 1000 / 30 times = np.linspace(orbit.t, orbit.t + orbit.T, time_per_orbit * 30) def animate(i): orbit.t = times[i - 1] pos = fpos(orbit.f) self.pos_dot.set_data(pos[0], pos[1]) return self.pos_dot self.axes.set_title(title) # blit=True causes an error on OS X, disable for now. ani = animation.FuncAnimation( self.fig, animate, len(times), interval=interval, blit=False) return ani @staticmethod def _perifocal_coords(orbit, f): p = orbit.a * (1 - orbit.e ** 2) pos = np.array([cos(f), sin(f), 0 * f]) * p / (1 + orbit.e * cos(f)) pos /= kilo return pos def _plot_orbit(self, orbit, f1=0, f2=2 * pi, label=None): if f2 < f1: f2 += 2 * pi num_points = self.points_per_rad * (f2 - f1) f = np.linspace(f1, f2, num_points) pos = self._perifocal_coords(orbit, f) self.axes.plot(pos[0, :], pos[1, :], '--', linewidth=1, label=label) def _plot_position(self, orbit, f=None, propagated=False, label=None): if f is None: f = orbit.f pos = self._perifocal_coords(orbit, f) if propagated: if label is not None: raise TypeError('propagated flag sets label automatically') label = 'Propagated position {}'.format(self.propagate_counter) self.propagate_counter += 1 pos_dot, = self.axes.plot( pos[0], pos[1], 'o', label=label) return pos_dot def _plot_body(self, orbit): color = '#EBEBEB' if orbit.body.plot_color is not None: color = orbit.body.plot_color self.axes.add_patch(Circle((0, 0), orbit.body.mean_radius / kilo, linewidth=0, color=color)) class Plotter3D(object): """3D Plotter Handles still and animated plots of an orbit. """ def __init__(self, axes=None, num_points=100): if axes: self.fig = axes.get_figure() else: self.fig = plt.figure() axes = self.fig.add_subplot(111, projection='3d') self.axes = axes self.axes.set_xlabel("$x$ [km]") self.axes.set_ylabel("$y$ [km]") self.axes.set_zlabel("$z$ [km]") # These are used to fix aspect ratio of final plot. # See Plotter3D._force_aspect() self._coords_x = np.array(0) self._coords_y = np.array(0) self._coords_z = np.array(0) self.points_per_rad = num_points / (2 * pi) def plot(self, orbit, maneuver=None, title=''): self._plot_body(orbit) if maneuver is None: self._plot_orbit(orbit) self.pos_dot = self._plot_position(orbit) else: self._plot_orbit(orbit, label='Initial orbit') self.propagate_counter = 1 states = lookahead( orbit.apply_maneuver(maneuver, iter=True, copy=True), fillvalue=(None, None)) with saved_state(orbit): for (orbit, operation), (_, next_operation) in states: with saved_state(orbit): operation.plot(orbit, self, next_operation) self.axes.legend() self.axes.set_title(title) self._force_aspect() def animate(self, orbit, speedup=5000, title=''): # Copy orbit, because it will be modified in the animation callback. orbit = copy(orbit) self.plot(orbit) num_points = self.points_per_rad * 2 * pi f = np.linspace(0, 2 * pi, num_points) def fpos(f): U, _, _ = uvw_from_elements(orbit.i, orbit.raan, orbit.arg_pe, f) pos = orbit_radius(orbit.a, orbit.e, f) * U pos /= kilo return pos[0], pos[1], pos[2] time_per_orbit = orbit.T / speedup interval = 1000 / 30 times = np.linspace(orbit.t, orbit.t + orbit.T, time_per_orbit * 30) def animate(i): orbit.t = times[i - 1] x, y, z = fpos(orbit.f) self.pos_dot.set_data([x], [y]) self.pos_dot.set_3d_properties([z]) return self.pos_dot self.axes.set_title(title) # blit=True causes an error on OS X, disable for now. ani = animation.FuncAnimation( self.fig, animate, len(times), interval=interval, blit=False) return ani @staticmethod def _xyz_coords(orbit, f): U, _, _ = uvw_from_elements(orbit.i, orbit.raan, orbit.arg_pe, f) pos = orbit_radius(orbit.a, orbit.e, f) * U pos /= kilo return pos def _plot_orbit(self, orbit, f1=0, f2=2 * pi, label=None): if f2 < f1: f2 += 2 * pi num_points = self.points_per_rad * (f2 - f1) f = np.linspace(f1, f2, num_points) pos = self._xyz_coords(orbit, f) x, y, z = pos[0, :], pos[1, :], pos[2, :] self.axes.plot(x, y, z, '--', linewidth=1, label=label) self._append_coords_for_aspect(x, y, z) def _plot_position(self, orbit, f=None, propagated=False, label=None): if f is None: f = orbit.f pos = self._xyz_coords(orbit, f) x, y, z = pos[0], pos[1], pos[2] if propagated: if label is not None: raise TypeError('propagated flag sets label automatically') label = 'Propagated position {}'.format(self.propagate_counter) self.propagate_counter += 1 pos_dot, = self.axes.plot( [x], [y], [z], 'o', label=label) return pos_dot def _plot_body(self, orbit): color = '#EBEBEB' if orbit.body.plot_color is not None: color = orbit.body.plot_color u = np.linspace(0, 2 * np.pi, 100) v = np.linspace(0, np.pi, 50) cx = orbit.body.mean_radius * np.outer(np.cos(u), np.sin(v)) cy = orbit.body.mean_radius * np.outer(np.sin(u), np.sin(v)) cz = orbit.body.mean_radius * np.outer(np.ones(np.size(u)), np.cos(v)) cx, cy, cz = cx / kilo, cy / kilo, cz / kilo self.axes.plot_surface(cx, cy, cz, rstride=5, cstride=5, color=color, edgecolors='#ADADAD', shade=False) def _append_coords_for_aspect(self, x, y, z): self._coords_x = np.append(self._coords_x, x) self._coords_y = np.append(self._coords_y, y) self._coords_z = np.append(self._coords_z, z) def _force_aspect(self): # Thanks to the following SO answer, we can make sure axes are equal # http://stackoverflow.com/a/13701747/2093785 # Create cubic bounding box to simulate equal aspect ratio x = self._coords_x y = self._coords_y z = self._coords_z max_range = np.array([x.max() - x.min(), y.max() - y.min(), z.max() - z.min()]).max() Xb = (0.5 * max_range * np.mgrid[-1:2:2, -1:2:2, -1:2:2][0].flatten() + 0.5 * (x.max() + x.min())) Yb = (0.5 * max_range * np.mgrid[-1:2:2, -1:2:2, -1:2:2][1].flatten() + 0.5 * (y.max() + y.min())) Zb = (0.5 * max_range * np.mgrid[-1:2:2, -1:2:2, -1:2:2][2].flatten() + 0.5 * (z.max() + z.min())) for xb, yb, zb in zip(Xb, Yb, Zb): self.axes.plot([xb], [yb], [zb], 'w') From sdupree at computational-astronomer.com Fri Apr 22 13:41:47 2016 From: sdupree at computational-astronomer.com (Samuel Dupree) Date: Fri, 22 Apr 2016 13:41:47 -0400 Subject: [Matplotlib-users] Attempting to get animated plot to work in this example In-Reply-To: References: <02dae52c-2815-9da5-e583-96d5ce2a5ec5@computational-astronomer.com> Message-ID: There are two plots that should output plots showing a satellite orbiting about the Earth. Instead the plots are static which they sjouldn't be. Hope this helps. Sam Dupree. On 4/22/16 13:37:17, Paul Hobson wrote: > On Fri, Apr 22, 2016 at 10:07 AM, Samuel Dupree > > wrote: > > I'm running matplotlib ver. 1.5.1 in an anaconda distribution on a > MacBook Pro running Mac OS X ver. 10.11.4 (El Capitan). I'm > attempting to get the animation portion of the example attached to > this note running. I've looked through the on-line documentation > on plot() and plot3d() but have turned up empty. > > Any thoughts. > > Sam Dupree. > > > What specific problems are you encountering? Does the script halt with > some error messages? If so, what are they? > > Does the script run, but fails to produce output? > > Does the script produce output, but it is not as expected? -------------- next part -------------- An HTML attachment was scrubbed... URL: From jklymak at uvic.ca Fri Apr 22 14:15:21 2016 From: jklymak at uvic.ca (Jody Klymak) Date: Fri, 22 Apr 2016 11:15:21 -0700 Subject: [Matplotlib-users] Attempting to get animated plot to work in this example In-Reply-To: <425db1f7-27b7-72ee-9927-3515976f277f@computational-astronomer.com> References: <02dae52c-2815-9da5-e583-96d5ce2a5ec5@computational-astronomer.com> <425db1f7-27b7-72ee-9927-3515976f277f@computational-astronomer.com> Message-ID: Does this code works for someone else? I don?t think "animate=True" is even a valid keyword argument for pyplot.plot. There is an ?animated? keyword argument, but I have no idea what it does. I doubt it actually animates anything; to do that I believe you need some kind of for-loop (or animation.FuncAnimation if you want to be fancy). There are lots of matplotlib animation examples. http://matplotlib.org/examples/animation/basic_example.html. If molniya is just a 2xN array, looping over the N values should be straightforward. Cheers, Jody > On Apr 22, 2016, at 11:06 AM, Samuel Dupree wrote: > > I can't reduce the example to a point that demonstrates my problem without the "orbital" module. However, I've done some deeper digging into the "orbital" module to find the functions that support the plotting. I've attached that source file to this note, and if you could point out any issues you may see dealing with the animate function, I would appreciate it. > > Sam Dupree. > > > > > On 4/22/16 13:48:45, Paul Hobson wrote: >> Can you reduce this problem down to an example that doesn't involve this "orbital" module? For all we know, the issue is in there >> >> On Fri, Apr 22, 2016 at 10:41 AM, Samuel Dupree > wrote: >> There are two plots that should output plots showing a satellite orbiting about the Earth. Instead the plots are static which they sjouldn't be. >> >> Hope this helps. >> >> Sam Dupree. >> >> >> >> >> >> On 4/22/16 13:37:17, Paul Hobson wrote: >>> On Fri, Apr 22, 2016 at 10:07 AM, Samuel Dupree < sdupree at computational-astronomer.com > wrote: >>> I'm running matplotlib ver. 1.5.1 in an anaconda distribution on a MacBook Pro running Mac OS X ver. 10.11.4 (El Capitan). I'm attempting to get the animation portion of the example attached to this note running. I've looked through the on-line documentation on plot() and plot3d() but have turned up empty. >>> >>> Any thoughts. >>> >>> Sam Dupree. >>> >>> What specific problems are you encountering? Does the script halt with some error messages? If so, what are they? >>> >>> Does the script run, but fails to produce output? >>> >>> Does the script produce output, but it is not as expected? >> >> > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben.v.root at gmail.com Fri Apr 22 14:27:03 2016 From: ben.v.root at gmail.com (Benjamin Root) Date: Fri, 22 Apr 2016 14:27:03 -0400 Subject: [Matplotlib-users] Attempting to get animated plot to work in this example In-Reply-To: References: <02dae52c-2815-9da5-e583-96d5ce2a5ec5@computational-astronomer.com> <425db1f7-27b7-72ee-9927-3515976f277f@computational-astronomer.com> Message-ID: The "animated=True" keyword argument is a relic from the old days of animations and blitting. It is technically still used, but only internally, as the animation module will now switch that attribute on or off. There is no need to pass it in at the plotting level, I don't think. Ben Root On Fri, Apr 22, 2016 at 2:15 PM, Jody Klymak wrote: > Does this code works for someone else? > > I don?t think "animate=True" is even a valid keyword argument for > pyplot.plot. There is an ?animated? keyword argument, but I have no idea > what it does. I doubt it actually animates anything; to do that I believe > you need some kind of for-loop (or animation.FuncAnimation if you want to > be fancy). There are lots of matplotlib animation examples. > http://matplotlib.org/examples/animation/basic_example.html. If molniya > is just a 2xN array, looping over the N values should be straightforward. > > Cheers, Jody > > > On Apr 22, 2016, at 11:06 AM, Samuel Dupree < > sdupree at computational-astronomer.com> wrote: > > I can't reduce the example to a point that demonstrates my problem without > the "orbital" module. However, I've done some deeper digging into the > "orbital" module to find the functions that support the plotting. I've > attached that source file to this note, and if you could point out any > issues you may see dealing with the animate function, I would appreciate it. > > Sam Dupree. > > > > > On 4/22/16 13:48:45, Paul Hobson wrote: > > Can you reduce this problem down to an example that doesn't involve this > "orbital" module? For all we know, the issue is in there > > On Fri, Apr 22, 2016 at 10:41 AM, Samuel Dupree < > sdupree at computational-astronomer.com> wrote: > >> There are two plots that should output plots showing a satellite orbiting >> about the Earth. Instead the plots are static which they sjouldn't be. >> >> Hope this helps. >> >> Sam Dupree. >> >> >> >> >> >> On 4/22/16 13:37:17, Paul Hobson wrote: >> >> On Fri, Apr 22, 2016 at 10:07 AM, Samuel Dupree < >> >> sdupree at computational-astronomer.com> wrote: >> >>> I'm running matplotlib ver. 1.5.1 in an anaconda distribution on a >>> MacBook Pro running Mac OS X ver. 10.11.4 (El Capitan). I'm attempting to >>> get the animation portion of the example attached to this note running. >>> I've looked through the on-line documentation on plot() and plot3d() but >>> have turned up empty. >>> >>> Any thoughts. >>> >>> Sam Dupree. >>> >> >> What specific problems are you encountering? Does the script halt with >> some error messages? If so, what are they? >> >> Does the script run, but fails to produce output? >> >> Does the script produce output, but it is not as expected? >> >> >> >> > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > > > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pmhobson at gmail.com Fri Apr 22 13:37:17 2016 From: pmhobson at gmail.com (Paul Hobson) Date: Fri, 22 Apr 2016 10:37:17 -0700 Subject: [Matplotlib-users] Attempting to get animated plot to work in this example In-Reply-To: <02dae52c-2815-9da5-e583-96d5ce2a5ec5@computational-astronomer.com> References: <02dae52c-2815-9da5-e583-96d5ce2a5ec5@computational-astronomer.com> Message-ID: On Fri, Apr 22, 2016 at 10:07 AM, Samuel Dupree < sdupree at computational-astronomer.com> wrote: > I'm running matplotlib ver. 1.5.1 in an anaconda distribution on a MacBook > Pro running Mac OS X ver. 10.11.4 (El Capitan). I'm attempting to get the > animation portion of the example attached to this note running. I've looked > through the on-line documentation on plot() and plot3d() but have turned up > empty. > > Any thoughts. > > Sam Dupree. > What specific problems are you encountering? Does the script halt with some error messages? If so, what are they? Does the script run, but fails to produce output? Does the script produce output, but it is not as expected? -------------- next part -------------- An HTML attachment was scrubbed... URL: From rmay31 at gmail.com Fri Apr 22 17:28:09 2016 From: rmay31 at gmail.com (Ryan May) Date: Fri, 22 Apr 2016 15:28:09 -0600 Subject: [Matplotlib-users] errors when mp4 files played in browser In-Reply-To: References: <7b1d841b898522d5f8555e1188bb6bca@garymlewis.com> Message-ID: On Fri, Apr 22, 2016 at 7:55 AM, wrote: > Thanks Ryan. Very cool nbviewer link you sent me. I use a Jupyter notebook > for pretty much all my python development. Very happy with it. ... Anyway, > to answer your question. Yes, the movie at the bottom of the notebook works > fine for me. Does that imply my issue is not the browser? I see you set > matplotlib.rcParams['animation.html'] = 'html5'. My default was set to > 'none'. Changing it to 'html5' did not seem to change anything, however. > When I open the animation mp4 in Firefox, it immediately says the file is > corrupt. > The default is set to none so that nothing breaks by default--as you've seen, making movies can be a bit touchy. :) Changing the 'animation.html' setting only changes if (and how) animations are converted to html for the jupyter notebook; it has no impact on how things are saved to mp4. The fact that the movies in the link work, though, mean that it is indeed possible to make matplotlib's animation support write mp4 files that work on those platforms. I note the following from our code that makes html5 videos: # For h264, the default format is yuv444p, which is not compatible # with quicktime (and others). Specifying yuv420p fixes playback on # iOS,as well as HTML5 video in firefox and safari (on both Win and # OSX). Also fixes internet explorer. This is as of 2015/10/29. if self.codec == 'h264' and '-pix_fmt' not in self.extra_args: args.extend(['-pix_fmt', 'yuv420p']) So I'd try passing these to save: anim.save('file.mp4', extra_args=['-pix_fmt', 'yuv420p']) > I do have one additional item to add that I discovered almost by accident > today. I recreated the animation (using a jupyter notebook, as always), but > this time I had the linux terminal open where I had started the jupyter > notebook. Nothing unusual until the animation completed and I used Firefox > to open the mp4 file. Once I did this, I got the following error at the > terminal: > [h264 ........] decode-slice-header-error and 'no frame!' > > I am a video novice, but a little search on the error indicated that a > keyframe might be missing. Again, this points to user error rather than > browser error. > It could be related--I honestly have no clue. I google around finding various solutions, trying stuff until it works. The pix_fmt stuff was enough to get it to work for me. Give it a spin and let me know! Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: From efiring at hawaii.edu Fri Apr 22 17:38:58 2016 From: efiring at hawaii.edu (Eric Firing) Date: Fri, 22 Apr 2016 11:38:58 -1000 Subject: [Matplotlib-users] errors when mp4 files played in browser In-Reply-To: <1461306835.2479.1.camel@sipsolutions.net> References: <7b1d841b898522d5f8555e1188bb6bca@garymlewis.com> <1461306835.2479.1.camel@sipsolutions.net> Message-ID: <7fb7240b-6505-e3cb-5ffc-3dc162010181@hawaii.edu> On 2016/04/21 8:33 PM, Sebastian Berg wrote: > I had similar problems recently due to ffmpeg changing some defaults > for the encoding. After realizing this was the problem, searching for > it and adding the correct extra arguments for the movie creation to be > passed to ffmpeg quickly solved the issue. > > - Sebastian > Sebastian, And what *are* those correct extra arguments? Eric From gml at garymlewis.com Fri Apr 22 09:55:13 2016 From: gml at garymlewis.com (gml at garymlewis.com) Date: Fri, 22 Apr 2016 09:55:13 -0400 Subject: [Matplotlib-users] errors when mp4 files played in browser In-Reply-To: References: <7b1d841b898522d5f8555e1188bb6bca@garymlewis.com> Message-ID: Thanks Ryan. Very cool nbviewer link you sent me. I use a Jupyter notebook for pretty much all my python development. Very happy with it. ... Anyway, to answer your question. Yes, the movie at the bottom of the notebook works fine for me. Does that imply my issue is not the browser? I see you set matplotlib.rcParams['animation.html'] = 'html5'. My default was set to 'none'. Changing it to 'html5' did not seem to change anything, however. When I open the animation mp4 in Firefox, it immediately says the file is corrupt. I do have one additional item to add that I discovered almost by accident today. I recreated the animation (using a jupyter notebook, as always), but this time I had the linux terminal open where I had started the jupyter notebook. Nothing unusual until the animation completed and I used Firefox to open the mp4 file. Once I did this, I got the following error at the terminal: [h264 ........] decode-slice-header-error and 'no frame!' I am a video novice, but a little search on the error indicated that a keyframe might be missing. Again, this points to user error rather than browser error. Any thoughts? Gary On 2016-04-22 00:45, Ryan May wrote: >> My question then comes to this: does anyone on the matplotlib forum >> have experience with viewing mp4 files in a browser? If so, do you >> have any suggestions for a work-around? I've literally spent months >> getting a few matplotlib animations to the point where they may be >> useful to others. It never occurred to me that I'd have problems at >> the very last link in the chain. >> >> Thanks very much for your thoughts. Sorry this is so long. > > I've put some effort into making sure the animations will render in > the Jupyter Notebook, so I'm curious: on the platforms where you're > seeing problems, what do they do with the movie at the bottom of this > notebook > > http://nbviewer.jupyter.org/gist/dopplershift/356f2e14832e9b676207 [1] > > ? > > Ryan > > -- > > Ryan May > > > > Links: > ------ > [1] http://nbviewer.jupyter.org/gist/dopplershift/356f2e14832e9b676207 From rs803 at cam.ac.uk Sat Apr 23 09:09:32 2016 From: rs803 at cam.ac.uk (Ruth Sims) Date: Sat, 23 Apr 2016 14:09:32 +0100 Subject: [Matplotlib-users] Render plot labels with LaTeX Message-ID: <571B740C.9030804@cam.ac.uk> Running Matplotlib v: 1.5.1 in Anaconda on OS X El Capitan, V 10.11.4 trying to render plot labels with LaTeX so I can use figures in my thesis. However, whenever I uncomment the command 'usetex = true', I receive an error similar to the below: RuntimeError: LaTeX was not able to process the following string: 'lp' Here is the full report generated by LaTeX: I have MacTeX-2015 and LaTeX, dvipng and ghostscript are each on my PATH. According to the instructions on https://github.com/matplotlib/matplotlib/issues/5076 I was able to reproduce the code in a clean environment - so I assume there is nothing wrong with any of the installations. I've tried most of the suggestions I found on various mailing lists but still received the same error. Thanks, Ruth Sims -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An HTML attachment was scrubbed... URL: From efiring at hawaii.edu Sat Apr 23 13:35:46 2016 From: efiring at hawaii.edu (Eric Firing) Date: Sat, 23 Apr 2016 07:35:46 -1000 Subject: [Matplotlib-users] Render plot labels with LaTeX In-Reply-To: <571B740C.9030804@cam.ac.uk> References: <571B740C.9030804@cam.ac.uk> Message-ID: On 2016/04/23 3:09 AM, Ruth Sims wrote: > Running Matplotlib v: 1.5.1 in Anaconda on OS X El Capitan, V 10.11.4 > trying to render plot labels with LaTeX so I can use figures in my > thesis. However, whenever I uncomment the command 'usetex = true', I > receive an error similar to the below: > > RuntimeError: LaTeX was not able to process the following string: > 'lp' > Here is the full report generated by LaTeX: > > I have MacTeX-2015 and LaTeX, dvipng and ghostscript are each on my > PATH. According to the instructions on > https://github.com/matplotlib/matplotlib/issues/5076 > I was able to reproduce the code in a clean environment - so I assume > there is nothing wrong with any of the installations. Ruth, if you put the code from your first attachment in a file, and run that file as a script from the command line instead of within ipython, do you still get the error? It looks like even in your "clean environment", some ipython startup code is being run (importing sympy, etc.). There are also other places where pieces of old environment might be getting pulled in, such as from a matplotlibrc file. Eric > > I've tried most of the suggestions I found on various mailing lists but > still received the same error. > > Thanks, > Ruth Sims > > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > From gml at garymlewis.com Sat Apr 23 14:44:07 2016 From: gml at garymlewis.com (gml at garymlewis.com) Date: Sat, 23 Apr 2016 14:44:07 -0400 Subject: [Matplotlib-users] errors when mp4 files played in browser In-Reply-To: <1461306835.2479.1.camel@sipsolutions.net> References: <7b1d841b898522d5f8555e1188bb6bca@garymlewis.com> <1461306835.2479.1.camel@sipsolutions.net> Message-ID: <99c9d63eff830aac346c5601d2609ea2@garymlewis.com> Thanks, Sebastian. That sounds hopeful. What extra arguments did you add? I'd like to give it a try to see if it fixes the problem I'm having. ... Gary On 2016-04-22 02:33, Sebastian Berg wrote: > I had similar problems recently due to ffmpeg changing some defaults > for the encoding. After realizing this was the problem, searching for > it and adding the correct extra arguments for the movie creation to be > passed to ffmpeg quickly solved the issue. > > - Sebastian > > > On Do, 2016-04-21 at 22:45 -0600, Ryan May wrote: >> > My question then comes to this: does anyone on the matplotlib forum >> > have experience with viewing mp4 files in a browser? If so, do you >> > have any suggestions for a work-around? I've literally spent months >> > getting a few matplotlib animations to the point where they may be >> > useful to others. It never occurred to me that I'd have problems at >> > the very last link in the chain. >> > >> > Thanks very much for your thoughts. Sorry this is so long. >> I've put some effort into making sure the animations will render in >> the Jupyter Notebook, so I'm curious: on the platforms where you're >> seeing problems, what do they do with the movie at the bottom of this >> notebook >> >> http://nbviewer.jupyter.org/gist/dopplershift/356f2e14832e9b676207 >> >> ? >> >> Ryan >> >> -- >> Ryan May >> >> _______________________________________________ >> Matplotlib-users mailing list >> Matplotlib-users at python.org >> https://mail.python.org/mailman/listinfo/matplotlib-users > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users From tcaswell at gmail.com Mon Apr 25 01:08:33 2016 From: tcaswell at gmail.com (Thomas Caswell) Date: Mon, 25 Apr 2016 05:08:33 +0000 Subject: [Matplotlib-users] fille area under a step function In-Reply-To: <1461317339526-46991.post@n5.nabble.com> References: <1461317339526-46991.post@n5.nabble.com> Message-ID: As of mpl 1.5 the fill_between method/function takes a step kwarg http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.fill_between which I think will do what you want. Tom On Fri, Apr 22, 2016, 02:44 amuls wrote: > Hi All > > I make a plot of visible satellites at a ground station where calculations > are performed every X minutes (eg 10 minutes). From these calculations I > make a plot which,among other info, displays the number of visible > satellites as a function of time using the drwa-style 'steps-post' (cfr > line > below) > > ax2.plot(predDates, nrVisSats, linewidth=3, color='black', > drawstyle='steps-post', label='#Visible', alpha=.6) > > I would like to color the area between the time-axis and this line but I > cannot find how to do that for a 'step' function. > > Tx for any help. > > Alain > > > > > -- > View this message in context: > http://matplotlib.1069221.n5.nabble.com/fille-area-under-a-step-function-tp46991.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From blancaverag at gmail.com Mon Apr 25 05:00:53 2016 From: blancaverag at gmail.com (blavergar) Date: Mon, 25 Apr 2016 02:00:53 -0700 (MST) Subject: [Matplotlib-users] Import error: Cannot import pylab modules Message-ID: <1461574853082-47010.post@n5.nabble.com> Dear all, I want to use two programs (GroopM and QIIME) requiring matplotlib >=1.1.0 and python 2.7, which I have installed. My OS is Centos 6. They both give similar errors: 1. (...) *** ERROR RAISED DURING STEP: Plot Taxonomy Summary Command run was: plot_taxa_summary.py -i taxa_summary2/OTU_L2.txt,taxa_summary2/OTU_L3.txt,taxa_summary2/OTU_L4.txt,taxa_summary2/OTU_L5.txt,taxa_summary2/OTU_L6.txt -o taxa_summary2/taxa_summary_plots/ Command returned exit status: 1 Stdout: Stderr Traceback (most recent call last): File "/usr/local/bin/plot_taxa_summary.py", line 20, in from qiime.plot_taxa_summary import make_all_charts File "/usr/local/lib/python2.7/site-packages/qiime/plot_taxa_summary.py", line 24, in from pylab import rc, axis, title, axes, pie, figlegend, clf, savefig, figure\ *ImportError: cannot import name rc* Pylab is imported in plot_taxa_summary.py as follows: (...) import matplotlib import re matplotlib.use('Agg', warn=False) from matplotlib.font_manager import FontProperties from pylab import rc, axis, title, axes, pie, figlegend, clf, savefig, figure\ , close (...) 2. (...) File "/usr/local/lib/python2.7/site-packages/groopm/cluster.py", line 54, in from pylab import show *ImportError: cannot import name show* And the content of cluster.py involving the importing of pylab is: (...) from sys import stdout, exit from colorsys import hsv_to_rgb as htr import matplotlib.pyplot as plt from pylab import show from numpy import (abs as np_abs, (...) As I read that pylab is installed directly with matplotlib I have already tried different versions and installations (conda, pip, yum...) but none of them got those programs working. Could someone help with this, please? Thank you! -- View this message in context: http://matplotlib.1069221.n5.nabble.com/Import-error-Cannot-import-pylab-modules-tp47010.html Sent from the matplotlib - users mailing list archive at Nabble.com. From rs803 at cam.ac.uk Mon Apr 25 05:21:00 2016 From: rs803 at cam.ac.uk (Ruth Sims) Date: Mon, 25 Apr 2016 10:21:00 +0100 Subject: [Matplotlib-users] Matplotlib-users Digest, Vol 9, Issue 24 In-Reply-To: References: Message-ID: Dear Eric, Many thanks for your help. The code runs fine from the command line and the graph is output as expected with the axis titles formatted correctly. Thanks Ruth On 24/04/2016 17:00, matplotlib-users-request at python.org wrote: > Send Matplotlib-users mailing list submissions to > matplotlib-users at python.org > > To subscribe or unsubscribe via the World Wide Web, visit > https://mail.python.org/mailman/listinfo/matplotlib-users > or, via email, send a message with subject or body 'help' to > matplotlib-users-request at python.org > > You can reach the person managing the list at > matplotlib-users-owner at python.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Matplotlib-users digest..." > > > Today's Topics: > > 1. Re: Render plot labels with LaTeX (Eric Firing) > 2. Re: errors when mp4 files played in browser (gml at garymlewis.com) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Sat, 23 Apr 2016 07:35:46 -1000 > From: Eric Firing > To: matplotlib-users at python.org > Subject: Re: [Matplotlib-users] Render plot labels with LaTeX > Message-ID: > Content-Type: text/plain; charset=windows-1252; format=flowed > > On 2016/04/23 3:09 AM, Ruth Sims wrote: >> Running Matplotlib v: 1.5.1 in Anaconda on OS X El Capitan, V 10.11.4 >> trying to render plot labels with LaTeX so I can use figures in my >> thesis. However, whenever I uncomment the command 'usetex = true', I >> receive an error similar to the below: >> >> RuntimeError: LaTeX was not able to process the following string: >> 'lp' >> Here is the full report generated by LaTeX: >> >> I have MacTeX-2015 and LaTeX, dvipng and ghostscript are each on my >> PATH. According to the instructions on >> https://github.com/matplotlib/matplotlib/issues/5076 >> I was able to reproduce the code in a clean environment - so I assume >> there is nothing wrong with any of the installations. > Ruth, if you put the code from your first attachment in a file, and run > that file as a script from the command line instead of within ipython, > do you still get the error? It looks like even in your "clean > environment", some ipython startup code is being run (importing sympy, > etc.). There are also other places where pieces of old environment > might be getting pulled in, such as from a matplotlibrc file. > > Eric > >> I've tried most of the suggestions I found on various mailing lists but >> still received the same error. >> >> Thanks, >> Ruth Sims >> >> >> _______________________________________________ >> Matplotlib-users mailing list >> Matplotlib-users at python.org >> https://mail.python.org/mailman/listinfo/matplotlib-users >> > > > ------------------------------ > > Message: 2 > Date: Sat, 23 Apr 2016 14:44:07 -0400 > From: gml at garymlewis.com > To: Sebastian Berg > Cc: matplotlib-users at python.org > Subject: Re: [Matplotlib-users] errors when mp4 files played in > browser > Message-ID: <99c9d63eff830aac346c5601d2609ea2 at garymlewis.com> > Content-Type: text/plain; charset=US-ASCII; format=flowed > > Thanks, Sebastian. That sounds hopeful. What extra arguments did you > add? I'd like to give it a try to see if it fixes the problem I'm > having. ... Gary > > > On 2016-04-22 02:33, Sebastian Berg wrote: >> I had similar problems recently due to ffmpeg changing some defaults >> for the encoding. After realizing this was the problem, searching for >> it and adding the correct extra arguments for the movie creation to be >> passed to ffmpeg quickly solved the issue. >> >> - Sebastian >> >> >> On Do, 2016-04-21 at 22:45 -0600, Ryan May wrote: >>>> My question then comes to this: does anyone on the matplotlib forum >>>> have experience with viewing mp4 files in a browser? If so, do you >>>> have any suggestions for a work-around? I've literally spent months >>>> getting a few matplotlib animations to the point where they may be >>>> useful to others. It never occurred to me that I'd have problems at >>>> the very last link in the chain. >>>> >>>> Thanks very much for your thoughts. Sorry this is so long. >>> I've put some effort into making sure the animations will render in >>> the Jupyter Notebook, so I'm curious: on the platforms where you're >>> seeing problems, what do they do with the movie at the bottom of this >>> notebook >>> >>> http://nbviewer.jupyter.org/gist/dopplershift/356f2e14832e9b676207 >>> >>> ? >>> >>> Ryan >>> >>> -- >>> Ryan May >>> >>> _______________________________________________ >>> Matplotlib-users mailing list >>> Matplotlib-users at python.org >>> https://mail.python.org/mailman/listinfo/matplotlib-users >> _______________________________________________ >> Matplotlib-users mailing list >> Matplotlib-users at python.org >> https://mail.python.org/mailman/listinfo/matplotlib-users > > ------------------------------ > > Subject: Digest Footer > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > > > ------------------------------ > > End of Matplotlib-users Digest, Vol 9, Issue 24 > *********************************************** From ben.v.root at gmail.com Mon Apr 25 15:30:26 2016 From: ben.v.root at gmail.com (Benjamin Root) Date: Mon, 25 Apr 2016 15:30:26 -0400 Subject: [Matplotlib-users] Import error: Cannot import pylab modules In-Reply-To: <1461574853082-47010.post@n5.nabble.com> References: <1461574853082-47010.post@n5.nabble.com> Message-ID: Can you do the following (from the python interpreter) import pylab print pylab.__file__ There has been a rogue package on pypi called "pylab" that we have been trying to get taken off of the listing, since it conflicts with our long-standing package and trademark. Nothing nefarious, just some person's collection of dependencies that he decided to call pylab and uploaded to pypi for his personal use. Ben Root On Mon, Apr 25, 2016 at 5:00 AM, blavergar wrote: > Dear all, > > I want to use two programs (GroopM and QIIME) requiring matplotlib >=1.1.0 > and python 2.7, which I have installed. My OS is Centos 6. > > They both give similar errors: > > 1. > (...) > *** ERROR RAISED DURING STEP: Plot Taxonomy Summary > Command run was: > plot_taxa_summary.py -i > > taxa_summary2/OTU_L2.txt,taxa_summary2/OTU_L3.txt,taxa_summary2/OTU_L4.txt,taxa_summary2/OTU_L5.txt,taxa_summary2/OTU_L6.txt > -o taxa_summary2/taxa_summary_plots/ > Command returned exit status: 1 > Stdout: > > Stderr > Traceback (most recent call last): > File "/usr/local/bin/plot_taxa_summary.py", line 20, in > from qiime.plot_taxa_summary import make_all_charts > File "/usr/local/lib/python2.7/site-packages/qiime/plot_taxa_summary.py", > line 24, in > from pylab import rc, axis, title, axes, pie, figlegend, clf, savefig, > figure\ > *ImportError: cannot import name rc* > > > > Pylab is imported in plot_taxa_summary.py as follows: > > (...) > > import matplotlib > import re > matplotlib.use('Agg', warn=False) > from matplotlib.font_manager import FontProperties > from pylab import rc, axis, title, axes, pie, figlegend, clf, savefig, > figure\ > , close > > (...) > > > 2. > (...) > File "/usr/local/lib/python2.7/site-packages/groopm/cluster.py", line 54, > in > > from pylab import show > > *ImportError: cannot import name show* > > > > And the content of cluster.py involving the importing of pylab is: > (...) > from sys import stdout, exit > > from colorsys import hsv_to_rgb as htr > import matplotlib.pyplot as plt > from pylab import show > from numpy import (abs as np_abs, > (...) > > > > As I read that pylab is installed directly with matplotlib I have already > tried different versions and installations (conda, pip, yum...) but none of > them got those programs working. > > > Could someone help with this, please? > > Thank you! > > > > > > > -- > View this message in context: > http://matplotlib.1069221.n5.nabble.com/Import-error-Cannot-import-pylab-modules-tp47010.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From blancaverag at gmail.com Mon Apr 25 17:28:42 2016 From: blancaverag at gmail.com (blavergar) Date: Mon, 25 Apr 2016 14:28:42 -0700 (MST) Subject: [Matplotlib-users] Import error: Cannot import pylab modules In-Reply-To: References: <1461574853082-47010.post@n5.nabble.com> Message-ID: Thank you for the answer! This is the output: /usr/local/lib/python2.7/site-packages/pylab/__init__.pyc 2016-04-25 21:31 GMT+02:00 Benjamin Root [via matplotlib] < ml-node+s1069221n47019h33 at n5.nabble.com>: > Can you do the following (from the python interpreter) > > import pylab > print pylab.__file__ > > There has been a rogue package on pypi called "pylab" that we have been > trying to get taken off of the listing, since it conflicts with our > long-standing package and trademark. Nothing nefarious, just some person's > collection of dependencies that he decided to call pylab and uploaded to > pypi for his personal use. > > Ben Root > > > On Mon, Apr 25, 2016 at 5:00 AM, blavergar <[hidden email] > > wrote: > >> Dear all, >> >> I want to use two programs (GroopM and QIIME) requiring matplotlib >=1.1.0 >> and python 2.7, which I have installed. My OS is Centos 6. >> >> They both give similar errors: >> >> 1. >> (...) >> *** ERROR RAISED DURING STEP: Plot Taxonomy Summary >> Command run was: >> plot_taxa_summary.py -i >> >> taxa_summary2/OTU_L2.txt,taxa_summary2/OTU_L3.txt,taxa_summary2/OTU_L4.txt,taxa_summary2/OTU_L5.txt,taxa_summary2/OTU_L6.txt >> -o taxa_summary2/taxa_summary_plots/ >> Command returned exit status: 1 >> Stdout: >> >> Stderr >> Traceback (most recent call last): >> File "/usr/local/bin/plot_taxa_summary.py", line 20, in >> from qiime.plot_taxa_summary import make_all_charts >> File >> "/usr/local/lib/python2.7/site-packages/qiime/plot_taxa_summary.py", >> line 24, in >> from pylab import rc, axis, title, axes, pie, figlegend, clf, savefig, >> figure\ >> *ImportError: cannot import name rc* >> >> >> >> Pylab is imported in plot_taxa_summary.py as follows: >> >> (...) >> >> import matplotlib >> import re >> matplotlib.use('Agg', warn=False) >> from matplotlib.font_manager import FontProperties >> from pylab import rc, axis, title, axes, pie, figlegend, clf, savefig, >> figure\ >> , close >> >> (...) >> >> >> 2. >> (...) >> File "/usr/local/lib/python2.7/site-packages/groopm/cluster.py", line 54, >> in >> >> from pylab import show >> >> *ImportError: cannot import name show* >> >> >> >> And the content of cluster.py involving the importing of pylab is: >> (...) >> from sys import stdout, exit >> >> from colorsys import hsv_to_rgb as htr >> import matplotlib.pyplot as plt >> from pylab import show >> from numpy import (abs as np_abs, >> (...) >> >> >> >> As I read that pylab is installed directly with matplotlib I have already >> tried different versions and installations (conda, pip, yum...) but none >> of >> them got those programs working. >> >> >> Could someone help with this, please? >> >> Thank you! >> >> >> >> >> >> >> -- >> View this message in context: >> http://matplotlib.1069221.n5.nabble.com/Import-error-Cannot-import-pylab-modules-tp47010.html >> Sent from the matplotlib - users mailing list archive at Nabble.com. >> _______________________________________________ >> Matplotlib-users mailing list >> [hidden email] >> https://mail.python.org/mailman/listinfo/matplotlib-users >> > > > _______________________________________________ > Matplotlib-users mailing list > [hidden email] > https://mail.python.org/mailman/listinfo/matplotlib-users > > > ------------------------------ > If you reply to this email, your message will be added to the discussion > below: > > http://matplotlib.1069221.n5.nabble.com/Import-error-Cannot-import-pylab-modules-tp47010p47019.html > To unsubscribe from Import error: Cannot import pylab modules, click here > > . > NAML > > -- View this message in context: http://matplotlib.1069221.n5.nabble.com/Import-error-Cannot-import-pylab-modules-tp47010p47021.html Sent from the matplotlib - users mailing list archive at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben.v.root at gmail.com Mon Apr 25 17:39:56 2016 From: ben.v.root at gmail.com (Benjamin Root) Date: Mon, 25 Apr 2016 17:39:56 -0400 Subject: [Matplotlib-users] Import error: Cannot import pylab modules In-Reply-To: References: <1461574853082-47010.post@n5.nabble.com> Message-ID: Yup, I think that is your problem. You will want to do a "sudo pip uninstall pylab". By the way, it is really a bad idea to do any pip installs with sudo. Pip installs execute arbitrary code, and you don't want to give arbitrary code sudo access. Furthermore, it is probably best to maintain a distinction between the "user's python" and the "system's python". This is why virtual environments or anaconda has been so valuable because it helps with maintaining that distinction. I hope that helps! Ben Root On Mon, Apr 25, 2016 at 5:28 PM, blavergar wrote: > Thank you for the answer! > > This is the output: > > /usr/local/lib/python2.7/site-packages/pylab/__init__.pyc > > 2016-04-25 21:31 GMT+02:00 Benjamin Root [via matplotlib] <[hidden email] > >: > >> Can you do the following (from the python interpreter) >> >> import pylab >> print pylab.__file__ >> >> There has been a rogue package on pypi called "pylab" that we have been >> trying to get taken off of the listing, since it conflicts with our >> long-standing package and trademark. Nothing nefarious, just some person's >> collection of dependencies that he decided to call pylab and uploaded to >> pypi for his personal use. >> >> Ben Root >> >> >> On Mon, Apr 25, 2016 at 5:00 AM, blavergar <[hidden email] >> > wrote: >> >>> Dear all, >>> >>> I want to use two programs (GroopM and QIIME) requiring matplotlib >>> >=1.1.0 >>> and python 2.7, which I have installed. My OS is Centos 6. >>> >>> They both give similar errors: >>> >>> 1. >>> (...) >>> *** ERROR RAISED DURING STEP: Plot Taxonomy Summary >>> Command run was: >>> plot_taxa_summary.py -i >>> >>> taxa_summary2/OTU_L2.txt,taxa_summary2/OTU_L3.txt,taxa_summary2/OTU_L4.txt,taxa_summary2/OTU_L5.txt,taxa_summary2/OTU_L6.txt >>> -o taxa_summary2/taxa_summary_plots/ >>> Command returned exit status: 1 >>> Stdout: >>> >>> Stderr >>> Traceback (most recent call last): >>> File "/usr/local/bin/plot_taxa_summary.py", line 20, in >>> from qiime.plot_taxa_summary import make_all_charts >>> File >>> "/usr/local/lib/python2.7/site-packages/qiime/plot_taxa_summary.py", >>> line 24, in >>> from pylab import rc, axis, title, axes, pie, figlegend, clf, >>> savefig, >>> figure\ >>> *ImportError: cannot import name rc* >>> >>> >>> >>> Pylab is imported in plot_taxa_summary.py as follows: >>> >>> (...) >>> >>> import matplotlib >>> import re >>> matplotlib.use('Agg', warn=False) >>> from matplotlib.font_manager import FontProperties >>> from pylab import rc, axis, title, axes, pie, figlegend, clf, savefig, >>> figure\ >>> , close >>> >>> (...) >>> >>> >>> 2. >>> (...) >>> File "/usr/local/lib/python2.7/site-packages/groopm/cluster.py", line >>> 54, in >>> >>> from pylab import show >>> >>> *ImportError: cannot import name show* >>> >>> >>> >>> And the content of cluster.py involving the importing of pylab is: >>> (...) >>> from sys import stdout, exit >>> >>> from colorsys import hsv_to_rgb as htr >>> import matplotlib.pyplot as plt >>> from pylab import show >>> from numpy import (abs as np_abs, >>> (...) >>> >>> >>> >>> As I read that pylab is installed directly with matplotlib I have already >>> tried different versions and installations (conda, pip, yum...) but none >>> of >>> them got those programs working. >>> >>> >>> Could someone help with this, please? >>> >>> Thank you! >>> >>> >>> >>> >>> >>> >>> -- >>> View this message in context: >>> http://matplotlib.1069221.n5.nabble.com/Import-error-Cannot-import-pylab-modules-tp47010.html >>> Sent from the matplotlib - users mailing list archive at Nabble.com. >>> _______________________________________________ >>> Matplotlib-users mailing list >>> [hidden email] >>> https://mail.python.org/mailman/listinfo/matplotlib-users >>> >> >> >> _______________________________________________ >> Matplotlib-users mailing list >> [hidden email] >> https://mail.python.org/mailman/listinfo/matplotlib-users >> >> >> ------------------------------ >> If you reply to this email, your message will be added to the discussion >> below: >> >> http://matplotlib.1069221.n5.nabble.com/Import-error-Cannot-import-pylab-modules-tp47010p47019.html >> To unsubscribe from Import error: Cannot import pylab modules, click here >> . >> NAML >> >> > > > ------------------------------ > View this message in context: Re: Import error: Cannot import pylab > modules > > > Sent from the matplotlib - users mailing list archive > at > Nabble.com. > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tcaswell at gmail.com Mon Apr 25 22:50:00 2016 From: tcaswell at gmail.com (Thomas Caswell) Date: Tue, 26 Apr 2016 02:50:00 +0000 Subject: [Matplotlib-users] Import error: Cannot import pylab modules In-Reply-To: References: <1461574853082-47010.post@n5.nabble.com> Message-ID: We have reported the name collision to both the individual who upload 'pylab' to pip (no response) and pypi told us that they would not get involved in name disputes. I have put PRs into both of those projects to remove pylab from their code bases https://github.com/biocore/qiime/pull/2143 https://github.com/Ecogenomics/GroopM/pull/20 Tom On Mon, Apr 25, 2016 at 5:44 PM Benjamin Root wrote: > Yup, I think that is your problem. You will want to do a "sudo pip > uninstall pylab". By the way, it is really a bad idea to do any pip > installs with sudo. Pip installs execute arbitrary code, and you don't want > to give arbitrary code sudo access. Furthermore, it is probably best to > maintain a distinction between the "user's python" and the "system's > python". This is why virtual environments or anaconda has been so valuable > because it helps with maintaining that distinction. > > I hope that helps! > Ben Root > > > On Mon, Apr 25, 2016 at 5:28 PM, blavergar wrote: > >> Thank you for the answer! >> >> This is the output: >> >> /usr/local/lib/python2.7/site-packages/pylab/__init__.pyc >> >> 2016-04-25 21:31 GMT+02:00 Benjamin Root [via matplotlib] <[hidden email] >> >: >> >>> Can you do the following (from the python interpreter) >>> >>> import pylab >>> print pylab.__file__ >>> >>> There has been a rogue package on pypi called "pylab" that we have been >>> trying to get taken off of the listing, since it conflicts with our >>> long-standing package and trademark. Nothing nefarious, just some person's >>> collection of dependencies that he decided to call pylab and uploaded to >>> pypi for his personal use. >>> >>> Ben Root >>> >>> >>> On Mon, Apr 25, 2016 at 5:00 AM, blavergar <[hidden email] >>> > wrote: >>> >>>> Dear all, >>>> >>>> I want to use two programs (GroopM and QIIME) requiring matplotlib >>>> >=1.1.0 >>>> and python 2.7, which I have installed. My OS is Centos 6. >>>> >>>> They both give similar errors: >>>> >>>> 1. >>>> (...) >>>> *** ERROR RAISED DURING STEP: Plot Taxonomy Summary >>>> Command run was: >>>> plot_taxa_summary.py -i >>>> >>>> taxa_summary2/OTU_L2.txt,taxa_summary2/OTU_L3.txt,taxa_summary2/OTU_L4.txt,taxa_summary2/OTU_L5.txt,taxa_summary2/OTU_L6.txt >>>> -o taxa_summary2/taxa_summary_plots/ >>>> Command returned exit status: 1 >>>> Stdout: >>>> >>>> Stderr >>>> Traceback (most recent call last): >>>> File "/usr/local/bin/plot_taxa_summary.py", line 20, in >>>> from qiime.plot_taxa_summary import make_all_charts >>>> File >>>> "/usr/local/lib/python2.7/site-packages/qiime/plot_taxa_summary.py", >>>> line 24, in >>>> from pylab import rc, axis, title, axes, pie, figlegend, clf, >>>> savefig, >>>> figure\ >>>> *ImportError: cannot import name rc* >>>> >>>> >>>> >>>> Pylab is imported in plot_taxa_summary.py as follows: >>>> >>>> (...) >>>> >>>> import matplotlib >>>> import re >>>> matplotlib.use('Agg', warn=False) >>>> from matplotlib.font_manager import FontProperties >>>> from pylab import rc, axis, title, axes, pie, figlegend, clf, savefig, >>>> figure\ >>>> , close >>>> >>>> (...) >>>> >>>> >>>> 2. >>>> (...) >>>> File "/usr/local/lib/python2.7/site-packages/groopm/cluster.py", line >>>> 54, in >>>> >>>> from pylab import show >>>> >>>> *ImportError: cannot import name show* >>>> >>>> >>>> >>>> And the content of cluster.py involving the importing of pylab is: >>>> (...) >>>> from sys import stdout, exit >>>> >>>> from colorsys import hsv_to_rgb as htr >>>> import matplotlib.pyplot as plt >>>> from pylab import show >>>> from numpy import (abs as np_abs, >>>> (...) >>>> >>>> >>>> >>>> As I read that pylab is installed directly with matplotlib I have >>>> already >>>> tried different versions and installations (conda, pip, yum...) but >>>> none of >>>> them got those programs working. >>>> >>>> >>>> Could someone help with this, please? >>>> >>>> Thank you! >>>> >>>> >>>> >>>> >>>> >>>> >>>> -- >>>> View this message in context: >>>> http://matplotlib.1069221.n5.nabble.com/Import-error-Cannot-import-pylab-modules-tp47010.html >>>> Sent from the matplotlib - users mailing list archive at Nabble.com. >>>> _______________________________________________ >>>> Matplotlib-users mailing list >>>> [hidden email] >>>> https://mail.python.org/mailman/listinfo/matplotlib-users >>>> >>> >>> >>> _______________________________________________ >>> Matplotlib-users mailing list >>> [hidden email] >>> https://mail.python.org/mailman/listinfo/matplotlib-users >>> >>> >>> ------------------------------ >>> If you reply to this email, your message will be added to the discussion >>> below: >>> >>> http://matplotlib.1069221.n5.nabble.com/Import-error-Cannot-import-pylab-modules-tp47010p47019.html >>> To unsubscribe from Import error: Cannot import pylab modules, click >>> here. >>> NAML >>> >>> >> >> >> ------------------------------ >> View this message in context: Re: Import error: Cannot import pylab >> modules >> >> >> Sent from the matplotlib - users mailing list archive >> at >> Nabble.com. >> >> _______________________________________________ >> Matplotlib-users mailing list >> Matplotlib-users at python.org >> https://mail.python.org/mailman/listinfo/matplotlib-users >> >> > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From blancaverag at gmail.com Tue Apr 26 03:05:07 2016 From: blancaverag at gmail.com (blavergar) Date: Tue, 26 Apr 2016 00:05:07 -0700 (MST) Subject: [Matplotlib-users] Import error: Cannot import pylab modules In-Reply-To: References: <1461574853082-47010.post@n5.nabble.com> Message-ID: Thank you very much! I got it working now! 2016-04-26 4:50 GMT+02:00 tcaswell [via matplotlib] < ml-node+s1069221n47027h81 at n5.nabble.com>: > We have reported the name collision to both the individual who upload > 'pylab' to pip (no response) and pypi told us that they would not get > involved in name disputes. > > I have put PRs into both of those projects to remove pylab from their code > bases > > > https://github.com/biocore/qiime/pull/2143 > https://github.com/Ecogenomics/GroopM/pull/20 > > Tom > > On Mon, Apr 25, 2016 at 5:44 PM Benjamin Root <[hidden email] > > wrote: > >> Yup, I think that is your problem. You will want to do a "sudo pip >> uninstall pylab". By the way, it is really a bad idea to do any pip >> installs with sudo. Pip installs execute arbitrary code, and you don't want >> to give arbitrary code sudo access. Furthermore, it is probably best to >> maintain a distinction between the "user's python" and the "system's >> python". This is why virtual environments or anaconda has been so valuable >> because it helps with maintaining that distinction. >> >> I hope that helps! >> Ben Root >> >> >> On Mon, Apr 25, 2016 at 5:28 PM, blavergar <[hidden email] >> > wrote: >> >>> Thank you for the answer! >>> >>> This is the output: >>> >>> /usr/local/lib/python2.7/site-packages/pylab/__init__.pyc >>> >>> 2016-04-25 21:31 GMT+02:00 Benjamin Root [via matplotlib] <[hidden >>> email] >: >>> >>>> Can you do the following (from the python interpreter) >>>> >>>> import pylab >>>> print pylab.__file__ >>>> >>>> There has been a rogue package on pypi called "pylab" that we have been >>>> trying to get taken off of the listing, since it conflicts with our >>>> long-standing package and trademark. Nothing nefarious, just some person's >>>> collection of dependencies that he decided to call pylab and uploaded to >>>> pypi for his personal use. >>>> >>>> Ben Root >>>> >>>> >>>> On Mon, Apr 25, 2016 at 5:00 AM, blavergar <[hidden email] >>>> > wrote: >>>> >>>>> Dear all, >>>>> >>>>> I want to use two programs (GroopM and QIIME) requiring matplotlib >>>>> >=1.1.0 >>>>> and python 2.7, which I have installed. My OS is Centos 6. >>>>> >>>>> They both give similar errors: >>>>> >>>>> 1. >>>>> (...) >>>>> *** ERROR RAISED DURING STEP: Plot Taxonomy Summary >>>>> Command run was: >>>>> plot_taxa_summary.py -i >>>>> >>>>> taxa_summary2/OTU_L2.txt,taxa_summary2/OTU_L3.txt,taxa_summary2/OTU_L4.txt,taxa_summary2/OTU_L5.txt,taxa_summary2/OTU_L6.txt >>>>> -o taxa_summary2/taxa_summary_plots/ >>>>> Command returned exit status: 1 >>>>> Stdout: >>>>> >>>>> Stderr >>>>> Traceback (most recent call last): >>>>> File "/usr/local/bin/plot_taxa_summary.py", line 20, in >>>>> from qiime.plot_taxa_summary import make_all_charts >>>>> File >>>>> "/usr/local/lib/python2.7/site-packages/qiime/plot_taxa_summary.py", >>>>> line 24, in >>>>> from pylab import rc, axis, title, axes, pie, figlegend, clf, >>>>> savefig, >>>>> figure\ >>>>> *ImportError: cannot import name rc* >>>>> >>>>> >>>>> >>>>> Pylab is imported in plot_taxa_summary.py as follows: >>>>> >>>>> (...) >>>>> >>>>> import matplotlib >>>>> import re >>>>> matplotlib.use('Agg', warn=False) >>>>> from matplotlib.font_manager import FontProperties >>>>> from pylab import rc, axis, title, axes, pie, figlegend, clf, savefig, >>>>> figure\ >>>>> , close >>>>> >>>>> (...) >>>>> >>>>> >>>>> 2. >>>>> (...) >>>>> File "/usr/local/lib/python2.7/site-packages/groopm/cluster.py", line >>>>> 54, in >>>>> >>>>> from pylab import show >>>>> >>>>> *ImportError: cannot import name show* >>>>> >>>>> >>>>> >>>>> And the content of cluster.py involving the importing of pylab is: >>>>> (...) >>>>> from sys import stdout, exit >>>>> >>>>> from colorsys import hsv_to_rgb as htr >>>>> import matplotlib.pyplot as plt >>>>> from pylab import show >>>>> from numpy import (abs as np_abs, >>>>> (...) >>>>> >>>>> >>>>> >>>>> As I read that pylab is installed directly with matplotlib I have >>>>> already >>>>> tried different versions and installations (conda, pip, yum...) but >>>>> none of >>>>> them got those programs working. >>>>> >>>>> >>>>> Could someone help with this, please? >>>>> >>>>> Thank you! >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> View this message in context: >>>>> http://matplotlib.1069221.n5.nabble.com/Import-error-Cannot-import-pylab-modules-tp47010.html >>>>> Sent from the matplotlib - users mailing list archive at Nabble.com. >>>>> _______________________________________________ >>>>> Matplotlib-users mailing list >>>>> [hidden email] >>>>> https://mail.python.org/mailman/listinfo/matplotlib-users >>>>> >>>> >>>> >>>> _______________________________________________ >>>> Matplotlib-users mailing list >>>> [hidden email] >>>> https://mail.python.org/mailman/listinfo/matplotlib-users >>>> >>>> >>>> ------------------------------ >>>> If you reply to this email, your message will be added to the >>>> discussion below: >>>> >>>> http://matplotlib.1069221.n5.nabble.com/Import-error-Cannot-import-pylab-modules-tp47010p47019.html >>>> To unsubscribe from Import error: Cannot import pylab modules, click >>>> here. >>>> NAML >>>> >>>> >>> >>> >>> ------------------------------ >>> View this message in context: Re: Import error: Cannot import pylab >>> modules >>> >>> >>> Sent from the matplotlib - users mailing list archive >>> at >>> Nabble.com. >>> >>> _______________________________________________ >>> Matplotlib-users mailing list >>> [hidden email] >>> https://mail.python.org/mailman/listinfo/matplotlib-users >>> >>> >> _______________________________________________ >> Matplotlib-users mailing list >> [hidden email] >> https://mail.python.org/mailman/listinfo/matplotlib-users >> > > _______________________________________________ > Matplotlib-users mailing list > [hidden email] > https://mail.python.org/mailman/listinfo/matplotlib-users > > > ------------------------------ > If you reply to this email, your message will be added to the discussion > below: > > http://matplotlib.1069221.n5.nabble.com/Import-error-Cannot-import-pylab-modules-tp47010p47027.html > To unsubscribe from Import error: Cannot import pylab modules, click here > > . > NAML > > -- View this message in context: http://matplotlib.1069221.n5.nabble.com/Import-error-Cannot-import-pylab-modules-tp47010p47029.html Sent from the matplotlib - users mailing list archive at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gml at garymlewis.com Wed Apr 27 09:54:32 2016 From: gml at garymlewis.com (gml) Date: Wed, 27 Apr 2016 06:54:32 -0700 (MST) Subject: [Matplotlib-users] errors when mp4 files played in browser In-Reply-To: References: <7b1d841b898522d5f8555e1188bb6bca@garymlewis.com> Message-ID: <1461765272645-47031.post@n5.nabble.com> Ryan May-3 wrote > So I'd try passing these to save: > > anim.save('file.mp4', extra_args=['-pix_fmt', 'yuv420p']) Thanks very much, Ryan. That works! The full extra_args I used are: anim.save('file.mp4', extra_args=['-vcodec', 'libx264', '-pix_fmt', 'yuv420p']) Please consider this problem solved. Gary -- View this message in context: http://matplotlib.1069221.n5.nabble.com/errors-when-mp4-files-played-in-browser-tp46988p47031.html Sent from the matplotlib - users mailing list archive at Nabble.com. From smsawmu at hotmail.com Wed Apr 27 11:00:41 2016 From: smsawmu at hotmail.com (Said Bashir) Date: Wed, 27 Apr 2016 15:00:41 +0000 Subject: [Matplotlib-users] (no subject) Message-ID: -------------- next part -------------- An HTML attachment was scrubbed... URL: From smsawmu at hotmail.com Thu Apr 28 03:59:27 2016 From: smsawmu at hotmail.com (Said Bashir) Date: Thu, 28 Apr 2016 07:59:27 +0000 Subject: [Matplotlib-users] How to integrated plt.fill with event handling Message-ID: Hi I am trying to integrate plt.fill() function of matplotlib in GUI by using event handling (http://matplotlib.org/users/event_handling.html). The aim is to connect the Matplotlib event to a callback function and then display plots. I would appreciate any ideas. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben.v.root at gmail.com Thu Apr 28 15:29:45 2016 From: ben.v.root at gmail.com (Benjamin Root) Date: Thu, 28 Apr 2016 15:29:45 -0400 Subject: [Matplotlib-users] How to integrated plt.fill with event handling In-Reply-To: References: Message-ID: We would need a lot more information than that. There is no "plt.fill()" event, so I am not sure what you are trying to do. At the risk of boasting, I would highly recommend reading my book: http://www.amazon.com/Interactive-Applications-using-Matplotlib-Benjamin/dp/1783988843/ as it is probably the most comprehensive set of documentation regarding the interactive features of matplotlib. Let us know if you have any questions. Ben Root On Thu, Apr 28, 2016 at 3:59 AM, Said Bashir wrote: > Hi > > I am trying to integrate plt.fill() function of matplotlib in GUI by using > event handling (http://matplotlib.org/users/event_handling.html). The aim > is to connect the Matplotlib event to a callback function and then display > plots. > > I would appreciate any ideas. > > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jni.soma at gmail.com Thu Apr 28 18:03:09 2016 From: jni.soma at gmail.com (Juan Nunez-Iglesias) Date: Thu, 28 Apr 2016 18:03:09 -0400 Subject: [Matplotlib-users] How to integrated plt.fill with event handling In-Reply-To: References: Message-ID: Hi Ben, Book looks very interesting, I'll check it out! But, in the meantime, I would guess that Said wants to bind a callback to clicking on the filled area. Juan From: Benjamin Root Reply: Benjamin Root Date: 29 April 2016 at 5:29:45 AM To: Said Bashir CC: matplotlib-users at python.org Subject: Re: [Matplotlib-users] How to integrated plt.fill with event handling We would need a lot more information than that. There is no "plt.fill()" > event, so I am not sure what you are trying to do. > > At the risk of boasting, I would highly recommend reading my book: > http://www.amazon.com/Interactive-Applications-using-Matplotlib-Benjamin/dp/1783988843/ > as it is probably the most comprehensive set of documentation regarding the > interactive features of matplotlib. > > Let us know if you have any questions. > > Ben Root > > > On Thu, Apr 28, 2016 at 3:59 AM, Said Bashir wrote: > >> Hi >> >> I am trying to integrate plt.fill() function of matplotlib in GUI by >> using event handling (http://matplotlib.org/users/event_handling.html). The >> aim is to connect the Matplotlib event to a callback function and then >> display plots. >> >> I would appreciate any ideas. >> >> >> _______________________________________________ >> Matplotlib-users mailing list >> Matplotlib-users at python.org >> https://mail.python.org/mailman/listinfo/matplotlib-users >> >> > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From smsawmu at hotmail.com Fri Apr 29 04:33:56 2016 From: smsawmu at hotmail.com (Said Bashir) Date: Fri, 29 Apr 2016 08:33:56 +0000 Subject: [Matplotlib-users] How to integrated plt.fill with event handling In-Reply-To: References: , Message-ID: Hi all Thank you for the advice. To give you bit of a background: I am working with Kivy GUI framework and I am trying to embed figures into GUI. At the moment I successfully managed to embed the figures when I used plt.figure() as shown below example. def my_plot(self, nap): self.fig = plt.figure() self.ax = self.fig.add_subplot(121) self.connectMplEvents(self.fig) def connectMplEvents(self, figure): figure.canvas.mpl_connect('button_press_event', press) figure.canvas.mpl_connect('button_release_event', release) figure.canvas.mpl_connect('key_press_event', keypress) figure.canvas.mpl_connect('key_release_event', keyup) figure.canvas.mpl_connect('motion_notify_event', motionnotify) ...... I would like similar concept that would bind the filled area into a callback so it could be plotted into a designated frame (e.g. subplot(122)) Said ________________________________ From: Juan Nunez-Iglesias Sent: 28 April 2016 22:03 To: Benjamin Root; Said Bashir Cc: matplotlib-users at python.org Subject: Re: [Matplotlib-users] How to integrated plt.fill with event handling Hi Ben, Book looks very interesting, I'll check it out! But, in the meantime, I would guess that Said wants to bind a callback to clicking on the filled area. Juan From: Benjamin Root Reply: Benjamin Root Date: 29 April 2016 at 5:29:45 AM To: Said Bashir CC: matplotlib-users at python.org Subject: Re: [Matplotlib-users] How to integrated plt.fill with event handling We would need a lot more information than that. There is no "plt.fill()" event, so I am not sure what you are trying to do. At the risk of boasting, I would highly recommend reading my book: http://www.amazon.com/Interactive-Applications-using-Matplotlib-Benjamin/dp/1783988843/ as it is probably the most comprehensive set of documentation regarding the interactive features of matplotlib. Let us know if you have any questions. Ben Root On Thu, Apr 28, 2016 at 3:59 AM, Said Bashir > wrote: Hi I am trying to integrate plt.fill() function of matplotlib in GUI by using event handling (http://matplotlib.org/users/event_handling.html). The aim is to connect the Matplotlib event to a callback function and then display plots. I would appreciate any ideas. _______________________________________________ Matplotlib-users mailing list Matplotlib-users at python.org https://mail.python.org/mailman/listinfo/matplotlib-users _______________________________________________ Matplotlib-users mailing list Matplotlib-users at python.org https://mail.python.org/mailman/listinfo/matplotlib-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben.v.root at gmail.com Fri Apr 29 09:18:58 2016 From: ben.v.root at gmail.com (Benjamin Root) Date: Fri, 29 Apr 2016 09:18:58 -0400 Subject: [Matplotlib-users] How to integrated plt.fill with event handling In-Reply-To: References: Message-ID: Chapter 2 - Page 38: "Picking" http://matplotlib.org/users/event_handling.html#object-picking Do keep in mind that an artist object can only be in one place (subplot/figure/etc.). So, to draw it into a designated frame, you will need to remake the artist within the callback. I don't know if you already realized that or not, but it is something that has tripped up users before. Cheers! Ben Root On Fri, Apr 29, 2016 at 4:33 AM, Said Bashir wrote: > Hi all > > > Thank you for the advice. > > To give you bit of a background: I am working with Kivy GUI framework and > I am trying to embed figures into GUI. At the moment I successfully managed > to embed the figures when I used plt.figure() as shown below example. > > def my_plot(self, nap): > > self.fig = plt.figure() > > self.ax = self.fig.add_subplot(121) > > self.connectMplEvents(self.fig) > > > > > > > def connectMplEvents(self, figure): > > figure.canvas.mpl_connect('button_press_event', press) > > figure.canvas.mpl_connect('button_release_event', release) > > figure.canvas.mpl_connect('key_press_event', keypress) > > figure.canvas.mpl_connect('key_release_event', keyup) > > figure.canvas.mpl_connect('motion_notify_event', motionnotify) > > ...... > > I would like similar concept that would bind the filled area into a > callback so it could be plotted into a designated frame (e.g. subplot(122)) > > Said > > > > ------------------------------ > *From:* Juan Nunez-Iglesias > *Sent:* 28 April 2016 22:03 > *To:* Benjamin Root; Said Bashir > *Cc:* matplotlib-users at python.org > > *Subject:* Re: [Matplotlib-users] How to integrated plt.fill with event > handling > > Hi Ben, > > Book looks very interesting, I'll check it out! But, in the meantime, I > would guess that Said wants to bind a callback to clicking on the filled > area. > > Juan > > > From: Benjamin Root > Reply: Benjamin Root > Date: 29 April 2016 at 5:29:45 AM > To: Said Bashir > CC: matplotlib-users at python.org > > Subject: Re: [Matplotlib-users] How to integrated plt.fill with event > handling > > We would need a lot more information than that. There is no "plt.fill()" >> event, so I am not sure what you are trying to do. >> >> At the risk of boasting, I would highly recommend reading my book: >> http://www.amazon.com/Interactive-Applications-using-Matplotlib-Benjamin/dp/1783988843/ >> as it is probably the most comprehensive set of documentation regarding the >> interactive features of matplotlib. >> >> Let us know if you have any questions. >> >> Ben Root >> >> >> On Thu, Apr 28, 2016 at 3:59 AM, Said Bashir wrote: >> >>> Hi >>> >>> I am trying to integrate plt.fill() function of matplotlib in GUI by >>> using event handling (http://matplotlib.org/users/event_handling.html). The >>> aim is to connect the Matplotlib event to a callback function and then >>> display plots. >>> >>> I would appreciate any ideas. >>> >>> >>> _______________________________________________ >>> Matplotlib-users mailing list >>> Matplotlib-users at python.org >>> https://mail.python.org/mailman/listinfo/matplotlib-users >>> >>> >> _______________________________________________ >> Matplotlib-users mailing list >> Matplotlib-users at python.org >> https://mail.python.org/mailman/listinfo/matplotlib-users >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From egayer at gmail.com Sun Apr 17 12:35:19 2016 From: egayer at gmail.com (Eric Gayer) Date: Sun, 17 Apr 2016 16:35:19 -0000 Subject: [Matplotlib-users] perspective In-Reply-To: References: <6F355DF7-0518-484D-A066-6519E47462BA@gmail.com> Message-ID: Thanks Ben for your help, I?ll look deeper into persp_transformation(), I have seen it a wild ago but it didn?t appear straightforward enough at that time? so I asked the mailing list first. Anyway I will definitely pull a request hoping for this feature to be available soon :) Thanks again Eric On Apr 17, 2016, at 6:27 PM, Benjamin Root wrote: > I see what you mean. There have been some people asking for that feature. And there is some preliminary support for it built in, in fact. In mplot3d.proj3d, there is: > ``` > def persp_transformation(zfront, zback): > a = (zfront+zback)/(zfront-zback) > b = -2*(zfront*zback)/(zfront-zback) > return np.array([[1,0,0,0], > [0,1,0,0], > [0,0,a,b], > [0,0,-1,0] > ]) > ``` > > However, I haven't looked into integrating it into mplot3d (pull requests are welcomed). Some people have done some hacking, but I never heard back on the results of it. I think if you search the mailing list archives for perspective projection, you might find some tidbits. > > Seriously, projections are not my specialty, so pull requests would be greatly welcomed! > > Ben Root > > > On Sun, Apr 17, 2016 at 12:17 PM, Eric Gayer wrote: > Hi Ben, > > Thanks for your answer, maybe I didn?t well explained what I was looking for, I did play around with ax.view_init() but there is no elevation or angle that change anything in the way the perspective is presented. > What I am looking for is to find a way (and I am actually not sure it is possible) to change apparent depth of the 3D view. > I attached an image that show the difference between the two representations (persp() and plot_wireframe with ax_init(60,30)) > We feel a greater depth with the R figure than with matplotlib. Closest thing seems bigger in the R plot. Comparing R plot to Matplolib plot it is like comparing perspective view to orthographic view. > > I hope you see what I mean :) I don?t really know how to explain it actually. > Basically it would be awesome if we could change something like the perspective factor with matplotlib, so we could chose how big would appear closest things and then how small would appear farthest things. > > Thanks again for your help > Eric > > > > > On Apr 17, 2016, at 4:51 PM, Benjamin Root wrote: > >> Sorry for the long delay in replying. It seems like your email got held up on the listserve. >> >> Looking at perps(), it seems like it is just doing ax.plot_wireframe() and some camera angle settings, which can be set via ax.view_init(): >> >> | view_init(self, elev=None, azim=None) >> | Set the elevation and azimuth of the axes. >> | >> | This can be used to rotate the axes programatically. >> | >> | 'elev' stores the elevation angle in the z plane. >> | 'azim' stores the azimuth angle in the x,y plane. >> | >> | if elev or azim are None (default), then the initial value >> | is used which was specified in the :class:`Axes3D` constructor. >> >> Does that help? >> >> Cheers! >> Ben Root >> >> >> >> On Mon, Mar 21, 2016 at 5:37 AM, Eric Gayer wrote: >> Hi all, >> I am not sure this is the right place for my question, but I don?t really know where to ask? >> I would like to know if there is a chance for matplolib to provide the same 3D plot perspective as the perp() function in R or from the plot3D package from Karline Soetaert (based on persp()) in R >> >> http://www.r-bloggers.com/creating-surface-plots/ >> >> http://www.r-bloggers.com/3d-plots-in-r/ >> >> I found nothing on how to change perspective aspect in mplot3d. I am afraid it is not possible to work on the depth of the perspective in a mplot3d plot, is anyone knows how to do it ? >> >> Does anyone think it would be possible in a near future ? >> >> Thanks >> Eric >> >> _______________________________________________ >> Matplotlib-users mailing list >> Matplotlib-users at python.org >> https://mail.python.org/mailman/listinfo/matplotlib-users >> >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From yukicyk at hku.hk Mon Apr 18 06:04:14 2016 From: yukicyk at hku.hk (yukicyk) Date: Mon, 18 Apr 2016 10:04:14 -0000 Subject: [Matplotlib-users] Install/Import error rcParams Message-ID: <1460973852988-46967.post@n5.nabble.com> Hi all, I am trying to install matplotlib on my iMac OSX El Capitan Version 10.114 but failed. OS info: Darwin OBs-iMac.local 15.4.0 Darwin Kernel Version 15.4.0: Fri Feb 26 22:08:05 PST 2016; root:xnu-3248.40.184~3/RELEASE_X86_64 x86_64 gcc --version Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version 7.3.0 (clang-703.0.29) Target: x86_64-apple-darwin15.4.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin I installed python using HomeBrew and pip install matplotlib. I got the following messages when i tried to import matplotlib: Python 2.7.11 (default, Jan 22 2016, 08:29:18) [GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import matplotlib Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python2.7/site-packages/matplotlib/__init__.py", line 1131, in rcParams = rc_params() File "/usr/local/lib/python2.7/site-packages/matplotlib/__init__.py", line 975, in rc_params return rc_params_from_file(fname, fail_on_error) File "/usr/local/lib/python2.7/site-packages/matplotlib/__init__.py", line 1100, in rc_params_from_file config_from_file = _rc_params_in_file(fname, fail_on_error) File "/usr/local/lib/python2.7/site-packages/matplotlib/__init__.py", line 1018, in _rc_params_in_file with _open_file_or_url(fname) as fd: File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/contextlib.py", line 17, in __enter__ return self.gen.next() File "/usr/local/lib/python2.7/site-packages/matplotlib/__init__.py", line 1000, in _open_file_or_url encoding = locale.getdefaultlocale()[1] File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py", line 543, in getdefaultlocale return _parse_localename(localename) File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py", line 475, in _parse_localename raise ValueError, 'unknown locale: %s' % localename ValueError: unknown locale: UTF-8 I later installed Anaconda hoping to resolve this problem, but still encounter the same error. Python 2.7.11 |Anaconda 4.0.0 (x86_64)| (default, Dec 6 2015, 18:57:58) [GCC 4.2.1 (Apple Inc. build 5577)] on darwin I would greatly appreciate for any help on this. cheers, yuki -- View this message in context: http://matplotlib.1069221.n5.nabble.com/Install-Import-error-rcParams-tp46967.html Sent from the matplotlib - users mailing list archive at Nabble.com. From john.brodie at gmail.com Mon Apr 18 09:54:31 2016 From: john.brodie at gmail.com (John Brodie) Date: Mon, 18 Apr 2016 13:54:31 -0000 Subject: [Matplotlib-users] New matplotlib book: Mastering matplotlib In-Reply-To: References: <1458846438461-46920.post@n5.nabble.com> Message-ID: Thanks Scott, I'm running 3.5.1 (Anaconda). I'll think about installing 3.4 or perhaps digging deeper into the problem to see if I can make it work on 3.5. --John On Sun, Apr 17, 2016 at 1:58 PM Scott Lasley wrote: > From the Preface - "For this book, you will need Python 3.4.2 or a later > version of this as is available with Ubuntu 15.04 and Mac OS X 10.10. This > book was written using Python 3.4.2 on Mac OS X." > > Do you have python 3.4 installed? The book points out that make will > not work with python 2 and it didn't work on my mac with python 3.5 > installed but no python 3.4 installed. make worked on my mac after > installing python 3.4.4. > > Hope this helps, > Scott > > > On Mar 24, 2016, at 15:07, jungleb77 wrote: > > > > Hi Duncan, > > > > I just bought your book, I'm excited to get through it. I'm wondering if > the > > 'make' commands are supposed to work in OS X? I tried following the > > examples in the first couple of chapters and the make errors out with > some > > files not found. > > > > Any ideas? > > > > thanks again, > > > > John Brodie > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From coquelicot at walla.com Mon Apr 18 16:28:46 2016 From: coquelicot at walla.com (coquelicot) Date: Mon, 18 Apr 2016 20:28:46 -0000 Subject: [Matplotlib-users] Matplotlib set_array slow in comparison with cv2 In-Reply-To: References: <1459801463648-46938.post@n5.nabble.com> Message-ID: <1461010386343-46971.post@n5.nabble.com> >>Which version of matplotlib are you using? >>which backend is in use, I use python 3.4 with Anaconda; I believe that the version of Matplotlib is 1.4.3 >>Also, it would be good to know what your benchmark results are. The images are 1920x1200 = 1.94MB, and I am trying to run this at 10 fr/s: Matplotlib can't, while opencv can run this at 30 fr/s without problem. Even for smaller images, there is a notable difference. My question is: have you tried the code I've posted, and is it running fine for you ? thx. -- View this message in context: http://matplotlib.1069221.n5.nabble.com/Matplotlib-set-array-slow-in-comparison-with-cv2-tp46938p46971.html Sent from the matplotlib - users mailing list archive at Nabble.com. From droberts at spawar.navy.mil Thu Apr 21 17:00:56 2016 From: droberts at spawar.navy.mil (Dan Roberts) Date: Thu, 21 Apr 2016 21:00:56 -0000 Subject: [Matplotlib-users] PSD Scaling (matplotlib version 1.4.X versus 1.5.X) Message-ID: <57193E9E.8060706@spawar.navy.mil> Hello, I noticed an inconsistency with the pyplot.psd function when upgrading from matplotlib version 1.4.0 to 1.5.3 I have written some code (below) that will show what I'm talking about when run with the different matplotlib versions. In 1.4.0, the line "PX2 /= fft_size" was needed, but gives the wrong answer (P_ave is not equal to 1, and Pxw.max() is -36dB instead of 0dB) if it is included when using 1.5.3 I am mainly concerned with knowing if this change was intentional; will it behave like this from now on (no longer needing division by fft_size)? import matplotlib.pyplot as plt import matplotlib.mlab as mlab import numpy as np fft_size = 4096 fs = 2500.00 gram_lines = 100; t = np.arange(1.0,gram_lines*fft_size,1.0); t = t / fs; del_f = fs/fft_size; base_freq = 10.0 # in Hz bin_err = 0.0 f = (int(base_freq / del_f) + bin_err) * del_f # ensure f is in center of Fourier band A = np.sqrt(2.0); # if the amplitude is sqrt(2) then the total power = 1.0 linear and 0.0 in dB dat = A * np.sin(2 * np.pi * f * t); (Px2, F) = plt.psd(dat, NFFT = fft_size, Fs=fs, Fc=0, detrend=mlab.detrend_none, window=mlab.window_none, noverlap=0, pad_to = None, sides='onesided', scale_by_freq = False); Px2 /= fft_size; #comment this line out if using 1.5.1?? P_ave = sum(Px2); Px2 = 10.0*np.log10(Px2); #print results to compare actual with expected print "Sum of psd Px2 = %f, This should equal 1.0." %P_ave print "Max psd Px2 = %f dB. This should equal 0.0 dB if freq is a multiple of freq resolution.\n" %(Px2.max()) From eric.shain at gmail.com Tue Apr 26 17:28:57 2016 From: eric.shain at gmail.com (Eric) Date: Tue, 26 Apr 2016 21:28:57 -0000 Subject: [Matplotlib-users] Use of Pyplot in a GUI script Message-ID: <1461706136254-47030.post@n5.nabble.com> I've read that when writing a GUI application to avoid using pyplot. I experienced this when I wrote a python script that called the tkinter file dialog and then processed and plotted data. It would run when launched in Ipython but would crash when run in the terminal. It ran in terminal when I eliminated the file dialog and the file dialog code ran without the plotting. I rewrote the script using pyqt4, and avoided using pyplot using matplotlib figure instead. First question is is it true that I should avoid any use of pyplot in a gui app? Second is that I find it hard to do things in matplotlib that are easy in pyplot like drawing horizontal or vertical lines and such. Is there documentation and code examples using the matplotlib without pyplot? Thanks, Eric -- View this message in context: http://matplotlib.1069221.n5.nabble.com/Use-of-Pyplot-in-a-GUI-script-tp47030.html Sent from the matplotlib - users mailing list archive at Nabble.com.