From fiolj at yahoo.com Fri Sep 4 02:53:17 2015 From: fiolj at yahoo.com (fiolj) Date: Thu, 3 Sep 2015 21:53:17 -0300 Subject: [Matplotlib-users] Shadows are really large in exported PNG file Message-ID: <55E8EB7D.2060602@yahoo.com> Don't know the answer but I noticed that the shadow looks normal if you export the figure with a smaller dpi (for instance, dpi=100 works well). Hope it helps, Juan From tcaswell at gmail.com Fri Sep 4 17:07:22 2015 From: tcaswell at gmail.com (Thomas Caswell) Date: Fri, 04 Sep 2015 15:07:22 +0000 Subject: [Matplotlib-users] Shadows are really large in exported PNG file In-Reply-To: <55E8EB7D.2060602@yahoo.com> References: <55E8EB7D.2060602@yahoo.com> Message-ID: Can this please be turned into an issue on gh? The dependency on the dpi suggests a bug in the transform/dpi related code. Tom On Thu, Sep 3, 2015, 20:55 fiolj via Matplotlib-users < matplotlib-users at python.org> wrote: > Don't know the answer but I noticed that the shadow looks normal if you > export the figure with a smaller dpi (for instance, dpi=100 works well). > Hope it helps, > Juan > _______________________________________________ > 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 Sep 4 22:38:18 2015 From: jslavin at cfa.harvard.edu (Slavin, Jonathan) Date: Fri, 4 Sep 2015 16:38:18 -0400 Subject: [Matplotlib-users] logarithmic axis on colorbar Message-ID: Hi all, I'm wanting to plot an image that is logarithmically scaled, and I'd like to have the associated colorbar ticks be logarithmic. So, for example, say img is the image fig,ax = plt.subplots() cax = ax.imshow(np.log10(img)) fig.colorbar(cax) gives me a colorbar with the tick labels with values that are the log10(img) values, whereas I want the colorbar to be labeled with a logarithmic axis and the img values. How could I do that? Any help 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 jklymak at uvic.ca Fri Sep 4 23:09:53 2015 From: jklymak at uvic.ca (Jody Klymak) Date: Fri, 4 Sep 2015 14:09:53 -0700 Subject: [Matplotlib-users] logarithmic axis on colorbar In-Reply-To: References: Message-ID: <9C9C8DED-56D7-439F-AEF8-39F83DAD41AC@uvic.ca> """ Demonstration of using norm to map colormaps onto data in non-linear ways. """ import numpy as np import matplotlib.pyplot as plt import matplotlib.colors as colors from matplotlib.mlab import bivariate_normal ''' Lognorm: Instead of pcolor log10(Z1) you can have colorbars that have the exponential labels using a norm. ''' N = 100 X, Y = np.mgrid[-3:3:complex(0, N), -2:2:complex(0, N)] # A low hump with a spike coming out of the top right. Needs to have # z/colour axis on a log scale so we see both hump and spike. linear # scale only shows the spike. Z1 = bivariate_normal(X, Y, 0.1, 0.2, 1.0, 1.0) + \ 0.1 * bivariate_normal(X, Y, 1.0, 1.0, 0.0, 0.0) fig, ax = plt.subplots(2, 1) pcm = ax[0].pcolor(X, Y, Z1, norm=colors.LogNorm(vmin=Z1.min(), vmax=Z1.max()), cmap='PuBu_r') fig.colorbar(pcm, ax=ax[0], extend='max') pcm = ax[1].pcolor(X, Y, Z1, cmap='PuBu_r') fig.colorbar(pcm, ax=ax[1], extend='max') fig.show() This is not part of the release docs, but is on master, so should be available soon. But basically you want to use `norm=colors.LogNorm()` Cheers, Jody > On 4 Sep 2015, at 13:38 PM, Slavin, Jonathan wrote: > > Hi all, > > I'm wanting to plot an image that is logarithmically scaled, and I'd like to have the associated colorbar ticks be logarithmic. So, for example, say img is the image > fig,ax = plt.subplots() > cax = ax.imshow(np.log10(img)) > fig.colorbar(cax) > > gives me a colorbar with the tick labels with values that are the log10(img) values, whereas I want the colorbar to be labeled with a logarithmic axis and the img values. How could I do that? Any help 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 -- Jody Klymak http://web.uvic.ca/~jklymak/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From johtoldr at yahoo.gr Wed Sep 9 02:43:21 2015 From: johtoldr at yahoo.gr (joh) Date: Tue, 8 Sep 2015 17:43:21 -0700 (MST) Subject: [Matplotlib-users] Problem: Can't combine mouse button events and pick events in a scatter plot Message-ID: <1441759401233-46112.post@n5.nabble.com> 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-Can-t-combine-mouse-button-events-and-pick-events-in-a-scatter-plot-tp46112.html Sent from the matplotlib - users mailing list archive at Nabble.com. From tcaswell at gmail.com Wed Sep 9 02:44:59 2015 From: tcaswell at gmail.com (Thomas Caswell) Date: Wed, 09 Sep 2015 00:44:59 +0000 Subject: [Matplotlib-users] [matplotlib-devel] pyplot functions: do you rely on the "hold" kwarg? In-Reply-To: <5574C313.3090609@hawaii.edu> References: <5574B9A5.7060209@hawaii.edu> <5574C313.3090609@hawaii.edu> Message-ID: Following up on this one more time, is there anyone who uses `hold` as an integral part of your workflow? We would like to remove this feature from the library entirely and are trying to judge how fast we can do this. Tom On Sun, Jun 7, 2015 at 6:18 PM Eric Firing wrote: > On 2015/06/07 12:05 PM, Nathaniel Smith wrote: > > On Sun, Jun 7, 2015 at 2:37 PM, Eric Firing wrote: > >> Matplotlib's pyplot retains quite a few vestiges from its original > >> Matlab-workalike heritage; we would like to gradually eliminate those > >> that no longer make sense. One such candidate is the "hold" kwarg that > >> every pyplot function has, with a "True" default. I don't think it > >> serves any useful purpose now, and getting rid of it would allow > >> considerable simplification to the code and, to a lesser extent, the > >> documentation. The default behavior would not change, only the ability > >> to change that behavior via either the rcParams['axes.hold'] parameter > >> or the "hold" kwarg in a pyplot function call. > >> > >> If you routinely use 'hold=False' and believe that removing it would be > >> a mistake, please let us know. > > > > I do actually use it with some regularity interactively, though I'm > > not particularly attached to it. Is there some equivalent though, like > > plt.whatever(..., hold=False) > > can become > > plt.clear(); plt.whatever(...) > > It's exactly equivalent to: > plt.cla(); plt.whatever(...) > > > ? The semantics would be that the current figure remains the current > > figure, but is reset so that the next operation starts from scratch. I > > notice that plt.clear() does not exist, but maybe it has another > > spelling :-). > > There are two types of "clear": > plt.clf() # clear the current Figure > plt.cla() # clear the current Axes > > Eric > > > > > (Basically the use case here is getting something like the > > edit-and-rerun-a-cell workflow, but when using a classic interactive > > REPL rather than the ipython notebook -- so I have a specific plot > > window up on my screen at a size and place where I can see it, and > > maybe some other plots in other windows in the background somewhere, > > and I want to quickly display different things into that window.) > > > > -n > > > > > > ------------------------------------------------------------------------------ > _______________________________________________ > 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 jslavin at cfa.harvard.edu Wed Sep 9 16:35:03 2015 From: jslavin at cfa.harvard.edu (Slavin, Jonathan) Date: Wed, 9 Sep 2015 10:35:03 -0400 Subject: [Matplotlib-users] logarithmic axis on colorbar Message-ID: Hi Jody, Thanks for the pointer. It looks like that should work nicely. I am curious though if there isn't a more general way to provide the data to be used for a colorbar without creating a plot. I guess you always need to provide an Axes object. Jon On Fri, Sep 4, 2015 at 5:09 PM, Jody Klymak wrote: > """Demonstration of using norm to map colormaps onto data in non-linear ways.""" > import numpy as npimport matplotlib.pyplot as pltimport matplotlib.colors as colorsfrom matplotlib.mlab import bivariate_normal > '''Lognorm: Instead of pcolor log10(Z1) you can have colorbars that havethe exponential labels using a norm.'''N = 100X, Y = np.mgrid[-3:3:complex(0, N), -2:2:complex(0, N)] > # A low hump with a spike coming out of the top right. Needs to have# z/colour axis on a log scale so we see both hump and spike. linear# scale only shows the spike.Z1 = bivariate_normal(X, Y, 0.1, 0.2, 1.0, 1.0) + \ > 0.1 * bivariate_normal(X, Y, 1.0, 1.0, 0.0, 0.0) > fig, ax = plt.subplots(2, 1) > pcm = ax[0].pcolor(X, Y, Z1, > norm=colors.LogNorm(vmin=Z1.min(), vmax=Z1.max()), > cmap='PuBu_r')fig.colorbar(pcm, ax=ax[0], extend='max') > pcm = ax[1].pcolor(X, Y, Z1, cmap='PuBu_r')fig.colorbar(pcm, ax=ax[1], extend='max')fig.show() > > This is not part of the release docs, but is on master, so should be > available soon. But basically you want to use `norm=colors.LogNorm()` > > Cheers, Jody > > > > On 4 Sep 2015, at 13:38 PM, Slavin, Jonathan > wrote: > > Hi all, > > I'm wanting to plot an image that is logarithmically scaled, and I'd like > to have the associated colorbar ticks be logarithmic. So, for example, say > img is the image > fig,ax = plt.subplots() > cax = ax.imshow(np.log10(img)) > fig.colorbar(cax) > > gives me a colorbar with the tick labels with values that are the > log10(img) values, whereas I want the colorbar to be labeled with a > logarithmic axis and the img values. How could I do that? Any help 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 > > > -- > Jody Klymak > http://web.uvic.ca/~jklymak/ > > > > > > -- ________________________________________________________ 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 Wed Sep 9 19:08:13 2015 From: efiring at hawaii.edu (Eric Firing) Date: Wed, 9 Sep 2015 07:08:13 -1000 Subject: [Matplotlib-users] logarithmic axis on colorbar In-Reply-To: References: Message-ID: <55F0677D.6050006@hawaii.edu> On 2015/09/09 4:35 AM, Slavin, Jonathan wrote: > I am curious though if there isn't a more general way to provide the > data to be used for a colorbar without creating a plot. http://matplotlib.org/examples/api/colorbar_only.html Is this what you mean? Eric From brenbarn at brenbarn.net Sun Sep 13 03:02:21 2015 From: brenbarn at brenbarn.net (Brendan Barnwell) Date: Sat, 12 Sep 2015 18:02:21 -0700 Subject: [Matplotlib-users] Vectorized version of text() Message-ID: <55F4CB1D.3000300@brenbarn.net> This is something that I constantly wish for and keep having to hack around when I remember there's nothing to do it. Or is there? Am I missing something? What I want is the ability to provide a vector of x, y, and text, so that *with a single call* I can display specified bits of text at a specified points. Currently text() only puts a single text at a single point, so to plot multiple texts you have to call it in a loop. This is especially annoying because, when you have everything in a pandas DataFrame, the points and text are often already aligned as separate columns. I'd like to be able to do pyplot.multitext(df.x, df.y, df.label) or whatever and just have it work. Better yet, just be able to pass an extra "pointlabel" argument directly to scatter, which would specify a sequence of labels, one for each point. The labels could then be turned off with some method on the scatter artist (and perhaps a shortcut pyplot method as well). I seem to recall there are some performance issues with plotting many different Text objects, but that doesn't seem reason enough in itself not to provide this, since lots of things can cause performance issues with large datasetrs. Does anyone else think this would be worth adding? -- Brendan Barnwell "Do not follow where the path may lead. Go, instead, where there is no path, and leave a trail." From tcaswell at gmail.com Sun Sep 13 03:23:18 2015 From: tcaswell at gmail.com (Thomas Caswell) Date: Sun, 13 Sep 2015 01:23:18 +0000 Subject: [Matplotlib-users] Vectorized version of text() In-Reply-To: <55F4CB1D.3000300@brenbarn.net> References: <55F4CB1D.3000300@brenbarn.net> Message-ID: There is some work in this direction already ( https://github.com/matplotlib/matplotlib/pull/4063). More generally, I was thinking about this problem earlier today! One of the things that bokeh does really will is broadcast all the things. Because we have a huge code base I am biased towards decorators and higher-level functions to solve these sorts of things. Would a function that looks like def broadcast_all_the_things(func, *args, static_kwargs=None, **kwargs): kwarg_cycler = map(add, cycler(k, v) for k, v in kwargs) ret = [] if static_kwargs is None: static_kwargs = {} for arg, kwarg in zip(zip(args), kwarg_cycler): total_kwargs = {**kwarg_cycler, **static_kwargs} # this works in 3.5! ret.append(func(*arg, **total_kwargs)) return ret be useful / an acceptable solution? The call would look something like: broadcast_all_the_things(ax.text, x_vec, y_vec, s_vec, fontsize=font_size_vec, static_kwargs={'color':'r'}) There clearly needs to be a bit more thought put into this (like to support automatic unpacking from a data kwarg), but I like the rough idea. It might also make sense to provide a decorator to make easy to provide `bulk_*` functions in the mpl name spaces. Tom On Sat, Sep 12, 2015 at 9:02 PM Brendan Barnwell wrote: > This is something that I constantly wish for and keep having to > hack > around when I remember there's nothing to do it. Or is there? Am I > missing something? > > What I want is the ability to provide a vector of x, y, and text, > so > that *with a single call* I can display specified bits of text at a > specified points. > > Currently text() only puts a single text at a single point, so to > plot > multiple texts you have to call it in a loop. This is especially > annoying because, when you have everything in a pandas DataFrame, the > points and text are often already aligned as separate columns. I'd like > to be able to do pyplot.multitext(df.x, df.y, df.label) or whatever and > just have it work. Better yet, just be able to pass an extra > "pointlabel" argument directly to scatter, which would specify a > sequence of labels, one for each point. The labels could then be turned > off with some method on the scatter artist (and perhaps a shortcut > pyplot method as well). > > I seem to recall there are some performance issues with plotting > many > different Text objects, but that doesn't seem reason enough in itself > not to provide this, since lots of things can cause performance issues > with large datasetrs. Does anyone else think this would be worth adding? > > -- Brendan Barnwell > "Do not follow where the path may lead. Go, instead, where there is no > path, and leave a trail." > _______________________________________________ > 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 brenbarn at brenbarn.net Mon Sep 14 05:40:18 2015 From: brenbarn at brenbarn.net (Brendan Barnwell) Date: Sun, 13 Sep 2015 20:40:18 -0700 Subject: [Matplotlib-users] Vectorized version of text() In-Reply-To: References: <55F4CB1D.3000300@brenbarn.net> Message-ID: <55F641A2.1050008@brenbarn.net> On 2015-09-12 18:23, Thomas Caswell wrote: > There is some work in this direction already > (https://github.com/matplotlib/matplotlib/pull/4063). > > More generally, I was thinking about this problem earlier today! One of > the things that bokeh does really will is broadcast all the things. > Because we have a huge code base I am biased towards decorators and > higher-level functions to solve these sorts of things. Would a function > that looks like > > def broadcast_all_the_things(func, *args, static_kwargs=None, **kwargs): > kwarg_cycler = map(add, cycler(k, v) for k, v in kwargs) > ret = [] > if static_kwargs is None: > static_kwargs = {} > for arg, kwarg in zip(zip(args), kwarg_cycler): > total_kwargs = {**kwarg_cycler, **static_kwargs} # this > works in 3.5! > ret.append(func(*arg, **total_kwargs)) > return ret > > be useful / an acceptable solution? > > The call would look something like: > > broadcast_all_the_things(ax.text, x_vec, y_vec, s_vec, > fontsize=font_size_vec, static_kwargs={'color':'r'}) > > There clearly needs to be a bit more thought put into this (like to > support automatic unpacking from a data kwarg), but I like the rough > idea. It might also make sense to provide a decorator to make easy to > provide `bulk_*` functions in the mpl name spaces. That would be better than nothing. The bulk_blah would be much better than a single generic do_in_bulk function. When working interactively I often rely on IDE/shell features that let me, for instance, look at the docstring and argument signature of the function I'm calling, so it's helpful to have the function know what arguments it accepts and know their names, instead of showing me a generic *args, **kwargs signature. I do think it would be good, though, to devote some thought to vectorizing the arguments of existing API calls wherever possible. That is, if there isn't an overarching principle for when function arguments should accept a sequence instead of a single value, we should formulate one. -- Brendan Barnwell "Do not follow where the path may lead. Go, instead, where there is no path, and leave a trail." --author unknown From tcaswell at gmail.com Tue Sep 15 05:59:23 2015 From: tcaswell at gmail.com (Thomas Caswell) Date: Tue, 15 Sep 2015 03:59:23 +0000 Subject: [Matplotlib-users] First release candidate for the 1.5.0 series Message-ID: Please give it a try! (linux64 conda builds are available on the tacaswell anaconda.org channel) https://github.com/matplotlib/matplotlib/releases/tag/v1.5.0rc1 This release contains many new features. The highlights include: - the object oriented API will now automatically re-draw the figure when working in the command line - automatic unpacking of labeled data into most plotting functions - arbitrary style cycling - four new perceptually linear color maps - mouse-over for pixel values with `imshow` - many new rcparams In addition there are significant improvements to `nbagg` and a complete overhaul of the c++ bindings to AGG. Please see the drafts of the [full whats new]( http://matplotlib.org/devdocs/users/whats_new.html#new-in-matplotlib-1-5) and [api changes]( http://matplotlib.org/devdocs/api/api_changes.html#changes-in-1-5-0) -------------- next part -------------- An HTML attachment was scrubbed... URL: From tillsten at zedat.fu-berlin.de Wed Sep 16 16:21:22 2015 From: tillsten at zedat.fu-berlin.de (Till Stensitzki) Date: Wed, 16 Sep 2015 16:21:22 +0200 Subject: [Matplotlib-users] First release candidate for the 1.5.0 series In-Reply-To: References: Message-ID: Am 15.09.2015 um 05:59 schrieb Thomas Caswell: > Please see the drafts of the [full whats new]( > http://matplotlib.org/devdocs/users/whats_new.html#new-in-matplotlib-1-5) > and [api changes] A minor suggestion: increase the the savefig.dpi when building the docs. The examples look quite bad, especially the text looks very unsharp. Another suggestion for 2.0: use another default font. Maybe Bitstream Vera Sans just gets badly rendered and the freetype/agg combination of matplotlib, but it looks unsharp for smaller fontsizes. Even for bigger sizes it is still not a very nice font. Tbh I don't know if there are usable free fonts as an alternative, but maybe someone does know. Till From jmssnyder at ucdavis.edu Thu Sep 17 20:04:31 2015 From: jmssnyder at ucdavis.edu (Jason Snyder) Date: Thu, 17 Sep 2015 18:04:31 +0000 Subject: [Matplotlib-users] matplotlib compilation and running issues Message-ID: To who it may concern, I installed matplotlib on my computer and tried to run a program with the code below: import numpy as np import matplotlib.pyplot as plt x = np.linspace(0, 10) line, = plt.plot(x, np.sin(x), '--', linewidth=2) When I ran the program I could the below error output: [vrsops at am-linux-212 cpcharts]$ python line_demo_dash_control.py Traceback (most recent call last): File "line_demo_dash_control.py", line 12, in line, = plt.plot(x, np.sin(x), '--', linewidth=2) File "/usr/lib64/python2.7/site-packages/matplotlib/pyplot.py", line 3092, in plot ax = gca() File "/usr/lib64/python2.7/site-packages/matplotlib/pyplot.py", line 828, in gca ax = gcf().gca(**kwargs) File "/usr/lib64/python2.7/site-packages/matplotlib/pyplot.py", line 462, in gcf return figure() File "/usr/lib64/python2.7/site-packages/matplotlib/pyplot.py", line 435, in figure **kwargs) File "/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_qt4agg.py", line 47, in new_figure_manager return new_figure_manager_given_figure(num, thisFig) File "/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_qt4agg.py", line 54, in new_figure_manager_given_figure canvas = FigureCanvasQTAgg(figure) File "/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_qt4agg.py", line 72, in __init__ FigureCanvasQT.__init__(self, figure) File "/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_qt4.py", line 68, in __init__ _create_qApp() File "/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_qt5.py", line 138, in _create_qApp raise RuntimeError('Invalid DISPLAY variable') RuntimeError: Invalid DISPLAY variable What is causing these errors and how do I resolve this issue? Also echo $DISPLAY is blank. Thank you for your time. -Jason -------------- next part -------------- An HTML attachment was scrubbed... URL: From efiring at hawaii.edu Thu Sep 17 20:17:20 2015 From: efiring at hawaii.edu (Eric Firing) Date: Thu, 17 Sep 2015 08:17:20 -1000 Subject: [Matplotlib-users] matplotlib compilation and running issues In-Reply-To: References: Message-ID: <55FB03B0.4030909@hawaii.edu> On 2015/09/17 8:04 AM, Jason Snyder wrote: > To who it may concern, > > I installed matplotlib on my computer and tried to run a program with > the code below: > > import numpy as np > import matplotlib.pyplot as plt > > > x = np.linspace(0, 10) > line, = plt.plot(x, np.sin(x), '--', linewidth=2) > > When I ran the program I could the below error output: > > [vrsops at am-linux-212 cpcharts]$ python line_demo_dash_control.py > Traceback (most recent call last): > File "line_demo_dash_control.py", line 12, in > line, = plt.plot(x, np.sin(x), '--', linewidth=2) > File "/usr/lib64/python2.7/site-packages/matplotlib/pyplot.py", line > 3092, in plot > ax = gca() > File "/usr/lib64/python2.7/site-packages/matplotlib/pyplot.py", line > 828, in gca > ax = gcf().gca(**kwargs) > File "/usr/lib64/python2.7/site-packages/matplotlib/pyplot.py", line > 462, in gcf > return figure() > File "/usr/lib64/python2.7/site-packages/matplotlib/pyplot.py", line > 435, in figure > **kwargs) > File > "/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_qt4agg.py", > line 47, in new_figure_manager > return new_figure_manager_given_figure(num, thisFig) > File > "/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_qt4agg.py", > line 54, in new_figure_manager_given_figure > canvas = FigureCanvasQTAgg(figure) > File > "/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_qt4agg.py", > line 72, in __init__ > FigureCanvasQT.__init__(self, figure) > File > "/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_qt4.py", > line 68, in __init__ > _create_qApp() > File > "/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_qt5.py", > line 138, in _create_qApp > raise RuntimeError('Invalid DISPLAY variable') > RuntimeError: Invalid DISPLAY variable > > What is causing these errors and how do I resolve this issue? Also echo > $DISPLAY is blank. Are you in a graphical environment, or are you using ssh to connect to the machine? Lack of a DISPLAY variable suggests the latter--no X. Eric > > Thank you for your time. > > -Jason > > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > From jblackburne at gmail.com Thu Sep 17 20:20:01 2015 From: jblackburne at gmail.com (Jeff Blackburne) Date: Thu, 17 Sep 2015 11:20:01 -0700 Subject: [Matplotlib-users] matplotlib compilation and running issues In-Reply-To: References: Message-ID: Hi Jason, $DISPLAY should normally look like HOSTNAME:X where HOSTNAME is your local machine's hostname and X is some number. That's assuming you have a graphical display running. Matplotlib is trying to start up one of its interactive backends, but cannot because your $DISPLAY is blank. You can fix this by setting $DISPLAY to its proper value, or by switching backends to a non-interactive backend like 'agg', which will let you save figures to disk. I can't help you with the former, except to say that if you are connecting to a remote machine using ssh, you can try forwarding your local display to the remote machine using ssh -X. To do the latter, insert these 2 lines before your code: import matplotlib as mpl mpl.use('agg') -Jeff On Thu, Sep 17, 2015 at 11:04 AM, Jason Snyder wrote: > To who it may concern, > > I installed matplotlib on my computer and tried to run a program with the > code below: > > import numpy as np > import matplotlib.pyplot as plt > > > x = np.linspace(0, 10) > line, = plt.plot(x, np.sin(x), '--', linewidth=2) > > When I ran the program I could the below error output: > > [vrsops at am-linux-212 cpcharts]$ python line_demo_dash_control.py > Traceback (most recent call last): > File "line_demo_dash_control.py", line 12, in > line, = plt.plot(x, np.sin(x), '--', linewidth=2) > File "/usr/lib64/python2.7/site-packages/matplotlib/pyplot.py", line > 3092, in plot > ax = gca() > File "/usr/lib64/python2.7/site-packages/matplotlib/pyplot.py", line > 828, in gca > ax = gcf().gca(**kwargs) > File "/usr/lib64/python2.7/site-packages/matplotlib/pyplot.py", line > 462, in gcf > return figure() > File "/usr/lib64/python2.7/site-packages/matplotlib/pyplot.py", line > 435, in figure > **kwargs) > File > "/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_qt4agg.py", > line 47, in new_figure_manager > return new_figure_manager_given_figure(num, thisFig) > File > "/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_qt4agg.py", > line 54, in new_figure_manager_given_figure > canvas = FigureCanvasQTAgg(figure) > File > "/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_qt4agg.py", > line 72, in __init__ > FigureCanvasQT.__init__(self, figure) > File > "/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_qt4.py", > line 68, in __init__ > _create_qApp() > File > "/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_qt5.py", > line 138, in _create_qApp > raise RuntimeError('Invalid DISPLAY variable') > RuntimeError: Invalid DISPLAY variable > > What is causing these errors and how do I resolve this issue? Also echo > $DISPLAY is blank. > > Thank you for your time. > > -Jason > > _______________________________________________ > 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 ndbecker2 at gmail.com Fri Sep 18 13:01:59 2015 From: ndbecker2 at gmail.com (Neal Becker) Date: Fri, 18 Sep 2015 07:01:59 -0400 Subject: [Matplotlib-users] First release candidate for the 1.5.0 series References: Message-ID: Is this pip installable? From tillsten at zedat.fu-berlin.de Tue Sep 22 20:19:39 2015 From: tillsten at zedat.fu-berlin.de (Till Stensitzki) Date: Tue, 22 Sep 2015 18:19:39 +0000 (UTC) Subject: [Matplotlib-users] ANN: MPLslides - basic prensentations with matplotlib Message-ID: Hi, instead spending time actually making presentations my procrastinating actually lead to the development of a very basic presentation framework based on matplotlib. I know, that's the stuff everybody was waiting for :) https://github.com/Tillsten/MPLslides An example presentation can be found under: https://github.com/Tillsten/MPLslides/raw/master/example.pdf To my surprise i think it actually usable. Features: * native matplotlib support :) * cheap css-like copy for styling elements. * customizable layout * that includes animated plots! * text and enumerations! * thanks to matplotlib, a lot of output formats are supported. This is by no means a replacement for anything, but maybe someone will have with it. greetings Till From ndbecker2 at gmail.com Fri Sep 25 14:49:40 2015 From: ndbecker2 at gmail.com (Neal Becker) Date: Fri, 25 Sep 2015 08:49:40 -0400 Subject: [Matplotlib-users] meaning of parameters for scipy.spectial.pro_ang1 Message-ID: I'm trying to compare: http://docs.scipy.org/doc/scipy/reference/generated/scipy.special.pro_ang1.html#scipy.special.pro_ang1 which lists 4 parameters: (m, n, c, x) with this reference: https://www.researchgate.net/publication/223606627_Prolate_spheroidal_wave_functions_an_introduction_to_the_Slepian_series_and_its_properties which refers to 4 parameters (see section 2): The continuous time parameter t, the order,n, of the function, the interval on which the function is known, t0, and the bandwidth parameter c. The bandwidth parameter is given by c= t0?, (3) where? is the finite bandwidth or cutoff frequency of?n(t) of a given ordern. Unfortunately the scipy doc doesn't give a description of it's parameters or any reference. From ndbecker2 at gmail.com Fri Sep 25 14:56:39 2015 From: ndbecker2 at gmail.com (Neal Becker) Date: Fri, 25 Sep 2015 08:56:39 -0400 Subject: [Matplotlib-users] meaning of parameters for scipy.spectial.pro_ang1 References: Message-ID: Sorry, posted to wrong list From 91bsjun at gmail.com Fri Sep 4 09:12:28 2015 From: 91bsjun at gmail.com (bsjun) Date: Fri, 04 Sep 2015 07:12:28 -0000 Subject: [Matplotlib-users] RuntimeError. LaTeX was not able to process the following string Message-ID: <1441349620132-46091.post@n5.nabble.com> 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. From johtoldr at yahoo.gr Wed Sep 9 01:21:18 2015 From: johtoldr at yahoo.gr (joh) Date: Tue, 08 Sep 2015 23:21:18 -0000 Subject: [Matplotlib-users] Problem: Can't combine mouse button events and pick events in a scatter plot Message-ID: <1441754477446-46108.post@n5.nabble.com> 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() 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-Can-t-combine-mouse-button-events-and-pick-events-in-a-scatter-plot-tp46108.html Sent from the matplotlib - users mailing list archive at Nabble.com. From johtoldr at yahoo.gr Wed Sep 9 02:12:50 2015 From: johtoldr at yahoo.gr (joh) Date: Wed, 09 Sep 2015 00:12:50 -0000 Subject: [Matplotlib-users] Problem : Combining mouse button events with pick events in a scatter plot Message-ID: <1441757569387-46109.post@n5.nabble.com> 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. From ml-node+s1069221n46112h44 at n5.nabble.com Wed Sep 9 02:43:22 2015 From: ml-node+s1069221n46112h44 at n5.nabble.com (joh [via matplotlib]) Date: Wed, 09 Sep 2015 00:43:22 -0000 Subject: [Matplotlib-users] Problem: Can't combine mouse button events and pick events in a scatter plot Message-ID: <1441759401233-46112.post@n5.nabble.com> 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? ______________________________________ If you reply to this email, your message will be added to the discussion below: http://matplotlib.1069221.n5.nabble.com/Problem-Can-t-combine-mouse-button-events-and-pick-events-in-a-scatter-plot-tp46112.html This email was sent by joh (via Nabble) To receive all replies by email, subscribe to this discussion: http://matplotlib.1069221.n5.nabble.com/template/NamlServlet.jtp?macro=subscribe_by_code&node=46112&code=bWF0cGxvdGxpYi11c2Vyc0BweXRob24ub3JnfDQ2MTEyfC0xNjQ0NjkzNDk1 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Patrick.Brockmann at lsce.ipsl.fr Fri Sep 11 17:39:53 2015 From: Patrick.Brockmann at lsce.ipsl.fr (PBrockmann) Date: Fri, 11 Sep 2015 15:39:53 -0000 Subject: [Matplotlib-users] read a png image with alpha gives uncorrect colors Message-ID: <1441985986263-46131.post@n5.nabble.com> 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. From fausto_barbuto at yahoo.ca Wed Sep 16 02:50:43 2015 From: fausto_barbuto at yahoo.ca (fbarbuto) Date: Wed, 16 Sep 2015 00:50:43 -0000 Subject: [Matplotlib-users] Matplotlib 1.4.2 / 1.4.3 doesn't install from source Message-ID: <1442364636453-46170.post@n5.nabble.com> 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. From matthew.brett at gmail.com Wed Sep 16 10:09:39 2015 From: matthew.brett at gmail.com (Matthew Brett) Date: Wed, 16 Sep 2015 08:09:39 -0000 Subject: [Matplotlib-users] First release candidate for the 1.5.0 series In-Reply-To: References: Message-ID: Hi, On Mon, Sep 14, 2015 at 8:59 PM, Thomas Caswell wrote: > Please give it a try! (linux64 conda builds are available on the tacaswell > anaconda.org channel) > > https://github.com/matplotlib/matplotlib/releases/tag/v1.5.0rc1 > > This release contains many new features. The highlights include: > > - the object oriented API will now automatically re-draw the figure when > working in the command line > - automatic unpacking of labeled data into most plotting functions > - arbitrary style cycling > - four new perceptually linear color maps > - mouse-over for pixel values with `imshow` > - many new rcparams > > In addition there are significant improvements to `nbagg` and a complete > overhaul of the c++ bindings to AGG. > > Please see the drafts of the [full whats > new](http://matplotlib.org/devdocs/users/whats_new.html#new-in-matplotlib-1-5) > and [api > changes](http://matplotlib.org/devdocs/api/api_changes.html#changes-in-1-5-0) After some struggle, RC1 wheels up at http://wheels.scipy.org/ Built via : https://travis-ci.org/MacPython/matplotlib-wheels/builds/80587383 If you're testing Python 3.5 you'll need the patched numpy 1.9.2 wheel from nipy.bic.berkeley.edu : pip install -f https://nipy.bic.berkeley.edu/scipy_installers numpy Cheers, Matthew From isabellahuang7 at gmail.com Thu Sep 17 10:38:03 2015 From: isabellahuang7 at gmail.com (plottingberra) Date: Thu, 17 Sep 2015 08:38:03 -0000 Subject: [Matplotlib-users] Animating 3D quiver plot in 1.4.3? Message-ID: <1442479075780-46181.post@n5.nabble.com> 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.