From carandraug at octave.org Thu Oct 1 20:42:29 2015 From: carandraug at octave.org (=?UTF-8?B?Q2FybsOrIERyYXVn?=) Date: Thu, 1 Oct 2015 19:42:29 +0100 Subject: [Matplotlib-users] viridis colormap model Message-ID: Hi I saw the new default colormap viridis and I was wondering about the function that was used to generated it. Looking inside the source, I only found hardcoded values for a 256 long colormap [1]. I understand that I can interpolate this to get a colormap of any length. However, what I'm really trying to find is the function that was used to generate those values in the first place. I'm not so much interested in the actual python code to do it, my interest is purely the mathematical model behind it. Is this published anywhere? If not, can anyone tell me where to find the model? Thank you Carn? [1] https://github.com/matplotlib/matplotlib/blob/b9710e674878799f9b7279802291a3d245b36e08/lib/matplotlib/_cm_listed.py#L774 From nathan12343 at gmail.com Thu Oct 1 20:46:52 2015 From: nathan12343 at gmail.com (Nathan Goldbaum) Date: Thu, 1 Oct 2015 13:46:52 -0500 Subject: [Matplotlib-users] viridis colormap model In-Reply-To: References: Message-ID: The code used to generate all of the new colormaps is in these repositories: https://github.com/BIDS/colormap https://github.com/matplotlib/viscm See also the appendix at the bottom of this page: http://bids.github.io/colormap/ As well as Stefan and Nathaniel's talk at this year's scipy: https://www.youtube.com/watch?v=xAoljeRJ3lU On Thu, Oct 1, 2015 at 1:42 PM, Carn? Draug wrote: > Hi > > I saw the new default colormap viridis and I was wondering about the > function that was used to generated it. Looking inside the source, > I only found hardcoded values for a 256 long colormap [1]. > > I understand that I can interpolate this to get a colormap of any > length. However, what I'm really trying to find is the function that > was used to generate those values in the first place. I'm not so much > interested in the actual python code to do it, my interest is purely the > mathematical model behind it. > > Is this published anywhere? If not, can anyone tell me where to find > the model? > > Thank you > Carn? > > [1] > https://github.com/matplotlib/matplotlib/blob/b9710e674878799f9b7279802291a3d245b36e08/lib/matplotlib/_cm_listed.py#L774 > _______________________________________________ > 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 carandraug at octave.org Fri Oct 2 19:45:05 2015 From: carandraug at octave.org (=?UTF-8?B?Q2FybsOrIERyYXVn?=) Date: Fri, 2 Oct 2015 18:45:05 +0100 Subject: [Matplotlib-users] viridis colormap model In-Reply-To: References: Message-ID: On 1 October 2015 at 19:46, Nathan Goldbaum wrote: > On Thu, Oct 1, 2015 at 1:42 PM, Carn? Draug wrote: >> >> Hi >> >> I saw the new default colormap viridis and I was wondering about the >> function that was used to generated it. Looking inside the source, >> I only found hardcoded values for a 256 long colormap [1]. >> >> I understand that I can interpolate this to get a colormap of any >> length. However, what I'm really trying to find is the function that >> was used to generate those values in the first place. I'm not so much >> interested in the actual python code to do it, my interest is purely the >> mathematical model behind it. >> >> Is this published anywhere? If not, can anyone tell me where to find >> the model? >> >> Thank you >> Carn? >> >> [1] >> https://github.com/matplotlib/matplotlib/blob/b9710e674878799f9b7279802291a3d245b36e08/lib/matplotlib/_cm_listed.py#L774 > > The code used to generate all of the new colormaps is in these repositories: > > https://github.com/BIDS/colormap > https://github.com/matplotlib/viscm > > See also the appendix at the bottom of this page: > > http://bids.github.io/colormap/ > > As well as Stefan and Nathaniel's talk at this year's scipy: > > https://www.youtube.com/watch?v=xAoljeRJ3lU > Thank you. This is exactly what I was looking for. Carn? From jessica.b.hamrick at gmail.com Fri Oct 9 03:25:05 2015 From: jessica.b.hamrick at gmail.com (Jess Hamrick) Date: Thu, 8 Oct 2015 18:25:05 -0700 Subject: [Matplotlib-users] Grading matplotlib plots Message-ID: <2DD5D3EB-4B7A-4909-B964-9CBED84F7ECF@gmail.com> Hi all, I am not sure how much this will interest people here, but given that it?s related to matplotlib I thought it was worth posting :-) I have created a little utility package, called ?plotchecker?, which helps instructors write autograder tests for matplotlib plots: https://github.com/jhamrick/plotchecker More details: I created this out of a need to be able to write autograder tests for matplotlib plots. However, it?s actually quite difficult to write autograder tests for matplotlib in a robust way, because there?s so many different ways of creating plots. For example, the following two ways of creating a scatter plot produce pretty much the same plot, but with different underlying representations of the data: # method 1, creates a Line object plt.plot(x, y, ?o?) # method 2, creats a Collection object plt.scatter(x, y) Or, in another example, you can create a plot and set the color to ?k?, ?black?, ?#00000?, (0, 0, 0), or (0, 0, 0, 1). These are all exactly the same color, and valid ways of specifying ?black?. But you shouldn?t have to manually test all these options if you want to check that students used the correct color. So, I created plotchecker as an abstraction layer on top of matplotlib that will check all these things for you (e.g., `assert_x_data_equal(x)` regardless of whether `plt.plot` or `plt.scatter` was used, or `assert_colors_equal(?black?)` instead of checking all possible versions of black). Currently, it supports line plots and scatter plots, and I have plans to support at least bar graphs and imshow/matshow plots as well. Briefly, the way that it works is that you create a PlotChecker object (or ScatterPlotChecker or LinePlotChecker) and pass in the relevent Axes object to the constructor. Then, you call methods on the PlotChecker object to assert things about the that Axes object ? e.g. if the data is correct, or the color is correct, or the axis limit are correct, etc. If anyone has any feedback on this, I would love to hear it! Cheers, Jess -------------- next part -------------- An HTML attachment was scrubbed... URL: From ihuang at veritystudios.com Fri Oct 2 17:17:58 2015 From: ihuang at veritystudios.com (isabella) Date: Fri, 2 Oct 2015 08:17:58 -0700 (MST) Subject: [Matplotlib-users] Cannot interact with 3D axis view during Funcanimation animation Message-ID: <1443799078783-46264.post@n5.nabble.com> I have a question about blitting in the FuncAnimation module of matplotlib. After running the source code for this example , I was able to rotate the plot around with my cursor, and the axes followed. However, simply changing blit=False to blit=True still allowed me to move the lines around, but the axes stayed fixed. What do I have to change to allow both blit=True and this movement of the axes? It's evident that ax.elev changes as I rotate the frame, for example, but there seems to be the initial view overlaid on the figure, which makes the axis appear stationary. My own code is experiencing this problem, so I figured I would sort it out with the simplified example. Thanks -- View this message in context: http://matplotlib.1069221.n5.nabble.com/Cannot-interact-with-3D-axis-view-during-Funcanimation-animation-tp46264.html Sent from the matplotlib - users mailing list archive at Nabble.com. From info at lbm.nu Sat Oct 3 21:52:52 2015 From: info at lbm.nu (Lars Eriksson) Date: Sat, 3 Oct 2015 12:52:52 -0700 (MST) Subject: [Matplotlib-users] Update subplot Message-ID: <1443901972158-46269.post@n5.nabble.com> I need to update a plot continuously and if I use ax1.clear() ax.plot(y) fig.show() It work well, but allocate memory for each update and take all CPU resource after a while. To solve the memory allocation problem I used line.set_xdata() line.set_ydata() plt.draw() But I can't find how to use set_data() and draw() for a subplot. Thanks Lars -- View this message in context: http://matplotlib.1069221.n5.nabble.com/Update-subplot-tp46269.html Sent from the matplotlib - users mailing list archive at Nabble.com. From lefeuvreyves33 at gmail.com Mon Oct 5 09:06:25 2015 From: lefeuvreyves33 at gmail.com (Yves Le Feuvre) Date: Mon, 5 Oct 2015 09:06:25 +0200 Subject: [Matplotlib-users] wxbackend scroll_event troubles Message-ID: Hello, on my macOSX (didn't check other OS), canvas.mpl_connect('scroll_event',...) misses every other event when I use mouse wheel (wx.EVT_MOUSEWHEEL works fine and all mouse wheel are reported) exemple code to illustrate the bug (feature?): in right panel, all mouse wheel events are reported in left panel (matplotlib panel), every other two event is missing #!/usr/bin/env python # -*- coding: iso-8859-1 -*-# import wx import numpy import matplotlib import sys from matplotlib.figure import Figure from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas class TestFrame(wx.Frame): def __init__(self,parent,title): wx.Frame.__init__(self,parent,title=title,size=(500,500)) self.sp = wx.SplitterWindow(self) self.p1 = WxPanel(self.sp) self.p2 = MplPanel(self.sp) self.sp.SplitVertically(self.p1,self.p2) class WxPanel(wx.Panel): def __init__(self, parent): wx.Panel.__init__(self, parent,-1,size=(50,50)) self.Bind(wx.EVT_MOUSEWHEEL,self.OnMouseWheel) def OnMouseWheel(self,event): print "wx scroll event" sys.stdout.flush() class MplPanel(wx.Panel): def __init__(self, parent): wx.Panel.__init__(self, parent,-1,size=(50,50)) self.figure = Figure() self.axes = self.figure.add_subplot(111) self.axes.plot(numpy.arange(0.0,10,1.0),[0,1,0,1,0,2,1,2,1,0]) self.canvas = FigureCanvas(self,-1,self.figure) self.canvas.mpl_connect('scroll_event', self.OnMouseWheel) def OnMouseWheel(self,event): print "mpl scroll event" sys.stdout.flush() app = wx.App(redirect=False) frame = TestFrame(None, 'Hello World!') frame.Show() app.MainLoop() any idea how to solve that behavior? -------------- next part -------------- An HTML attachment was scrubbed... URL: From fulmerj at seattleu.edu Thu Oct 8 03:52:56 2015 From: fulmerj at seattleu.edu (JAL2) Date: Wed, 7 Oct 2015 18:52:56 -0700 (MST) Subject: [Matplotlib-users] Need Expert Help - Radar Chart Axis Problem Message-ID: <1444269176154-46286.post@n5.nabble.com> Hi: I'm using matplotlib and Python 3.4 to create a Radar chart. I need an expert to help me with these things: 1) I can't get the last axis or title at 2 o'clock to show up 2) I want to remove the gridlines between the axes so there are only ticks along each of the axes I'd greatly appreciate any feedback, even if you aren't an expert ;) import numpy as np import pylab as pl import matplotlib.pyplot as py class Radar(object): def __init__(self, fig, titles, labels, rect=None): if rect is None: rect = [0.05, 0.05, 0.95, 0.95] self.n = len(titles) self.angles = np.arange(90, 90+360, 360.0/self.n) self.axes = [fig.add_axes(rect, projection="polar", label="axes%d" % i) for i in range(self.n)] self.ax = self.axes[0] self.ax.set_thetagrids(self.angles, labels=titles, fontsize=12, weight="bold") for ax in self.axes[1:]: ax.patch.set_visible(False) ax.grid("on") ax.xaxis.set_visible(False) for ax, angle, label in zip(self.axes, self.angles, labels): ax.set_rgrids(range(1, 6), labels=label, angle=angle, fontsize=12) ax.spines["polar"].set_visible(False) ax.set_ylim(0, 6) def plot(self, values, *args, **kw): angle = np.deg2rad(np.r_[self.angles, self.angles[2]]) values = np.r_[values, values[0]] self.ax.plot(angle, values, *args, **kw) fig = pl.figure(figsize=(6, 10)) titles = [ "Canada", "Australia", "New Zealand", "Japan", "China", "USA", "Mexico", "Finland" ] labels = [ list("abcde"), list("12345"), list("uvwxy"), ["one", "two", "three", "four", "five"], list("jklmn"), list("asdfg"), list("qwert"), [" ", "4.3", "4.4", "4.5", "4.6"] ] radar = Radar(fig, titles, labels) radar.plot([1, 3, 2, 5, 4, 5, 3, 3], "--", lw=1, color="b", alpha=.5, label="USA 2014") radar.plot([2.3, 2, 3, 3, 2, 3, 2, 4],"-", lw=1, color="r", alpha=.5, label="2014") radar.plot([3, 4, 3, 4, 2, 2, 1, 3], "-", lw=1, color="g", alpha=.5, label="2013") radar.plot([4, 5, 4, 5, 3, 3, 4, 4], "-", lw=1, color="y", alpha=.5, label="2012") radar.ax.legend(loc='upper center', bbox_to_anchor=(0.5, -0.10), fancybox=True, shadow=True, ncol=4) fig = py.gcf() fig.set_size_inches(6, 10, forward=True) fig.savefig('test2png.png', dpi=100, bbox_inches="tight", pad_inches=1) -- View this message in context: http://matplotlib.1069221.n5.nabble.com/Need-Expert-Help-Radar-Chart-Axis-Problem-tp46286.html Sent from the matplotlib - users mailing list archive at Nabble.com. From Nicolas.Rougier at inria.fr Fri Oct 9 14:37:38 2015 From: Nicolas.Rougier at inria.fr (Nicolas P. Rougier) Date: Fri, 9 Oct 2015 14:37:38 +0200 Subject: [Matplotlib-users] Need Expert Help - Radar Chart Axis Problem In-Reply-To: <1444269176154-46286.post@n5.nabble.com> References: <1444269176154-46286.post@n5.nabble.com> Message-ID: > On 08 Oct 2015, at 03:52, JAL2 wrote: > > Hi: > > I'm using matplotlib and Python 3.4 to create a Radar chart. I need an > expert to help me with these things: > > 1) I can't get the last axis or title at 2 o'clock to show up You should use: self.angles = np.arange(90, 90+360, 360.0/self.n) % 360 > 2) I want to remove the gridlines between the axes so there are only ticks > along each of the axes Not sure what you mean exactly. Nicolas > > I'd greatly appreciate any feedback, even if you aren't an expert ;) > > import numpy as np > import pylab as pl > import matplotlib.pyplot as py > > class Radar(object): > > def __init__(self, fig, titles, labels, rect=None): > if rect is None: > rect = [0.05, 0.05, 0.95, 0.95] > > self.n = len(titles) > self.angles = np.arange(90, 90+360, 360.0/self.n) > self.axes = [fig.add_axes(rect, projection="polar", label="axes%d" % > i) > for i in range(self.n)] > > self.ax = self.axes[0] > self.ax.set_thetagrids(self.angles, labels=titles, fontsize=12, > weight="bold") > > for ax in self.axes[1:]: > ax.patch.set_visible(False) > ax.grid("on") > ax.xaxis.set_visible(False) > > for ax, angle, label in zip(self.axes, self.angles, labels): > ax.set_rgrids(range(1, 6), labels=label, angle=angle, > fontsize=12) > ax.spines["polar"].set_visible(False) > ax.set_ylim(0, 6) > > def plot(self, values, *args, **kw): > angle = np.deg2rad(np.r_[self.angles, self.angles[2]]) > values = np.r_[values, values[0]] > self.ax.plot(angle, values, *args, **kw) > > fig = pl.figure(figsize=(6, 10)) > > titles = [ > "Canada", "Australia", > "New Zealand", "Japan", "China", "USA", "Mexico", "Finland" > ] > > labels = [ > list("abcde"), list("12345"), list("uvwxy"), > ["one", "two", "three", "four", "five"], > list("jklmn"), list("asdfg"), list("qwert"), [" ", "4.3", "4.4", "4.5", > "4.6"] > ] > > radar = Radar(fig, titles, labels) > radar.plot([1, 3, 2, 5, 4, 5, 3, 3], "--", lw=1, color="b", alpha=.5, > label="USA 2014") > radar.plot([2.3, 2, 3, 3, 2, 3, 2, 4],"-", lw=1, color="r", alpha=.5, > label="2014") > radar.plot([3, 4, 3, 4, 2, 2, 1, 3], "-", lw=1, color="g", alpha=.5, > label="2013") > radar.plot([4, 5, 4, 5, 3, 3, 4, 4], "-", lw=1, color="y", alpha=.5, > label="2012") > > radar.ax.legend(loc='upper center', bbox_to_anchor=(0.5, -0.10), > fancybox=True, shadow=True, ncol=4) > > fig = py.gcf() > fig.set_size_inches(6, 10, forward=True) > fig.savefig('test2png.png', dpi=100, bbox_inches="tight", pad_inches=1) > > > > -- > View this message in context: http://matplotlib.1069221.n5.nabble.com/Need-Expert-Help-Radar-Chart-Axis-Problem-tp46286.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 From ben.v.root at gmail.com Fri Oct 9 16:02:00 2015 From: ben.v.root at gmail.com (Benjamin Root) Date: Fri, 9 Oct 2015 10:02:00 -0400 Subject: [Matplotlib-users] Cannot interact with 3D axis view during Funcanimation animation In-Reply-To: <1443799078783-46264.post@n5.nabble.com> References: <1443799078783-46264.post@n5.nabble.com> Message-ID: Blitting fundamentally means "copy the background without any animated parts and use that bitmap instead of re-rendering it". So, unless the codebase is set up to re-blit the background every time it changes, interactivity won't work. We have some real basic support for panning/zooming in 2D plots while blitting, but that ties into the event handler. Rotating a 3D plot isn't an explicit event, so we haven't added blitting support for that yet. Ben Root On Fri, Oct 2, 2015 at 11:17 AM, isabella wrote: > I have a question about blitting in the FuncAnimation module of matplotlib. > After running the source code for this example > , I was > able > to rotate the plot around with my cursor, and the axes followed. > > However, simply changing blit=False to blit=True still allowed me to move > the lines around, but the axes stayed fixed. What do I have to change to > allow both blit=True and this movement of the axes? > > It's evident that ax.elev changes as I rotate the frame, for example, but > there seems to be the initial view overlaid on the figure, which makes the > axis appear stationary. > > My own code is experiencing this problem, so I figured I would sort it out > with the simplified example. > > Thanks > > > > -- > View this message in context: > http://matplotlib.1069221.n5.nabble.com/Cannot-interact-with-3D-axis-view-during-Funcanimation-animation-tp46264.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 Fri Oct 9 15:56:00 2015 From: ben.v.root at gmail.com (Benjamin Root) Date: Fri, 9 Oct 2015 09:56:00 -0400 Subject: [Matplotlib-users] Animating 3D quiver plot in 1.4.3? In-Reply-To: <1442479075780-46181.post@n5.nabble.com> References: <1442479075780-46181.post@n5.nabble.com> Message-ID: Part of the problem with the 3d version of quiver is that it isn't based off of the 2D version of quiver, so there is no "set_UVC" method available. The 3D quiver is just a Line3DCollection object, so you do have access to the set_segments() method, which accepts a MxN(m)x3 array of vertices where M is the number of lines, and N(m) is the number of vertices for line m. To clear a quiver plot, one could just remove the artist, but that is a bit heavy-handed. I think the set_segments() approach above should be sufficient. Note that if you want to do anything special with the colors or some other property, that might be tricker, but doable. Cheers! Ben Root On Thu, Sep 17, 2015 at 4:37 AM, plottingberra wrote: > Hello! > > I want to create a 3D animation that animates the trajectory of a flying > object. The FuncAnimation object has been really helpful in doing so, but > now I want to plot an arrow (using the Quiver class) depicting the > acceleration vector at the object's position in its path. > > My key problem is that I only want exactly one arrow on the plot at a time. > Currently I am able to create an animated trail of arrows, but I want to > clear the arrows that were plotted before a certain time t. I know that > there exists a method set_UVC that allows for this sort of data updating, > but I cannot get it to work for the 3D case. > > Alternatively, I tried searching for a method that clears the entire quiver > plot (inelegant, but should work for my loop), but was unsuccessful in > finding one that works. > > I'd like to ask, then: > 1. Is there a way of making set_UVC work for my 3D case? > 2. What is the proper way to clear a quiver plot? > > Thank you so much! > > > > -- > View this message in context: > http://matplotlib.1069221.n5.nabble.com/Animating-3D-quiver-plot-in-1-4-3-tp46181.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 tcaswell at gmail.com Fri Oct 9 16:16:14 2015 From: tcaswell at gmail.com (Thomas Caswell) Date: Fri, 09 Oct 2015 14:16:14 +0000 Subject: [Matplotlib-users] Animating 3D quiver plot in 1.4.3? In-Reply-To: References: <1442479075780-46181.post@n5.nabble.com> Message-ID: I would suggest going with the 'just remove the artist' path here unless there is a serious performance issue. The internal artist structure of the 3D quiver is effective for getting the lines on the screen, but needs some re-working (it is a collection of line segments, not of arrows, so the arrow tail and the two lines is the arrow head are actually 3 lines in the collection). Tom On Fri, Oct 9, 2015 at 10:03 AM Benjamin Root wrote: > Part of the problem with the 3d version of quiver is that it isn't based > off of the 2D version of quiver, so there is no "set_UVC" method available. > The 3D quiver is just a Line3DCollection object, so you do have access to > the set_segments() method, which accepts a MxN(m)x3 array of vertices where > M is the number of lines, and N(m) is the number of vertices for line m. > > To clear a quiver plot, one could just remove the artist, but that is a > bit heavy-handed. I think the set_segments() approach above should be > sufficient. Note that if you want to do anything special with the colors or > some other property, that might be tricker, but doable. > > Cheers! > Ben Root > > > On Thu, Sep 17, 2015 at 4:37 AM, plottingberra > wrote: > >> Hello! >> >> I want to create a 3D animation that animates the trajectory of a flying >> object. The FuncAnimation object has been really helpful in doing so, but >> now I want to plot an arrow (using the Quiver class) depicting the >> acceleration vector at the object's position in its path. >> >> My key problem is that I only want exactly one arrow on the plot at a >> time. >> Currently I am able to create an animated trail of arrows, but I want to >> clear the arrows that were plotted before a certain time t. I know that >> there exists a method set_UVC that allows for this sort of data updating, >> but I cannot get it to work for the 3D case. >> >> Alternatively, I tried searching for a method that clears the entire >> quiver >> plot (inelegant, but should work for my loop), but was unsuccessful in >> finding one that works. >> >> I'd like to ask, then: >> 1. Is there a way of making set_UVC work for my 3D case? >> 2. What is the proper way to clear a quiver plot? >> >> Thank you so much! >> >> >> >> -- >> View this message in context: >> http://matplotlib.1069221.n5.nabble.com/Animating-3D-quiver-plot-in-1-4-3-tp46181.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 >> > > _______________________________________________ > 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 Oct 9 16:33:47 2015 From: ben.v.root at gmail.com (Benjamin Root) Date: Fri, 9 Oct 2015 10:33:47 -0400 Subject: [Matplotlib-users] Animating 3D quiver plot in 1.4.3? In-Reply-To: References: <1442479075780-46181.post@n5.nabble.com> Message-ID: Oh, right, I forgot about that part. On Fri, Oct 9, 2015 at 10:16 AM, Thomas Caswell wrote: > I would suggest going with the 'just remove the artist' path here unless > there is a serious performance issue. > > The internal artist structure of the 3D quiver is effective for getting > the lines on the screen, but needs some re-working (it is a collection of > line segments, not of arrows, so the arrow tail and the two lines is the > arrow head are actually 3 lines in the collection). > > Tom > > On Fri, Oct 9, 2015 at 10:03 AM Benjamin Root > wrote: > >> Part of the problem with the 3d version of quiver is that it isn't based >> off of the 2D version of quiver, so there is no "set_UVC" method available. >> The 3D quiver is just a Line3DCollection object, so you do have access to >> the set_segments() method, which accepts a MxN(m)x3 array of vertices where >> M is the number of lines, and N(m) is the number of vertices for line m. >> >> To clear a quiver plot, one could just remove the artist, but that is a >> bit heavy-handed. I think the set_segments() approach above should be >> sufficient. Note that if you want to do anything special with the colors or >> some other property, that might be tricker, but doable. >> >> Cheers! >> Ben Root >> >> >> On Thu, Sep 17, 2015 at 4:37 AM, plottingberra >> wrote: >> >>> Hello! >>> >>> I want to create a 3D animation that animates the trajectory of a flying >>> object. The FuncAnimation object has been really helpful in doing so, but >>> now I want to plot an arrow (using the Quiver class) depicting the >>> acceleration vector at the object's position in its path. >>> >>> My key problem is that I only want exactly one arrow on the plot at a >>> time. >>> Currently I am able to create an animated trail of arrows, but I want to >>> clear the arrows that were plotted before a certain time t. I know that >>> there exists a method set_UVC that allows for this sort of data updating, >>> but I cannot get it to work for the 3D case. >>> >>> Alternatively, I tried searching for a method that clears the entire >>> quiver >>> plot (inelegant, but should work for my loop), but was unsuccessful in >>> finding one that works. >>> >>> I'd like to ask, then: >>> 1. Is there a way of making set_UVC work for my 3D case? >>> 2. What is the proper way to clear a quiver plot? >>> >>> Thank you so much! >>> >>> >>> >>> -- >>> View this message in context: >>> http://matplotlib.1069221.n5.nabble.com/Animating-3D-quiver-plot-in-1-4-3-tp46181.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 >>> >> >> _______________________________________________ >> 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 Fri Oct 9 22:09:55 2015 From: tcaswell at gmail.com (Thomas Caswell) Date: Fri, 09 Oct 2015 20:09:55 +0000 Subject: [Matplotlib-users] Update subplot In-Reply-To: <1443901972158-46269.post@n5.nabble.com> References: <1443901972158-46269.post@n5.nabble.com> Message-ID: Lars, I am not sure what you mean by "set_data() and draw() for a subplot.". If you have a reference to the `Line2D` object, a call to `set_data` will update the x, y values for that line. Tom On Fri, Oct 9, 2015 at 7:19 AM Lars Eriksson wrote: > I need to update a plot continuously and if I use > ax1.clear() > ax.plot(y) > fig.show() > It work well, but allocate memory for each update and take all CPU resource > after a while. > To solve the memory allocation problem I used > line.set_xdata() > line.set_ydata() > plt.draw() > But I can't find how to use set_data() and draw() for a subplot. > > Thanks > Lars > > > > > -- > View this message in context: > http://matplotlib.1069221.n5.nabble.com/Update-subplot-tp46269.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 tcaswell at gmail.com Sat Oct 10 01:09:24 2015 From: tcaswell at gmail.com (Thomas Caswell) Date: Fri, 09 Oct 2015 23:09:24 +0000 Subject: [Matplotlib-users] read a png image with alpha gives uncorrect colors In-Reply-To: <1441985986263-46131.post@n5.nabble.com> References: <1441985986263-46131.post@n5.nabble.com> Message-ID: I can't find it right now, but there is an issue on the scikit image issue tracker which was a similar problem. I suspect the problem is that our png read is not sophisticated enough and your png maybe encoded ckmy. Tom On Fri, Oct 9, 2015 at 7:19 AM PBrockmann wrote: > Hi, > > I have encountered a problem with this simplified code where I produce > a windrose with some alpha level. > Then read this png image to check. > Then discover that the colors are not correct. > > What is the mistake ? > I am puzzled. > > I use matplotlib 1.4.3 > > The correct windrose with alpha colors > > > The read png image. > > > Regards > Patrick > > > > > > > > -- > View this message in context: > http://matplotlib.1069221.n5.nabble.com/read-a-png-image-with-alpha-gives-uncorrect-colors-tp46131.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 nico.schloemer at gmail.com Sun Oct 11 23:02:47 2015 From: nico.schloemer at gmail.com (=?UTF-8?Q?Nico_Schl=C3=B6mer?=) Date: Sun, 11 Oct 2015 21:02:47 +0000 Subject: [Matplotlib-users] legend--plot handle association Message-ID: Hi everyone, Given a legend [1], I'm trying to figure out which plot handles it references. Is this possible at all? The reverse would also be fine, i.e., given a plot handle (e.g., a line), find the legend(s) in which it is referenced. Cheers, Nico [1] http://matplotlib.org/api/legend_api.html -------------- next part -------------- An HTML attachment was scrubbed... URL: From tcaswell at gmail.com Mon Oct 12 00:14:44 2015 From: tcaswell at gmail.com (Thomas Caswell) Date: Sun, 11 Oct 2015 22:14:44 +0000 Subject: [Matplotlib-users] Problem : Combining mouse button events with pick events in a scatter plot In-Reply-To: <1441757569387-46109.post@n5.nabble.com> References: <1441757569387-46109.post@n5.nabble.com> Message-ID: The issue unrelated to the pick events, it is due to clicking without moving the mouse (and can be reproduced with all of the pick logic removed). In your `onpress` you lock the widget and then in the `callback` you pass to lasso widget you release it, however if you start the lasso, but do not move the mouse no move_events are generated, then the callback is never called. You probably should handle the unlocking in a 'button_release_event'. Tom On Fri, Oct 9, 2015 at 7:19 AM joh wrote: > Hello everybody, > > > I am trying to combine mouse button events with a pick event in scatter > plot. Different functionalities take place, based on the mouse button > pressed each time. I want each functionality to be triggered with a > combination of mouse buttons events and/or key press events. When the left > mouse button is pressed matplotlib's Lasso widget is called and with the > included points functionality 1 takes place. When Shift+LMB are pressed a > Lasso is drawn and functionality 2 takes place with the included points. > When Alt+LMB are pressed a Lasso is drawn and with the included points > functionality 3 takes place. Last, but not least, when I press the RMB a > pick event is triggered and the index of the selected point in the scatter > plot is given. > > Since I added the pick event, the aforementioned functionalities work > correctly until a pick event is triggered. When it is triggered it seems > that the canvas gets locked and I can not use any other functionality. I > don't get the index of the selected points and I do not get any errors. > > > ----------------Code------------------------- > > import logging > import matplotlib > from matplotlib.widgets import Lasso > from matplotlib.colors import colorConverter > from matplotlib.collections import RegularPolyCollection > from matplotlib import path > import numpy as np > import matplotlib.pyplot as plt > from numpy.random import rand > > logger = logging.getLogger() > logger.setLevel(logging.DEBUG) > > > class Datum(object): > colorin = colorConverter.to_rgba('red') > colorShift = colorConverter.to_rgba('cyan') > colorCtrl = colorConverter.to_rgba('pink') > colorout = colorConverter.to_rgba('blue') > > def __init__(self, x, y, include=False): > self.x = x > self.y = y > if include: > self.color = self.colorin > else: > self.color = self.colorout > > > class LassoManager(object): > def __init__(self, ax, data): > self.axes = ax > self.canvas = ax.figure.canvas > self.data = data > > self.Nxy = len(data) > > facecolors = [d.color for d in data] > self.xys = [(d.x, d.y) for d in data] > fig = ax.figure > self.collection = RegularPolyCollection(fig.dpi, 6, > sizes=(100,),facecolors=facecolors, offsets = self.xys, transOffset = > ax.transData) > > ax.add_collection(self.collection) > > self.pick=self.canvas.mpl_connect('pick_event', self.onpick) > self.cid = self.canvas.mpl_connect('button_press_event', > self.onpress) > self.keyPress = self.canvas.mpl_connect('key_press_event', > self.onKeyPress) > self.keyRelease = self.canvas.mpl_connect('key_release_event', > self.onKeyRelease) > self.lasso = None > self.shiftKey = False > self.ctrlKey = False > > def callback(self, verts): > logging.debug('in LassoManager.callback(). Shift: %s, Ctrl: %s' % > (self.shiftKey, self.ctrlKey)) > facecolors = self.collection.get_facecolors() > p = path.Path(verts) > ind = p.contains_points(self.xys) > for i in range(len(self.xys)): > if ind[i]: > if self.shiftKey: > facecolors[i] = Datum.colorShift > elif self.ctrlKey: > facecolors[i] = Datum.colorCtrl > else: > facecolors[i] = Datum.colorin > print self.xys[i] > else: > facecolors[i] = Datum.colorout > > self.canvas.draw_idle() > self.canvas.widgetlock.release(self.lasso) > del self.lasso > > def onpress(self, event): > if self.canvas.widgetlock.locked(): return > if event.inaxes is None: return > self.lasso = Lasso(event.inaxes, (event.xdata, event.ydata), > self.callback) > # acquire a lock on the widget drawing > self.canvas.widgetlock(self.lasso) > > def onKeyPress(self, event): > logging.debug('in LassoManager.onKeyPress(). Event received: %s > (key: %s)' % (event, event.key)) > if event.key == 'alt': > self.ctrlKey = True > if event.key == 'shift': > self.shiftKey = True > > def onKeyRelease(self, event): > logging.debug('in LassoManager.onKeyRelease(). Event received: %s > (key: %s)' % (event, event.key)) > if event.key == 'alt': > self.ctrlKey = False > if event.key == 'shift': > self.shiftKey = False > > > def onpick(self,event): > > if event.mouseevent.button == 3: > > index = event.ind > print('onpick3 scatter:', index) > > if __name__ == '__main__': > > data = [Datum(*xy) for xy in rand(100, 2)] > > ax = plt.axes(xlim=(0,1), ylim=(0,1), autoscale_on=False) > lman = LassoManager(ax, data) > > plt.show() > > ------------------End of Code----------------------------- > > Any suggestions on what might be causing this malfunction? What am I doing > wrong? > > > > -- > View this message in context: > http://matplotlib.1069221.n5.nabble.com/Problem-Combining-mouse-button-events-with-pick-events-in-a-scatter-plot-tp46109.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 tcaswell at gmail.com Mon Oct 12 04:54:11 2015 From: tcaswell at gmail.com (Thomas Caswell) Date: Mon, 12 Oct 2015 02:54:11 +0000 Subject: [Matplotlib-users] Matplotlib 1.4.2 / 1.4.3 doesn't install from source In-Reply-To: <1442364636453-46170.post@n5.nabble.com> References: <1442364636453-46170.post@n5.nabble.com> Message-ID: The issue is that python c-extensions (which mpl uses to provide some of the underlying rendering logic) are basically shared libraries (*.so), the version of libstdc++ that your compiler is finding is a static library (/usr/local/lib64/libstdc++.a) which is not suitable for linking into a so. Are you sure you have all the development packages installed for your OS? I also strongly suggest against doing `sudo python setup.py install` unless you are absolutely sure you know what you are doing. It is much safer to use virtual envs / conda envs so that you can compile/install into user space. Tom On Fri, Oct 9, 2015 at 7:19 AM fbarbuto wrote: > Hello, > > I have Matplotlib 1.3.1 installed on my Ubuntu 14.04 system and thought it > was time to upgrade to 1.4.2. I never get the latest version for > compatibility reasons (some packages that use Matplotlib might stop > working). I then downloaded the tarball, uncompressed its contents into a > folder and executed "sudo python setup.py build". However, I got the > following error (last few lines only): > > c++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions > -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g > -fwrapv -O2 -Wall -Wstrict-prototypes -D_FORTIFY_SOURCE=2 -g > -fstack-protector --param=ssp-buffer-size=4 -Wformat > -Werror=format-security > build/temp.linux-x86_64-2.7/src/ft2font.o > build/temp.linux-x86_64-2.7/src/mplutils.o > build/temp.linux-x86_64-2.7/extern/CXX/cxxsupport.o > build/temp.linux-x86_64-2.7/extern/CXX/cxx_extensions.o > build/temp.linux-x86_64-2.7/extern/CXX/IndirectPythonInterface.o > build/temp.linux-x86_64-2.7/extern/CXX/cxxextensions.o -L/usr/local/lib > -L/usr/local/lib64 -lfreetype -lstdc++ -lm -o > build/lib.linux-x86_64-2.7/matplotlib/ft2font.so > /usr/bin/ld: /usr/local/lib64/libstdc++.a(si_class_type_info.o): relocation > R_X86_64_32S against `_ZTVN10__cxxabiv120__si_class_type_infoE' can not be > used when making a shared object; recompile with -fPIC > /usr/local/lib64/libstdc++.a: error adding symbols: Bad value > collect2: error: ld returned 1 exit status > error: command 'c++' failed with exit status 1 > > I then tried the same with Matplotlib 1.4.3 (why not?) and got the same > results. > > What's going on here? > > Thanks so much for any help. > > Fausto > > > > -- > View this message in context: > http://matplotlib.1069221.n5.nabble.com/Matplotlib-1-4-2-1-4-3-doesn-t-install-from-source-tp46170.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 tcaswell at gmail.com Mon Oct 12 04:55:41 2015 From: tcaswell at gmail.com (Thomas Caswell) Date: Mon, 12 Oct 2015 02:55:41 +0000 Subject: [Matplotlib-users] RuntimeError. LaTeX was not able to process the following string In-Reply-To: <1441349620132-46091.post@n5.nabble.com> References: <1441349620132-46091.post@n5.nabble.com> Message-ID: Can you provide any more context or a minimal code snippet that demonstrates the issue? From the current information there is nothing anyone can do to help you. Tom On Fri, Oct 9, 2015 at 7:19 AM bsjun <91bsjun at gmail.com> wrote: > How can I fix this error? > > I'm using Cent OS.. > > I installed Latex by 'yum install tetex' > > > > > -- > View this message in context: > http://matplotlib.1069221.n5.nabble.com/RuntimeError-LaTeX-was-not-able-to-process-the-following-string-tp46091.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 efiring at hawaii.edu Mon Oct 12 18:48:25 2015 From: efiring at hawaii.edu (Eric Firing) Date: Mon, 12 Oct 2015 06:48:25 -1000 Subject: [Matplotlib-users] Matplotlib 1.4.2 / 1.4.3 doesn't install from source In-Reply-To: References: <1442364636453-46170.post@n5.nabble.com> Message-ID: <561BE459.5090000@hawaii.edu> On 2015/10/11 4:54 PM, Thomas Caswell wrote: > The issue is that python c-extensions (which mpl uses to provide some of > the underlying rendering logic) are basically shared libraries (*.so), > the version of libstdc++ that your compiler is finding is a static > library (/usr/local/lib64/libstdc++.a) which is not suitable for linking > into a so. Are you sure you have all the development packages installed > for your OS? It's odd that something like libstdc++ is being found in /usr/local. This is not the ubuntu version. It sounds like the basic problem is that some earlier manual installation of software has messed up your development environment; files in /usr/local are masking the files from the ubuntu distro. Eric > > I also strongly suggest against doing `sudo python setup.py install` > unless you are absolutely sure you know what you are doing. It is much > safer to use virtual envs / conda envs so that you can compile/install > into user space. > > Tom > > On Fri, Oct 9, 2015 at 7:19 AM fbarbuto > wrote: > > Hello, > > I have Matplotlib 1.3.1 installed on my Ubuntu 14.04 system and > thought it > was time to upgrade to 1.4.2. I never get the latest version for > compatibility reasons (some packages that use Matplotlib might stop > working). I then downloaded the tarball, uncompressed its contents > into a > folder and executed "sudo python setup.py build". However, I got the > following error (last few lines only): > > c++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions > -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g > -fwrapv -O2 -Wall -Wstrict-prototypes -D_FORTIFY_SOURCE=2 -g > -fstack-protector --param=ssp-buffer-size=4 -Wformat > -Werror=format-security > build/temp.linux-x86_64-2.7/src/ft2font.o > build/temp.linux-x86_64-2.7/src/mplutils.o > build/temp.linux-x86_64-2.7/extern/CXX/cxxsupport.o > build/temp.linux-x86_64-2.7/extern/CXX/cxx_extensions.o > build/temp.linux-x86_64-2.7/extern/CXX/IndirectPythonInterface.o > build/temp.linux-x86_64-2.7/extern/CXX/cxxextensions.o -L/usr/local/lib > -L/usr/local/lib64 -lfreetype -lstdc++ -lm -o > build/lib.linux-x86_64-2.7/matplotlib/ft2font.so > /usr/bin/ld: /usr/local/lib64/libstdc++.a(si_class_type_info.o): > relocation > R_X86_64_32S against `_ZTVN10__cxxabiv120__si_class_type_infoE' can > not be > used when making a shared object; recompile with -fPIC > /usr/local/lib64/libstdc++.a: error adding symbols: Bad value > collect2: error: ld returned 1 exit status > error: command 'c++' failed with exit status 1 > > I then tried the same with Matplotlib 1.4.3 (why not?) and got the same > results. > > What's going on here? > > Thanks so much for any help. > > Fausto > > > > -- > View this message in context: > http://matplotlib.1069221.n5.nabble.com/Matplotlib-1-4-2-1-4-3-doesn-t-install-from-source-tp46170.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 > > > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > From adlinds3 at ncsu.edu Wed Oct 14 19:30:02 2015 From: adlinds3 at ncsu.edu (Alex Lindsay) Date: Wed, 14 Oct 2015 13:30:02 -0400 Subject: [Matplotlib-users] Axes scaling Message-ID: <561E911A.6080604@ncsu.edu> Hi all, I was wondering if there's been any work done on creating an auto-scaling option such that, for example, when I create a legend off of my plot, the figure area automatically scales to included my legend, and I don't have to manually tune parameters in the add_axes method? As a reference: http://stackoverflow.com/questions/9651092/my-matplotlib-pyplot-legend-is-being-cut-off I would save time and really appreciate it if I didn't have to go through a series of re-renders to get my plots to display. Alex From m.hofsaess at gmail.com Wed Oct 14 23:30:34 2015 From: m.hofsaess at gmail.com (=?UTF-8?B?TWFydGluIEhvZnPDpMOf?=) Date: Wed, 14 Oct 2015 23:30:34 +0200 Subject: [Matplotlib-users] Standard deviation psd Message-ID: Hi, I'm using the psd function from matplotlib to calculate the averaged spectrum. That works fine. But I need also the standard deviation (STD) of the averaging for each frequency. I prefer a solution with a additional flag in the function, that return additional the STD. It there a nice way to get it? Thanks for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: From nico.schloemer at gmail.com Thu Oct 15 02:17:30 2015 From: nico.schloemer at gmail.com (=?UTF-8?Q?Nico_Schl=C3=B6mer?=) Date: Thu, 15 Oct 2015 00:17:30 +0000 Subject: [Matplotlib-users] matplotlib2tikz Message-ID: Hi everyone, I recently uploaded matplotlib2tikz to PyPi [1] and would love some feedback. Cheers, Nico [1] https://pypi.python.org/pypi/matplotlib2tikz -------------- next part -------------- An HTML attachment was scrubbed... URL: From ndbecker2 at gmail.com Thu Oct 15 14:38:47 2015 From: ndbecker2 at gmail.com (Neal Becker) Date: Thu, 15 Oct 2015 08:38:47 -0400 Subject: [Matplotlib-users] matplotlib2tikz References: Message-ID: Nico Schl?mer wrote: > Hi everyone, > > I recently uploaded matplotlib2tikz to PyPi [1] and would love some > feedback. > > Cheers, > Nico > > > [1] https://pypi.python.org/pypi/matplotlib2tikz Thanks! Seems interesting. But I've never understood the advantages of using tikz rather than just including a pdf into the latex (or lyx). From pmhobson at gmail.com Thu Oct 15 16:38:23 2015 From: pmhobson at gmail.com (Paul Hobson) Date: Thu, 15 Oct 2015 07:38:23 -0700 Subject: [Matplotlib-users] matplotlib2tikz In-Reply-To: References: Message-ID: I've never used tikz or pgf directly myself. But they can do some pretty neat things: http://tex.stackexchange.com/questions/158668/nice-scientific-pictures-show-off On Thu, Oct 15, 2015 at 5:38 AM, Neal Becker wrote: > Nico Schl?mer wrote: > > > Hi everyone, > > > > I recently uploaded matplotlib2tikz to PyPi [1] and would love some > > feedback. > > > > Cheers, > > Nico > > > > > > [1] https://pypi.python.org/pypi/matplotlib2tikz > > Thanks! Seems interesting. > > But I've never understood the advantages of using tikz rather than just > including a pdf into the latex (or lyx). > > _______________________________________________ > 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 projetmbc at gmail.com Thu Oct 15 18:23:41 2015 From: projetmbc at gmail.com (Christophe Bal) Date: Thu, 15 Oct 2015 18:23:41 +0200 Subject: [Matplotlib-users] matplotlib2tikz In-Reply-To: References: Message-ID: Using a TiKz code instead of a PDF allows to have consistent formatings easily. For example, if I change the font of my Latex document containing a TiKz plot I do not have to edit this plot, almost everytime. In the case of a PDF, I will have to edit my document if I want my font to be the same. You can imagine other LaTeX features. But having a lot of TiKz pictures can't slow down dramatically the compilation of a LaTeX document. Le 15 oct. 2015 14:39, "Neal Becker" a ?crit : > Nico Schl?mer wrote: > > > Hi everyone, > > > > I recently uploaded matplotlib2tikz to PyPi [1] and would love some > > feedback. > > > > Cheers, > > Nico > > > > > > [1] https://pypi.python.org/pypi/matplotlib2tikz > > Thanks! Seems interesting. > > But I've never understood the advantages of using tikz rather than just > including a pdf into the latex (or lyx). > > _______________________________________________ > 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 Fri Oct 16 16:10:02 2015 From: jslavin at cfa.harvard.edu (Slavin, Jonathan) Date: Fri, 16 Oct 2015 10:10:02 -0400 Subject: [Matplotlib-users] duplicating a line object Message-ID: Hi, I have a plot on which I want to plot many points as open circles. I also want to include a legend. The problem is that while a thin marker edge width works very nicely for the plot, it is difficult to see in the legend. My solution, which does work, is to define Line2D objects as proxy artists and keep all the attributes the same except the mew, which I increase. However, this seems error prone: if one changes attributes of the line, then one has to also make those same changes to the proxy artist line. I thought a better solution was to create the proxy artist as a duplicate (copy) of the line and then change the mew via line.set_mew(n). However, I haven't been able to figure out how to duplicate a Line2D object. I tried copy and deepcopy from the python builtin copy module, but those didn't work. Any help on this (including alternative ways of approaching the problem) would be appreciated. Thanks, 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 ben.v.root at gmail.com Fri Oct 16 16:37:36 2015 From: ben.v.root at gmail.com (Benjamin Root) Date: Fri, 16 Oct 2015 10:37:36 -0400 Subject: [Matplotlib-users] duplicating a line object In-Reply-To: References: Message-ID: Traitlets might be the solution here. You set up your proxy artist to have properties that are linked to the properties of the plot object. When one is updated, the other gets updated as well. The automatic linking of plot objects to legend proxy artists is is one of the many benefits that would come about with the future inclusion of traitlets in matplotlib. However, I don't think you need to wait for us to get that aspect working. Since you are already creating proxy artists, I think it shouldn't be that much more effort to link their properties together with traitlets. Unfortunately, the documentation is fairly sparse, and examples are minimal as well. I know there was some decent examples during the SciPy tutorials, but I can't seem to find it at the moment... Ben Root On Fri, Oct 16, 2015 at 10:10 AM, Slavin, Jonathan wrote: > Hi, > > I have a plot on which I want to plot many points as open circles. I also > want to include a legend. The problem is that while a thin marker edge > width works very nicely for the plot, it is difficult to see in the > legend. My solution, which does work, is to define Line2D objects as proxy > artists and keep all the attributes the same except the mew, which I > increase. However, this seems error prone: if one changes attributes of > the line, then one has to also make those same changes to the proxy artist > line. I thought a better solution was to create the proxy artist as a > duplicate (copy) of the line and then change the mew via line.set_mew(n). > However, I haven't been able to figure out how to duplicate a Line2D > object. I tried copy and deepcopy from the python builtin copy module, but > those didn't work. Any help on this (including alternative ways of > approaching the problem) would be appreciated. > > Thanks, > 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 > ________________________________________________________ > > > _______________________________________________ > 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 Fri Oct 16 17:09:48 2015 From: jslavin at cfa.harvard.edu (Slavin, Jonathan) Date: Fri, 16 Oct 2015 11:09:48 -0400 Subject: [Matplotlib-users] duplicating a line object In-Reply-To: References: Message-ID: Hi Ben, Hmm, traitlets sound interesting, though I want one of the traits (i.e. the marker edge width) to differ. Actually, it turns out that copying using copy does work. I'm not sure what I was doing wrong before, but now I'm getting what I wanted. Regards, Jon On Fri, Oct 16, 2015 at 10:37 AM, Benjamin Root wrote: > Traitlets might be the solution here. You set up your proxy artist to have > properties that are linked to the properties of the plot object. When one > is updated, the other gets updated as well. The automatic linking of plot > objects to legend proxy artists is is one of the many benefits that would > come about with the future inclusion of traitlets in matplotlib. However, I > don't think you need to wait for us to get that aspect working. Since you > are already creating proxy artists, I think it shouldn't be that much more > effort to link their properties together with traitlets. > > Unfortunately, the documentation is fairly sparse, and examples are > minimal as well. I know there was some decent examples during the SciPy > tutorials, but I can't seem to find it at the moment... > > Ben Root > > > On Fri, Oct 16, 2015 at 10:10 AM, Slavin, Jonathan < > jslavin at cfa.harvard.edu> wrote: > >> Hi, >> >> I have a plot on which I want to plot many points as open circles. I >> also want to include a legend. The problem is that while a thin marker >> edge width works very nicely for the plot, it is difficult to see in the >> legend. My solution, which does work, is to define Line2D objects as proxy >> artists and keep all the attributes the same except the mew, which I >> increase. However, this seems error prone: if one changes attributes of >> the line, then one has to also make those same changes to the proxy artist >> line. I thought a better solution was to create the proxy artist as a >> duplicate (copy) of the line and then change the mew via line.set_mew(n). >> However, I haven't been able to figure out how to duplicate a Line2D >> object. I tried copy and deepcopy from the python builtin copy module, but >> those didn't work. Any help on this (including alternative ways of >> approaching the problem) would be appreciated. >> >> Thanks, >> 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 >> ________________________________________________________ >> >> >> _______________________________________________ >> Matplotlib-users mailing list >> Matplotlib-users at python.org >> https://mail.python.org/mailman/listinfo/matplotlib-users >> >> > -- ________________________________________________________ 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 m.martalmeida at gmail.com Tue Oct 20 15:28:24 2015 From: m.martalmeida at gmail.com (Martinho Marta-Almeida) Date: Tue, 20 Oct 2015 14:28:24 +0100 Subject: [Matplotlib-users] grid_locator2 problem in polar plot Message-ID: Hello I am trying to change ticks in vertical axis of a Q1 polar plot. But ticks are placed with some angle hard to understand... How can I fix this!? code and fig follow attached thanks mm -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: test_polar.png Type: image/png Size: 23081 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: test_polar.py Type: text/x-python Size: 934 bytes Desc: not available URL: From fausto_barbuto at yahoo.ca Tue Oct 13 19:57:57 2015 From: fausto_barbuto at yahoo.ca (fbarbuto) Date: Tue, 13 Oct 2015 16:57:57 -0700 (MST) Subject: [Matplotlib-users] Matplotlib 1.4.2 / 1.4.3 doesn't install from source In-Reply-To: <561BE459.5090000@hawaii.edu> References: <1442364636453-46170.post@n5.nabble.com> <561BE459.5090000@hawaii.edu> Message-ID: <143949289.3491618.1444780637938.JavaMail.yahoo@mail.yahoo.com> Hi, On Monday, October 12, 2015 1:48 PM, Eric Firing [via matplotlib] wrote: >It's odd that something like libstdc++ is being found in /usr/local. >This is not the ubuntu version. It sounds like the basic problem is that >some earlier manual installation of software has messed up your >development environment; files in /usr/local are masking the files from >the ubuntu distro. There are indeed two "versions" of libstdc++.a on my computer, and they're different in size: fausto at fausto:/$ sudo find -name "libstdc++.a" -print ./usr/lib/gcc/x86_64-linux-gnu/4.8/libstdc++.a ./usr/local/lib64/libstdc++.a fausto at fausto:/$ ls -la /usr/lib/gcc/x86_64-linux-gnu/4.8/libstdc++.a -rw-r--r-- 1 root root 2900518 Mai 14 15:45 /usr/lib/gcc/x86_64-linux-gnu/4.8/libstdc++.a fausto at fausto:/$ ls -la /usr/local/lib64/libstdc++.a -rw-r--r-- 1 root root 16713082 Abr 21 18:55 /usr/local/lib64/libstdc++.a I wonder what package placed the 2nd version into /usr/local/lib64 and how to get rid of it (I'm not even sure if I should do that). Apparently, all is working fine here (aside from the aforementioned problems with Matplotlib 1.43/1.4.2). Fausto -- View this message in context: http://matplotlib.1069221.n5.nabble.com/Matplotlib-1-4-2-1-4-3-doesn-t-install-from-source-tp46170p46321.html Sent from the matplotlib - users mailing list archive at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From k20shores at aol.com Tue Oct 20 19:48:16 2015 From: k20shores at aol.com (Kyle Shores) Date: Tue, 20 Oct 2015 18:48:16 -0500 Subject: [Matplotlib-users] Quiverkey Message-ID: <37DE5F18-9210-463A-A5F0-BF6C60454A80@aol.com> Hello, I?ve recently been making many plots using the plot.quiver. Quiver works extremely well, but the quiverkey reference arrow is having 2 issues. Either it doesn?t display, or it doesn?t display until I resize the the figure window that is generated. I would like to point out that if there is ever quiver plot that is inside of a grid spec instance that it has never (not even once) displayed the reference arrow in the plot. Do you know how this might be fixed? If you would like, I can provide two examples to better illustrate this. Thanks, Kyle Shores Texas A&M ?18 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jslavin at cfa.harvard.edu Fri Oct 23 09:46:23 2015 From: jslavin at cfa.harvard.edu (Slavin, Jonathan) Date: Fri, 23 Oct 2015 09:46:23 -0400 Subject: [Matplotlib-users] problems with search on the web page Message-ID: Hi, For a while now I've been having problems with searching on the matplotlib web page. Specifically, terms that should produce results in a search come up empty. Attached is a screenshot illustrating how typing 'codex contour' in the search box comes up empty though, obviously there are several code examples using contour. Anyone know what the problem is? ?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: -------------- next part -------------- A non-text attachment was scrubbed... Name: matplotlib_search.png Type: image/png Size: 94672 bytes Desc: not available URL: From jslavin at cfa.harvard.edu Fri Oct 23 11:56:08 2015 From: jslavin at cfa.harvard.edu (Slavin, Jonathan) Date: Fri, 23 Oct 2015 11:56:08 -0400 Subject: [Matplotlib-users] updating contours Message-ID: Hi, I'm looking at a series of images and want to include overplotted contours. To update the image I just need to use the set_data() method of the AxesImage object. However, as far as I can tell, there's nothing similar for the QuadContourSet object. I tried set_array() but that didn't work. Am I missing something? Does anyone have any suggestions for how to update the contours? Of course if necessary I could do a cla(), but that would be slow, I think. 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 mdroettboom at continuum.io Mon Oct 26 11:07:07 2015 From: mdroettboom at continuum.io (Michael Droettboom) Date: Mon, 26 Oct 2015 11:07:07 -0400 Subject: [Matplotlib-users] updating contours In-Reply-To: References: Message-ID: You're correct that there is no equivalent -- contour is one of those "computed" things that can't be directly updated from the original data. You don't need to do a whole `cla()` though. Removing the contour artist and calling contour again should be sufficient. Mike On Fri, Oct 23, 2015 at 11:56 AM, Slavin, Jonathan wrote: > Hi, > > I'm looking at a series of images and want to include overplotted > contours. To update the image I just need to use the set_data() method of > the AxesImage object. However, as far as I can tell, there's nothing > similar for the QuadContourSet object. I tried set_array() but that didn't > work. Am I missing something? Does anyone have any suggestions for how to > update the contours? Of course if necessary I could do a cla(), but that > would be slow, I think. > > 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 > ________________________________________________________ > > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > > -- Michael Droettboom Continuum Analytics -------------- next part -------------- An HTML attachment was scrubbed... URL: From jslavin at cfa.harvard.edu Mon Oct 26 11:43:06 2015 From: jslavin at cfa.harvard.edu (Slavin, Jonathan) Date: Mon, 26 Oct 2015 11:43:06 -0400 Subject: [Matplotlib-users] updating contours In-Reply-To: References: Message-ID: Hi Mike, Yes, that's basically what I ended up doing. I did ax.collections.pop() ax.contour(...) I'm not sure if there's a different (better?) way to remove the contours, but that works. By the way, it was not easy to discover that contours are collections (a LineCollection), though I guess it's not too hard to guess. I think the docs could provide more information along these lines. Jon On Mon, Oct 26, 2015 at 11:07 AM, Michael Droettboom < mdroettboom at continuum.io> wrote: > You're correct that there is no equivalent -- contour is one of those > "computed" things that can't be directly updated from the original data. > You don't need to do a whole `cla()` though. Removing the contour artist > and calling contour again should be sufficient. > > Mike > > On Fri, Oct 23, 2015 at 11:56 AM, Slavin, Jonathan < > jslavin at cfa.harvard.edu> wrote: > >> Hi, >> >> I'm looking at a series of images and want to include overplotted >> contours. To update the image I just need to use the set_data() method of >> the AxesImage object. However, as far as I can tell, there's nothing >> similar for the QuadContourSet object. I tried set_array() but that didn't >> work. Am I missing something? Does anyone have any suggestions for how to >> update the contours? Of course if necessary I could do a cla(), but that >> would be slow, I think. >> >> 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 >> ________________________________________________________ >> >> >> _______________________________________________ >> Matplotlib-users mailing list >> Matplotlib-users at python.org >> https://mail.python.org/mailman/listinfo/matplotlib-users >> >> > > > -- > Michael Droettboom > Continuum Analytics > -- ________________________________________________________ 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 efiring at hawaii.edu Mon Oct 26 14:28:46 2015 From: efiring at hawaii.edu (Eric Firing) Date: Mon, 26 Oct 2015 08:28:46 -1000 Subject: [Matplotlib-users] Quiverkey In-Reply-To: <37DE5F18-9210-463A-A5F0-BF6C60454A80@aol.com> References: <37DE5F18-9210-463A-A5F0-BF6C60454A80@aol.com> Message-ID: <562E70DE.4010505@hawaii.edu> On 2015/10/20 1:48 PM, Kyle Shores via Matplotlib-users wrote: > Hello, > > I?ve recently been making many plots using the plot.quiver. Quiver works > extremely well, but the quiverkey reference arrow is having 2 issues. > Either it doesn?t display, or it doesn?t display until I resize the the > figure window that is generated. I would like to point out that if there > is ever quiver plot that is inside of a grid spec instance that it has > never (not even once) displayed the reference arrow in the plot. Do you > know how this might be fixed? If you would like, I can provide two > examples to better illustrate this. Kyle, Yes, please--minimal self-contained examples would be very helpful. The simpler, the better. Also, what version of matplotlib are you using, and what backend? If this problem occurs with the about-to-be-released version 1.5, then opening a github issue would be helpful as well. Eric > > > Thanks, > Kyle Shores > Texas A&M ?18 > From Nicolas.Rougier at inria.fr Mon Oct 26 16:36:41 2015 From: Nicolas.Rougier at inria.fr (Nicolas P. Rougier) Date: Mon, 26 Oct 2015 21:36:41 +0100 Subject: [Matplotlib-users] updating contours In-Reply-To: References: Message-ID: If you only need (a lot of) contours on (a lot of) images, vispy or glumpy might be an option (they both use GPU to compute contours). See for example: http://glumpy.github.io/_static/screenshots/isocurves.png Nicolas > On 26 Oct 2015, at 16:07, Michael Droettboom wrote: > > You're correct that there is no equivalent -- contour is one of those "computed" things that can't be directly updated from the original data. You don't need to do a whole `cla()` though. Removing the contour artist and calling contour again should be sufficient. > > Mike > > On Fri, Oct 23, 2015 at 11:56 AM, Slavin, Jonathan wrote: > Hi, > > I'm looking at a series of images and want to include overplotted contours. To update the image I just need to use the set_data() method of the AxesImage object. However, as far as I can tell, there's nothing similar for the QuadContourSet object. I tried set_array() but that didn't work. Am I missing something? Does anyone have any suggestions for how to update the contours? Of course if necessary I could do a cla(), but that would be slow, I think. > > 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 > ________________________________________________________ > > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > > > > > -- > Michael Droettboom > Continuum Analytics > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users From tcaswell at gmail.com Tue Oct 27 07:48:32 2015 From: tcaswell at gmail.com (Thomas Caswell) Date: Tue, 27 Oct 2015 11:48:32 +0000 Subject: [Matplotlib-users] updating contours In-Reply-To: References: Message-ID: Please don't do ax.collections.pop(), it is better to keep a reference to the object returned by contour and then using its remove method. The second way is safer as you will always remove the artist you think you are removing and more future proof as the lists of artists (lines, collections, ...) really should be considered internal details of mpl and not accessed directly. Tom On Tue, Oct 27, 2015, 01:38 Slavin, Jonathan wrote: > Hi Mike, > > Yes, that's basically what I ended up doing. I did > ax.collections.pop() > ax.contour(...) > > I'm not sure if there's a different (better?) way to remove the contours, > but that works. > > By the way, it was not easy to discover that contours are collections (a > LineCollection), though I guess it's not too hard to guess. I think the > docs could provide more information along these lines. > > Jon > > On Mon, Oct 26, 2015 at 11:07 AM, Michael Droettboom < > mdroettboom at continuum.io> wrote: > >> You're correct that there is no equivalent -- contour is one of those >> "computed" things that can't be directly updated from the original data. >> You don't need to do a whole `cla()` though. Removing the contour artist >> and calling contour again should be sufficient. >> >> Mike >> >> On Fri, Oct 23, 2015 at 11:56 AM, Slavin, Jonathan < >> jslavin at cfa.harvard.edu> wrote: >> >>> Hi, >>> >>> I'm looking at a series of images and want to include overplotted >>> contours. To update the image I just need to use the set_data() method of >>> the AxesImage object. However, as far as I can tell, there's nothing >>> similar for the QuadContourSet object. I tried set_array() but that didn't >>> work. Am I missing something? Does anyone have any suggestions for how to >>> update the contours? Of course if necessary I could do a cla(), but that >>> would be slow, I think. >>> >>> 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 >>> ________________________________________________________ >>> >>> >>> _______________________________________________ >>> Matplotlib-users mailing list >>> Matplotlib-users at python.org >>> https://mail.python.org/mailman/listinfo/matplotlib-users >>> >>> >> >> >> -- >> Michael Droettboom >> Continuum Analytics >> > > > > -- > ________________________________________________________ > 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 > ________________________________________________________ > > _______________________________________________ > 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 Tue Oct 27 09:49:01 2015 From: jslavin at cfa.harvard.edu (Slavin, Jonathan) Date: Tue, 27 Oct 2015 09:49:01 -0400 Subject: [Matplotlib-users] updating contours In-Reply-To: References: Message-ID: Do you think it's worthy of a bug report? It's not clear to me that the collections of the AxesSubplot should be considered as internal, though I do think that QuadContourSet objects should have a remove method in the same way that AxesImage and Line2D objects have. Jon On Tue, Oct 27, 2015 at 9:06 AM, Thomas Caswell wrote: > That is a bug in something... > > On Tue, Oct 27, 2015, 08:53 Slavin, Jonathan > wrote: > >> Tom, >> >> Do you mean something like: >> cs = ax.contour(...) >> . >> . >> . >> cs.remove() >> If so, that doesn't work: >> AttributeError: QuadContourSet instance has no attribute 'remove' >> >> Jon >> >> On Tue, Oct 27, 2015 at 7:48 AM, Thomas Caswell >> wrote: >> >>> Please don't do ax.collections.pop(), it is better to keep a reference >>> to the object returned by contour and then using its remove method. >>> >>> The second way is safer as you will always remove the artist you think >>> you are removing and more future proof as the lists of artists (lines, >>> collections, ...) really should be considered internal details of mpl and >>> not accessed directly. >>> >>> Tom >>> >>> On Tue, Oct 27, 2015, 01:38 Slavin, Jonathan >>> wrote: >>> >>>> Hi Mike, >>>> >>>> Yes, that's basically what I ended up doing. I did >>>> ax.collections.pop() >>>> ax.contour(...) >>>> >>>> I'm not sure if there's a different (better?) way to remove the >>>> contours, but that works. >>>> >>>> By the way, it was not easy to discover that contours are collections >>>> (a LineCollection), though I guess it's not too hard to guess. I think the >>>> docs could provide more information along these lines. >>>> >>>> Jon >>>> >>>> On Mon, Oct 26, 2015 at 11:07 AM, Michael Droettboom < >>>> mdroettboom at continuum.io> wrote: >>>> >>>>> You're correct that there is no equivalent -- contour is one of those >>>>> "computed" things that can't be directly updated from the original data. >>>>> You don't need to do a whole `cla()` though. Removing the contour artist >>>>> and calling contour again should be sufficient. >>>>> >>>>> Mike >>>>> >>>>> On Fri, Oct 23, 2015 at 11:56 AM, Slavin, Jonathan < >>>>> jslavin at cfa.harvard.edu> wrote: >>>>> >>>>>> Hi, >>>>>> >>>>>> I'm looking at a series of images and want to include overplotted >>>>>> contours. To update the image I just need to use the set_data() method of >>>>>> the AxesImage object. However, as far as I can tell, there's nothing >>>>>> similar for the QuadContourSet object. I tried set_array() but that didn't >>>>>> work. Am I missing something? Does anyone have any suggestions for how to >>>>>> update the contours? Of course if necessary I could do a cla(), but that >>>>>> would be slow, I think. >>>>>> >>>>>> 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 >>>>>> ________________________________________________________ >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> Matplotlib-users mailing list >>>>>> Matplotlib-users at python.org >>>>>> https://mail.python.org/mailman/listinfo/matplotlib-users >>>>>> >>>>>> >>>>> >>>>> >>>>> -- >>>>> Michael Droettboom >>>>> Continuum Analytics >>>>> >>>> >>>> >>>> >>>> -- >>>> ________________________________________________________ >>>> 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 >>>> ________________________________________________________ >>>> >>>> _______________________________________________ >>>> Matplotlib-users mailing list >>>> Matplotlib-users at python.org >>>> https://mail.python.org/mailman/listinfo/matplotlib-users >>>> >>> >> >> >> -- >> ________________________________________________________ >> 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 >> ________________________________________________________ >> >> -- ________________________________________________________ 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 tcaswell at gmail.com Tue Oct 27 10:47:42 2015 From: tcaswell at gmail.com (Thomas Caswell) Date: Tue, 27 Oct 2015 14:47:42 +0000 Subject: [Matplotlib-users] updating contours In-Reply-To: References: Message-ID: Yes, please make a bug report. I agree that it is not clear that collections is internal, but it _should_ be, that is a detail of how mpl stores the artists that need to be rendered at draw time. Because we store lines and collections in separate lists that get merged and sorted based on z-order during the draw process we can get some pathological rendering errors where errorbars have inconsistent layering. In the near-ish (year?) there is likely to be a major refactoring to how artists are stored internally to merge them into a single data structure. We will provide back-compatible shims, but those will go away eventually so the less code reaching in and touching them the better. Tom On Tue, Oct 27, 2015 at 9:49 AM Slavin, Jonathan wrote: > Do you think it's worthy of a bug report? It's not clear to me that the > collections of the AxesSubplot should be considered as internal, though I > do think that QuadContourSet objects should have a remove method in the > same way that AxesImage and Line2D objects have. > > Jon > > On Tue, Oct 27, 2015 at 9:06 AM, Thomas Caswell > wrote: > >> That is a bug in something... >> >> On Tue, Oct 27, 2015, 08:53 Slavin, Jonathan >> wrote: >> >>> Tom, >>> >>> Do you mean something like: >>> cs = ax.contour(...) >>> . >>> . >>> . >>> cs.remove() >>> If so, that doesn't work: >>> AttributeError: QuadContourSet instance has no attribute 'remove' >>> >>> Jon >>> >>> On Tue, Oct 27, 2015 at 7:48 AM, Thomas Caswell >>> wrote: >>> >>>> Please don't do ax.collections.pop(), it is better to keep a reference >>>> to the object returned by contour and then using its remove method. >>>> >>>> The second way is safer as you will always remove the artist you think >>>> you are removing and more future proof as the lists of artists (lines, >>>> collections, ...) really should be considered internal details of mpl and >>>> not accessed directly. >>>> >>>> Tom >>>> >>>> On Tue, Oct 27, 2015, 01:38 Slavin, Jonathan >>>> wrote: >>>> >>>>> Hi Mike, >>>>> >>>>> Yes, that's basically what I ended up doing. I did >>>>> ax.collections.pop() >>>>> ax.contour(...) >>>>> >>>>> I'm not sure if there's a different (better?) way to remove the >>>>> contours, but that works. >>>>> >>>>> By the way, it was not easy to discover that contours are collections >>>>> (a LineCollection), though I guess it's not too hard to guess. I think the >>>>> docs could provide more information along these lines. >>>>> >>>>> Jon >>>>> >>>>> On Mon, Oct 26, 2015 at 11:07 AM, Michael Droettboom < >>>>> mdroettboom at continuum.io> wrote: >>>>> >>>>>> You're correct that there is no equivalent -- contour is one of those >>>>>> "computed" things that can't be directly updated from the original data. >>>>>> You don't need to do a whole `cla()` though. Removing the contour artist >>>>>> and calling contour again should be sufficient. >>>>>> >>>>>> Mike >>>>>> >>>>>> On Fri, Oct 23, 2015 at 11:56 AM, Slavin, Jonathan < >>>>>> jslavin at cfa.harvard.edu> wrote: >>>>>> >>>>>>> Hi, >>>>>>> >>>>>>> I'm looking at a series of images and want to include overplotted >>>>>>> contours. To update the image I just need to use the set_data() method of >>>>>>> the AxesImage object. However, as far as I can tell, there's nothing >>>>>>> similar for the QuadContourSet object. I tried set_array() but that didn't >>>>>>> work. Am I missing something? Does anyone have any suggestions for how to >>>>>>> update the contours? Of course if necessary I could do a cla(), but that >>>>>>> would be slow, I think. >>>>>>> >>>>>>> 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 >>>>>>> ________________________________________________________ >>>>>>> >>>>>>> >>>>>>> _______________________________________________ >>>>>>> Matplotlib-users mailing list >>>>>>> Matplotlib-users at python.org >>>>>>> https://mail.python.org/mailman/listinfo/matplotlib-users >>>>>>> >>>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> Michael Droettboom >>>>>> Continuum Analytics >>>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> ________________________________________________________ >>>>> 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 >>>>> ________________________________________________________ >>>>> >>>>> _______________________________________________ >>>>> Matplotlib-users mailing list >>>>> Matplotlib-users at python.org >>>>> https://mail.python.org/mailman/listinfo/matplotlib-users >>>>> >>>> >>> >>> >>> -- >>> ________________________________________________________ >>> 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 >>> ________________________________________________________ >>> >>> > > > -- > ________________________________________________________ > 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 jslavin at cfa.harvard.edu Tue Oct 27 10:49:58 2015 From: jslavin at cfa.harvard.edu (Slavin, Jonathan) Date: Tue, 27 Oct 2015 10:49:58 -0400 Subject: [Matplotlib-users] updating contours Message-ID: ?Well I've come up with a better approach now: cs = ax.contour(...) then to update, just remove via: cs.collections[0].remove() and create new contours cs = ax.contour(...) Jon? On Tue, Oct 27, 2015 at 9:49 AM, wrote: > Do you think it's worthy of a bug report? It's not clear to me that the > collections of the AxesSubplot should be considered as internal, though I > do think that QuadContourSet objects should have a remove method in the > same way that AxesImage and Line2D objects have. > > Jon > > On Tue, Oct 27, 2015 at 9:06 AM, Thomas Caswell > wrote: > > > That is a bug in something... > > > > On Tue, Oct 27, 2015, 08:53 Slavin, Jonathan > > wrote: > > > >> Tom, > >> > >> Do you mean something like: > >> cs = ax.contour(...) > >> . > >> . > >> . > >> cs.remove() > >> If so, that doesn't work: > >> AttributeError: QuadContourSet instance has no attribute 'remove' > >> > >> 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 tony.hirst at gmail.com Thu Oct 29 08:58:58 2015 From: tony.hirst at gmail.com (psychemedia) Date: Thu, 29 Oct 2015 05:58:58 -0700 (MST) Subject: [Matplotlib-users] Problems with pip3 install of matplotlib-1.4.3 Message-ID: <1446123538516-46357.post@n5.nabble.com> Trying to install matplotlib using: pip3 install matplotlib I'm getting the following issue which looks like it could be a python 3 incompatibility issue? #----------- Collecting matplotlib Downloading matplotlib-1.4.3.tar.gz (50.4MB) 100% |????????????????????????????????| 50.4MB 10.4MB/s Complete output from command python setup.py egg_info: Traceback (most recent call last): File "", line 20, in File "/tmp/pip-build-lgeaee7f/matplotlib/setup.py", line 155, in result = package.check() File "/tmp/pip-build-lgeaee7f/matplotlib/setupext.py", line 1287, in check import pyparsing File "/usr/local/lib/python3.4/dist-packages/pyparsing.py", line 1557 print t ^ SyntaxError: Missing parentheses in call to 'print' ============================================================================ Edit setup.cfg to change the build options BUILDING MATPLOTLIB matplotlib: yes [1.4.3] python: yes [3.4.3 (default, Oct 14 2015, 20:33:09) [GCC 4.8.4]] platform: yes [linux] REQUIRED DEPENDENCIES AND EXTENSIONS numpy: yes [version 1.10.1] six: yes [using six version 1.10.0] dateutil: yes [using dateutil version 2.2] pytz: yes [using pytz version 2015.7] tornado: yes [using tornado version 4.2.1] ---------------------------------------- Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-lgeaee7f/matplotlib -- View this message in context: http://matplotlib.1069221.n5.nabble.com/Problems-with-pip3-install-of-matplotlib-1-4-3-tp46357.html Sent from the matplotlib - users mailing list archive at Nabble.com. From tony.hirst at gmail.com Thu Oct 29 09:14:59 2015 From: tony.hirst at gmail.com (psychemedia) Date: Thu, 29 Oct 2015 06:14:59 -0700 (MST) Subject: [Matplotlib-users] Problems with pip3 install of matplotlib-1.4.3 In-Reply-To: <1446123538516-46357.post@n5.nabble.com> References: <1446123538516-46357.post@n5.nabble.com> Message-ID: <1446124499178-46358.post@n5.nabble.com> Ah - seems like this is an issue with a pyparsing library update: flagged at https://github.com/matplotlib/matplotlib/pull/5346 -- View this message in context: http://matplotlib.1069221.n5.nabble.com/Problems-with-pip3-install-of-matplotlib-1-4-3-tp46357p46358.html Sent from the matplotlib - users mailing list archive at Nabble.com. From jenshnielsen at gmail.com Thu Oct 29 10:11:58 2015 From: jenshnielsen at gmail.com (Jens Nielsen) Date: Thu, 29 Oct 2015 14:11:58 +0000 Subject: [Matplotlib-users] Problems with pip3 install of matplotlib-1.4.3 In-Reply-To: <1446124499178-46358.post@n5.nabble.com> References: <1446123538516-46357.post@n5.nabble.com> <1446124499178-46358.post@n5.nabble.com> Message-ID: There should be a new release of pyparsing now fixing it (2.0.5) best Jens tor. 29. okt. 2015 kl. 14.09 skrev psychemedia : > Ah - seems like this is an issue with a pyparsing library update: flagged > at > https://github.com/matplotlib/matplotlib/pull/5346 > > > > -- > View this message in context: > http://matplotlib.1069221.n5.nabble.com/Problems-with-pip3-install-of-matplotlib-1-4-3-tp46357p46358.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 tcaswell at gmail.com Thu Oct 29 23:44:40 2015 From: tcaswell at gmail.com (Thomas Caswell) Date: Fri, 30 Oct 2015 03:44:40 +0000 Subject: [Matplotlib-users] [announce] matplotlib 1.5.0 released Message-ID: Hey all, We are pleased to finally announce the release of matplotlib 1.5.0! It has been over a year since the last feature release and we have had over 230 people contribute to this cycle. This release of matplotlib has several major new features including - Auto-redraw using the object-oriented API in interactive mode. - Most plotting functions now support labeled data API [Jan Schulz]. - Color cycling has extended to all style properties [Ben Root]. - Four new perceptually uniform color maps, including the soon-to-be default 'viridis'. [Stefan van der Walt and Nathaniel Smith]. - More included style sheets. - Many small plotting improvements. - Proposed new framework for managing the GUI toolbar and tools. - Pixel-value on mouse over for imshow [Steven Silvester] For demos of some of these features in action see this notebook: https://gist.github.com/tacaswell/72b0d579aeb54d4fbf87 which is version of the talk I presented at scipy, pydata Seattle and pygotham this summer. There will be more in-depth demos of the new features coming. This release has a new required dependency, cycler , for composing complex style cycles. In 1.5.0 we have dropped official support for python 2.6 and 3.3. The next matplotlib release will be the 2.0 default-style-only release, planned for 1-2 months from now. Tom -------------- next part -------------- An HTML attachment was scrubbed... URL: From jonnojohnson at gmail.com Fri Oct 30 13:55:28 2015 From: jonnojohnson at gmail.com (Jonno) Date: Fri, 30 Oct 2015 12:55:28 -0500 Subject: [Matplotlib-users] ImportError on Anaconda Win64 system In-Reply-To: References: Message-ID: I also get the same import error DLL load failed if I set the backend to WXAgg in matplotlibrc then try from pylab import * On Fri, Oct 30, 2015 at 7:50 AM, Jens Nielsen wrote: > If that fails that is a bug in PyQt/Qt or in your anaconda installation > and not a Matplotlib bug. You could try reinstall QT and PyQt. > > As a workaround you can tell Matplotlib to use a different backend > http://matplotlib.org/faq/usage_faq.html#what-is-a-backend > > BTW the matplotlib mailing list has changed to matplotlib-users at python.org > . > > best > Jens > > fre. 30. okt. 2015 kl. 12.43 skrev Jonno : > >> Traceback (most recent call last): >> File "", line 1, in >> ImportError: DLL load failed: The specified module could not be found. >> >> On Fri, Oct 30, 2015 at 2:26 AM, Jens Nielsen >> wrote: >> >>> It sounds like your PyQt package is broken. >>> >>> What happens if you do: >>> >>> from PyQt4 import QtCore, QtGui >>> >>> in a python shell >>> >>> /Jens >>> >>> fre. 30. okt. 2015 kl. 03.06 skrev Jonno : >>> >>>> Not sure where to post this. >>>> >>>> I have a fresh Anaconda Win64 python 2.7.10 install which I then >>>> updated using conda update --all. >>>> >>>> If it try to: >>>> from pylab import * >>>> I get the following: >>>> >>>> >>>> File "~\Anaconda\lib\site-packages\matplotlib\backends\qt_compat.py", >>>> line 91, in >>>> from PyQt4 import QtCore, QtGui >>>> ImportError: DLL load failed: The specified module could not be found. >>>> >>>> >>>> I have the following installed: >>>> qt: 4.8.7 >>>> pyqt 4.11.4 >>>> matplotlib 1.4.3 >>>> >>>> Should I open an issue on matplotlib github? >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> _______________________________________________ >>>> 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 ben.v.root at gmail.com Fri Oct 30 14:08:55 2015 From: ben.v.root at gmail.com (Benjamin Root) Date: Fri, 30 Oct 2015 14:08:55 -0400 Subject: [Matplotlib-users] ImportError on Anaconda Win64 system In-Reply-To: References: Message-ID: Doing that from IPython or Python? On Fri, Oct 30, 2015 at 1:55 PM, Jonno wrote: > I also get the same import error DLL load failed if I set the backend to > WXAgg in matplotlibrc then try from pylab import * > > > > On Fri, Oct 30, 2015 at 7:50 AM, Jens Nielsen > wrote: > >> If that fails that is a bug in PyQt/Qt or in your anaconda installation >> and not a Matplotlib bug. You could try reinstall QT and PyQt. >> >> As a workaround you can tell Matplotlib to use a different backend >> http://matplotlib.org/faq/usage_faq.html#what-is-a-backend >> >> BTW the matplotlib mailing list has changed to >> matplotlib-users at python.org. >> >> best >> Jens >> >> fre. 30. okt. 2015 kl. 12.43 skrev Jonno : >> >>> Traceback (most recent call last): >>> File "", line 1, in >>> ImportError: DLL load failed: The specified module could not be found. >>> >>> On Fri, Oct 30, 2015 at 2:26 AM, Jens Nielsen >>> wrote: >>> >>>> It sounds like your PyQt package is broken. >>>> >>>> What happens if you do: >>>> >>>> from PyQt4 import QtCore, QtGui >>>> >>>> in a python shell >>>> >>>> /Jens >>>> >>>> fre. 30. okt. 2015 kl. 03.06 skrev Jonno : >>>> >>>>> Not sure where to post this. >>>>> >>>>> I have a fresh Anaconda Win64 python 2.7.10 install which I then >>>>> updated using conda update --all. >>>>> >>>>> If it try to: >>>>> from pylab import * >>>>> I get the following: >>>>> >>>>> >>>>> File "~\Anaconda\lib\site-packages\matplotlib\backends\qt_compat.py", >>>>> line 91, in >>>>> from PyQt4 import QtCore, QtGui >>>>> ImportError: DLL load failed: The specified module could not be found. >>>>> >>>>> >>>>> I have the following installed: >>>>> qt: 4.8.7 >>>>> pyqt 4.11.4 >>>>> matplotlib 1.4.3 >>>>> >>>>> Should I open an issue on matplotlib github? >>>>> >>>>> >>>>> ------------------------------------------------------------------------------ >>>>> _______________________________________________ >>>>> Matplotlib-users mailing list >>>>> Matplotlib-users at lists.sourceforge.net >>>>> https://lists.sourceforge.net/lists/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 jonnojohnson at gmail.com Fri Oct 30 15:35:50 2015 From: jonnojohnson at gmail.com (Jonno) Date: Fri, 30 Oct 2015 14:35:50 -0500 Subject: [Matplotlib-users] ImportError on Anaconda Win64 system In-Reply-To: References: Message-ID: Both. On Fri, Oct 30, 2015 at 1:08 PM, Benjamin Root wrote: > Doing that from IPython or Python? > > On Fri, Oct 30, 2015 at 1:55 PM, Jonno wrote: > >> I also get the same import error DLL load failed if I set the backend to >> WXAgg in matplotlibrc then try from pylab import * >> >> >> >> On Fri, Oct 30, 2015 at 7:50 AM, Jens Nielsen >> wrote: >> >>> If that fails that is a bug in PyQt/Qt or in your anaconda installation >>> and not a Matplotlib bug. You could try reinstall QT and PyQt. >>> >>> As a workaround you can tell Matplotlib to use a different backend >>> http://matplotlib.org/faq/usage_faq.html#what-is-a-backend >>> >>> BTW the matplotlib mailing list has changed to >>> matplotlib-users at python.org. >>> >>> best >>> Jens >>> >>> fre. 30. okt. 2015 kl. 12.43 skrev Jonno : >>> >>>> Traceback (most recent call last): >>>> File "", line 1, in >>>> ImportError: DLL load failed: The specified module could not be found. >>>> >>>> On Fri, Oct 30, 2015 at 2:26 AM, Jens Nielsen >>>> wrote: >>>> >>>>> It sounds like your PyQt package is broken. >>>>> >>>>> What happens if you do: >>>>> >>>>> from PyQt4 import QtCore, QtGui >>>>> >>>>> in a python shell >>>>> >>>>> /Jens >>>>> >>>>> fre. 30. okt. 2015 kl. 03.06 skrev Jonno : >>>>> >>>>>> Not sure where to post this. >>>>>> >>>>>> I have a fresh Anaconda Win64 python 2.7.10 install which I then >>>>>> updated using conda update --all. >>>>>> >>>>>> If it try to: >>>>>> from pylab import * >>>>>> I get the following: >>>>>> >>>>>> >>>>>> File "~\Anaconda\lib\site-packages\matplotlib\backends\qt_compat.py", >>>>>> line 91, in >>>>>> from PyQt4 import QtCore, QtGui >>>>>> ImportError: DLL load failed: The specified module could not be found. >>>>>> >>>>>> >>>>>> I have the following installed: >>>>>> qt: 4.8.7 >>>>>> pyqt 4.11.4 >>>>>> matplotlib 1.4.3 >>>>>> >>>>>> Should I open an issue on matplotlib github? >>>>>> >>>>>> >>>>>> ------------------------------------------------------------------------------ >>>>>> _______________________________________________ >>>>>> Matplotlib-users mailing list >>>>>> Matplotlib-users at lists.sourceforge.net >>>>>> https://lists.sourceforge.net/lists/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 Oct 30 15:41:29 2015 From: ben.v.root at gmail.com (Benjamin Root) Date: Fri, 30 Oct 2015 15:41:29 -0400 Subject: [Matplotlib-users] ImportError on Anaconda Win64 system In-Reply-To: References: Message-ID: Then I suspect that the backend isn't really set properly, or matplotlib is picking up the parameter from somewhere else. I just don't see how having WxAgg as your backend could possibly trigger an import of the Qt libraries. On Fri, Oct 30, 2015 at 3:35 PM, Jonno wrote: > Both. > > On Fri, Oct 30, 2015 at 1:08 PM, Benjamin Root > wrote: > >> Doing that from IPython or Python? >> >> On Fri, Oct 30, 2015 at 1:55 PM, Jonno wrote: >> >>> I also get the same import error DLL load failed if I set the backend to >>> WXAgg in matplotlibrc then try from pylab import * >>> >>> >>> >>> On Fri, Oct 30, 2015 at 7:50 AM, Jens Nielsen >>> wrote: >>> >>>> If that fails that is a bug in PyQt/Qt or in your anaconda installation >>>> and not a Matplotlib bug. You could try reinstall QT and PyQt. >>>> >>>> As a workaround you can tell Matplotlib to use a different backend >>>> http://matplotlib.org/faq/usage_faq.html#what-is-a-backend >>>> >>>> BTW the matplotlib mailing list has changed to >>>> matplotlib-users at python.org. >>>> >>>> best >>>> Jens >>>> >>>> fre. 30. okt. 2015 kl. 12.43 skrev Jonno : >>>> >>>>> Traceback (most recent call last): >>>>> File "", line 1, in >>>>> ImportError: DLL load failed: The specified module could not be found. >>>>> >>>>> On Fri, Oct 30, 2015 at 2:26 AM, Jens Nielsen >>>>> wrote: >>>>> >>>>>> It sounds like your PyQt package is broken. >>>>>> >>>>>> What happens if you do: >>>>>> >>>>>> from PyQt4 import QtCore, QtGui >>>>>> >>>>>> in a python shell >>>>>> >>>>>> /Jens >>>>>> >>>>>> fre. 30. okt. 2015 kl. 03.06 skrev Jonno : >>>>>> >>>>>>> Not sure where to post this. >>>>>>> >>>>>>> I have a fresh Anaconda Win64 python 2.7.10 install which I then >>>>>>> updated using conda update --all. >>>>>>> >>>>>>> If it try to: >>>>>>> from pylab import * >>>>>>> I get the following: >>>>>>> >>>>>>> >>>>>>> File >>>>>>> "~\Anaconda\lib\site-packages\matplotlib\backends\qt_compat.py", line 91, >>>>>>> in >>>>>>> from PyQt4 import QtCore, QtGui >>>>>>> ImportError: DLL load failed: The specified module could not be >>>>>>> found. >>>>>>> >>>>>>> >>>>>>> I have the following installed: >>>>>>> qt: 4.8.7 >>>>>>> pyqt 4.11.4 >>>>>>> matplotlib 1.4.3 >>>>>>> >>>>>>> Should I open an issue on matplotlib github? >>>>>>> >>>>>>> >>>>>>> ------------------------------------------------------------------------------ >>>>>>> _______________________________________________ >>>>>>> Matplotlib-users mailing list >>>>>>> Matplotlib-users at lists.sourceforge.net >>>>>>> https://lists.sourceforge.net/lists/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 jonnojohnson at gmail.com Fri Oct 30 16:24:49 2015 From: jonnojohnson at gmail.com (Jonno) Date: Fri, 30 Oct 2015 15:24:49 -0500 Subject: [Matplotlib-users] ImportError on Anaconda Win64 system In-Reply-To: References: Message-ID: Argh this is what I get from trying to do too many things at once. Correction, if I try to do: from pylab import * - with either WxAgg or Qt4Agg set in matplotlibrc I get: Python 2.7.10 |Anaconda 2.3.0 (64-bit)| (default, Oct 21 2015, 19:35:23) [MSC v. 1500 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. Anaconda is brought to you by Continuum Analytics. Please check out: http://continuum.io/thanks and https://anaconda.org >>> from pylab import * Traceback (most recent call last): File "", line 1, in File "C:\Users\marnj\AppData\Local\Continuum\Anaconda\lib\site-packages\pylab. py", line 1, in from matplotlib.pylab import * File "C:\Users\marnj\AppData\Local\Continuum\Anaconda\lib\site-packages\matplo tlib\pylab.py", line 231, in import matplotlib.finance File "C:\Users\marnj\AppData\Local\Continuum\Anaconda\lib\site-packages\matplo tlib\finance.py", line 38, in from matplotlib.collections import LineCollection, PolyCollection File "C:\Users\marnj\AppData\Local\Continuum\Anaconda\lib\site-packages\matplo tlib\collections.py", line 27, in import matplotlib.backend_bases as backend_bases File "C:\Users\marnj\AppData\Local\Continuum\Anaconda\lib\site-packages\matplo tlib\backend_bases.py", line 56, in import matplotlib.textpath as textpath File "C:\Users\marnj\AppData\Local\Continuum\Anaconda\lib\site-packages\matplo tlib\textpath.py", line 22, in from matplotlib.mathtext import MathTextParser File "C:\Users\marnj\AppData\Local\Continuum\Anaconda\lib\site-packages\matplo tlib\mathtext.py", line 63, in import matplotlib._png as _png ImportError: DLL load failed: The specified module could not be found. How do I check the selected backend from within a python session? On Fri, Oct 30, 2015 at 2:41 PM, Benjamin Root wrote: > Then I suspect that the backend isn't really set properly, or matplotlib > is picking up the parameter from somewhere else. I just don't see how > having WxAgg as your backend could possibly trigger an import of the Qt > libraries. > > On Fri, Oct 30, 2015 at 3:35 PM, Jonno wrote: > >> Both. >> >> On Fri, Oct 30, 2015 at 1:08 PM, Benjamin Root >> wrote: >> >>> Doing that from IPython or Python? >>> >>> On Fri, Oct 30, 2015 at 1:55 PM, Jonno wrote: >>> >>>> I also get the same import error DLL load failed if I set the backend >>>> to WXAgg in matplotlibrc then try from pylab import * >>>> >>>> >>>> >>>> On Fri, Oct 30, 2015 at 7:50 AM, Jens Nielsen >>>> wrote: >>>> >>>>> If that fails that is a bug in PyQt/Qt or in your anaconda >>>>> installation and not a Matplotlib bug. You could try reinstall QT and PyQt. >>>>> >>>>> As a workaround you can tell Matplotlib to use a different backend >>>>> http://matplotlib.org/faq/usage_faq.html#what-is-a-backend >>>>> >>>>> BTW the matplotlib mailing list has changed to >>>>> matplotlib-users at python.org. >>>>> >>>>> best >>>>> Jens >>>>> >>>>> fre. 30. okt. 2015 kl. 12.43 skrev Jonno : >>>>> >>>>>> Traceback (most recent call last): >>>>>> File "", line 1, in >>>>>> ImportError: DLL load failed: The specified module could not be found. >>>>>> >>>>>> On Fri, Oct 30, 2015 at 2:26 AM, Jens Nielsen >>>>> > wrote: >>>>>> >>>>>>> It sounds like your PyQt package is broken. >>>>>>> >>>>>>> What happens if you do: >>>>>>> >>>>>>> from PyQt4 import QtCore, QtGui >>>>>>> >>>>>>> in a python shell >>>>>>> >>>>>>> /Jens >>>>>>> >>>>>>> fre. 30. okt. 2015 kl. 03.06 skrev Jonno : >>>>>>> >>>>>>>> Not sure where to post this. >>>>>>>> >>>>>>>> I have a fresh Anaconda Win64 python 2.7.10 install which I then >>>>>>>> updated using conda update --all. >>>>>>>> >>>>>>>> If it try to: >>>>>>>> from pylab import * >>>>>>>> I get the following: >>>>>>>> >>>>>>>> >>>>>>>> File >>>>>>>> "~\Anaconda\lib\site-packages\matplotlib\backends\qt_compat.py", line 91, >>>>>>>> in >>>>>>>> from PyQt4 import QtCore, QtGui >>>>>>>> ImportError: DLL load failed: The specified module could not be >>>>>>>> found. >>>>>>>> >>>>>>>> >>>>>>>> I have the following installed: >>>>>>>> qt: 4.8.7 >>>>>>>> pyqt 4.11.4 >>>>>>>> matplotlib 1.4.3 >>>>>>>> >>>>>>>> Should I open an issue on matplotlib github? >>>>>>>> >>>>>>>> >>>>>>>> ------------------------------------------------------------------------------ >>>>>>>> _______________________________________________ >>>>>>>> Matplotlib-users mailing list >>>>>>>> Matplotlib-users at lists.sourceforge.net >>>>>>>> https://lists.sourceforge.net/lists/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 Oct 30 17:07:34 2015 From: ben.v.root at gmail.com (Benjamin Root) Date: Fri, 30 Oct 2015 17:07:34 -0400 Subject: [Matplotlib-users] ImportError on Anaconda Win64 system In-Reply-To: References: Message-ID: import matplotlib matplotlib.get_backend() On Fri, Oct 30, 2015 at 4:24 PM, Jonno wrote: > Argh this is what I get from trying to do too many things at once. > > Correction, if I try to do: > from pylab import * - with either WxAgg or Qt4Agg set in matplotlibrc I > get: > > Python 2.7.10 |Anaconda 2.3.0 (64-bit)| (default, Oct 21 2015, 19:35:23) > [MSC v. > 1500 64 bit (AMD64)] on win32 > Type "help", "copyright", "credits" or "license" for more information. > Anaconda is brought to you by Continuum Analytics. > Please check out: http://continuum.io/thanks and https://anaconda.org > >>> from pylab import * > Traceback (most recent call last): > File "", line 1, in > File > "C:\Users\marnj\AppData\Local\Continuum\Anaconda\lib\site-packages\pylab. > py", line 1, in > from matplotlib.pylab import * > File > "C:\Users\marnj\AppData\Local\Continuum\Anaconda\lib\site-packages\matplo > tlib\pylab.py", line 231, in > import matplotlib.finance > File > "C:\Users\marnj\AppData\Local\Continuum\Anaconda\lib\site-packages\matplo > tlib\finance.py", line 38, in > from matplotlib.collections import LineCollection, PolyCollection > File > "C:\Users\marnj\AppData\Local\Continuum\Anaconda\lib\site-packages\matplo > tlib\collections.py", line 27, in > import matplotlib.backend_bases as backend_bases > File > "C:\Users\marnj\AppData\Local\Continuum\Anaconda\lib\site-packages\matplo > tlib\backend_bases.py", line 56, in > import matplotlib.textpath as textpath > File > "C:\Users\marnj\AppData\Local\Continuum\Anaconda\lib\site-packages\matplo > tlib\textpath.py", line 22, in > from matplotlib.mathtext import MathTextParser > File > "C:\Users\marnj\AppData\Local\Continuum\Anaconda\lib\site-packages\matplo > tlib\mathtext.py", line 63, in > import matplotlib._png as _png > ImportError: DLL load failed: The specified module could not be found. > > How do I check the selected backend from within a python session? > > > On Fri, Oct 30, 2015 at 2:41 PM, Benjamin Root > wrote: > >> Then I suspect that the backend isn't really set properly, or matplotlib >> is picking up the parameter from somewhere else. I just don't see how >> having WxAgg as your backend could possibly trigger an import of the Qt >> libraries. >> >> On Fri, Oct 30, 2015 at 3:35 PM, Jonno wrote: >> >>> Both. >>> >>> On Fri, Oct 30, 2015 at 1:08 PM, Benjamin Root >>> wrote: >>> >>>> Doing that from IPython or Python? >>>> >>>> On Fri, Oct 30, 2015 at 1:55 PM, Jonno wrote: >>>> >>>>> I also get the same import error DLL load failed if I set the backend >>>>> to WXAgg in matplotlibrc then try from pylab import * >>>>> >>>>> >>>>> >>>>> On Fri, Oct 30, 2015 at 7:50 AM, Jens Nielsen >>>>> wrote: >>>>> >>>>>> If that fails that is a bug in PyQt/Qt or in your anaconda >>>>>> installation and not a Matplotlib bug. You could try reinstall QT and PyQt. >>>>>> >>>>>> As a workaround you can tell Matplotlib to use a different backend >>>>>> http://matplotlib.org/faq/usage_faq.html#what-is-a-backend >>>>>> >>>>>> BTW the matplotlib mailing list has changed to >>>>>> matplotlib-users at python.org. >>>>>> >>>>>> best >>>>>> Jens >>>>>> >>>>>> fre. 30. okt. 2015 kl. 12.43 skrev Jonno : >>>>>> >>>>>>> Traceback (most recent call last): >>>>>>> File "", line 1, in >>>>>>> ImportError: DLL load failed: The specified module could not be >>>>>>> found. >>>>>>> >>>>>>> On Fri, Oct 30, 2015 at 2:26 AM, Jens Nielsen < >>>>>>> jenshnielsen at gmail.com> wrote: >>>>>>> >>>>>>>> It sounds like your PyQt package is broken. >>>>>>>> >>>>>>>> What happens if you do: >>>>>>>> >>>>>>>> from PyQt4 import QtCore, QtGui >>>>>>>> >>>>>>>> in a python shell >>>>>>>> >>>>>>>> /Jens >>>>>>>> >>>>>>>> fre. 30. okt. 2015 kl. 03.06 skrev Jonno : >>>>>>>> >>>>>>>>> Not sure where to post this. >>>>>>>>> >>>>>>>>> I have a fresh Anaconda Win64 python 2.7.10 install which I then >>>>>>>>> updated using conda update --all. >>>>>>>>> >>>>>>>>> If it try to: >>>>>>>>> from pylab import * >>>>>>>>> I get the following: >>>>>>>>> >>>>>>>>> >>>>>>>>> File >>>>>>>>> "~\Anaconda\lib\site-packages\matplotlib\backends\qt_compat.py", line 91, >>>>>>>>> in >>>>>>>>> from PyQt4 import QtCore, QtGui >>>>>>>>> ImportError: DLL load failed: The specified module could not be >>>>>>>>> found. >>>>>>>>> >>>>>>>>> >>>>>>>>> I have the following installed: >>>>>>>>> qt: 4.8.7 >>>>>>>>> pyqt 4.11.4 >>>>>>>>> matplotlib 1.4.3 >>>>>>>>> >>>>>>>>> Should I open an issue on matplotlib github? >>>>>>>>> >>>>>>>>> >>>>>>>>> ------------------------------------------------------------------------------ >>>>>>>>> _______________________________________________ >>>>>>>>> Matplotlib-users mailing list >>>>>>>>> Matplotlib-users at lists.sourceforge.net >>>>>>>>> https://lists.sourceforge.net/lists/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: