From jayme.c.fosa at gmail.com Thu Mar 1 08:30:12 2018 From: jayme.c.fosa at gmail.com (fosa) Date: Thu, 1 Mar 2018 06:30:12 -0700 (MST) Subject: [Matplotlib-users] Matplotlib 3D: Remove axis ticks & draw upper edge border? Message-ID: <1519911012702-0.post@n5.nabble.com> Hello, I've been trying to no avail to use the settings that usually work with matplotlib 2D. I'd like to remove the 3D graph ticks, and extend the darkened color edge to the upper sides as well. As a bonus if someone knows how to control the axis of rotation for a 3d animation, to effectively control the centering, that would be a great help as well. Here is a self contained code block that I've been hacking away at with a dull knife: import numpy as np import matplotlib as mpl from matplotlib import pyplot as plt from matplotlib import animation from mpl_toolkits.mplot3d import Axes3D mpl.rcParams['ytick.color'] = 'white' #mpl.rcParams['ytick.left'] = False sample = np.random.random_integers(low=1,high=5, size=(10,3)) # Create a figure and a 3D Axes fig = plt.figure(figsize=(5,5)) ax = Axes3D(fig) #ax.w_xaxis.set_tick_params(color='white') #ax.axes.tick_params ax.axes.tick_params(bottom=False, color='blue') ##['size', 'width', 'color', 'tickdir', 'pad', 'labelsize', ##'labelcolor', 'zorder', 'gridOn', 'tick1On', 'tick2On', ##'label1On', 'label2On', 'length', 'direction', 'left', 'bottom', ##'right', 'top', 'labelleft', 'labelbottom', ##'labelright', 'labeltop', 'labelrotation'] colors = np.mean(sample[:, :], axis=1) ax.scatter(sample[:,0], sample[:,1], sample[:,2], marker='o', s=20, c=colors, alpha=1) ax.tick_params(color='red') ax.spines['left'].set_color('green') frame1 = plt.gca() frame1.axes.xaxis.set_visible(False) #frame1.axes.xaxis.axes.set_xticks([]) frame1.axes.xaxis.set_ticklabels([]) frame1.axes.yaxis.set_ticklabels([]) frame1.axes.zaxis.set_ticklabels([]) #frame1.axes.yaxis.set_tick_params(color='white') And the image it generates: Setting #frame1.axes.xaxis.axes.set_xticks([]) causes all the grid lines to disappear, instead of just the ticks themselves. Is it required to go into whatever is drawing/rendering and adjust the length of the grid line? T_T -- Sent from: http://matplotlib.1069221.n5.nabble.com/matplotlib-users-f3.html From ben.v.root at gmail.com Thu Mar 1 11:44:43 2018 From: ben.v.root at gmail.com (Benjamin Root) Date: Thu, 1 Mar 2018 11:44:43 -0500 Subject: [Matplotlib-users] Matplotlib 3D: Remove axis ticks & draw upper edge border? In-Reply-To: <1519911012702-0.post@n5.nabble.com> References: <1519911012702-0.post@n5.nabble.com> Message-ID: Sorry, those features are just not possible with the current design. The code assumes that all rotations are done from the center. And the tick marks aren't handled the same way they are in 2D graphs, unfortunately. Also, the code has just three backing panels. It is possible to make one or more of them invisible, but you can't add more panels. In fact, you wouldn't want other panels to appear because it is assumed that these panels will always appear behind any other artists. Any other panels would run the risk of being composed incorrectly with the contents of the plot, creating "Escher effects" -- visual paradoxes. Nothing is stopping you, though, from putting in your own panel from a Poly3D or Patch3D object. In fact, you can just create a Patch artist and put it through the 2d to 3d converter function in mplot3d.art3d. I would consider the current state of tick control to be buggy, and I agree that effort should be spent fixing it. Having the ability to specify an arbitrary point of rotation is an interesting feature and I wouldn't be opposed to a merge request adding that feature. On Thu, Mar 1, 2018 at 8:30 AM, fosa wrote: > Hello, > > I've been trying to no avail to use the settings that usually work with > matplotlib 2D. I'd like to remove the 3D graph ticks, and extend the > darkened color edge to the upper sides as well. As a bonus if someone > knows > how to control the axis of rotation for a 3d animation, to effectively > control the centering, that would be a great help as well. > > Here is a self contained code block that I've been hacking away at with a > dull knife: > > import numpy as np > import matplotlib as mpl > from matplotlib import pyplot as plt > from matplotlib import animation > from mpl_toolkits.mplot3d import Axes3D > > mpl.rcParams['ytick.color'] = 'white' > #mpl.rcParams['ytick.left'] = False > > sample = np.random.random_integers(low=1,high=5, size=(10,3)) > > # Create a figure and a 3D Axes > fig = plt.figure(figsize=(5,5)) > > ax = Axes3D(fig) > > #ax.w_xaxis.set_tick_params(color='white') > > #ax.axes.tick_params > ax.axes.tick_params(bottom=False, color='blue') > ##['size', 'width', 'color', 'tickdir', 'pad', 'labelsize', > ##'labelcolor', 'zorder', 'gridOn', 'tick1On', 'tick2On', > ##'label1On', 'label2On', 'length', 'direction', 'left', 'bottom', > ##'right', 'top', 'labelleft', 'labelbottom', > ##'labelright', 'labeltop', 'labelrotation'] > > colors = np.mean(sample[:, :], axis=1) > > ax.scatter(sample[:,0], sample[:,1], sample[:,2], > > marker='o', s=20, c=colors, alpha=1) > > ax.tick_params(color='red') > ax.spines['left'].set_color('green') > > frame1 = plt.gca() > frame1.axes.xaxis.set_visible(False) > #frame1.axes.xaxis.axes.set_xticks([]) > frame1.axes.xaxis.set_ticklabels([]) > frame1.axes.yaxis.set_ticklabels([]) > frame1.axes.zaxis.set_ticklabels([]) > #frame1.axes.yaxis.set_tick_params(color='white') > > And the image it generates: > > > Setting #frame1.axes.xaxis.axes.set_xticks([]) causes all the grid lines > to > disappear, instead of just the ticks themselves. > Is it required to go into whatever is drawing/rendering and adjust the > length of the grid line? T_T > > > > > > -- > Sent from: http://matplotlib.1069221.n5.nabble.com/matplotlib-users- > f3.html > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jslavin at cfa.harvard.edu Thu Mar 1 15:53:03 2018 From: jslavin at cfa.harvard.edu (Slavin, Jonathan) Date: Thu, 1 Mar 2018 15:53:03 -0500 Subject: [Matplotlib-users] meaning of scale in quiver Message-ID: Hi, I'm making a plot in which I plot a bunch of velocity vectors that show the deviation of the material from it's average velocity. I use quiverkey to show the size scale of the vectors, but I'd also like to show the mean velocity vector on the plot. So, what I need is the meaning of the scale value. I'm using units='dots' and have set the scale value by trial and error to 0.75 to get a good looking plot. Given these, can someone tell me how to translate some value from a magnitude for a vector to a length on my plot? I've looked at the code for quiver and quiverkey and it's a bit opaque to me, at least without spending significant time studying it. 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 efiring at hawaii.edu Thu Mar 1 16:28:53 2018 From: efiring at hawaii.edu (Eric Firing) Date: Thu, 1 Mar 2018 11:28:53 -1000 Subject: [Matplotlib-users] meaning of scale in quiver In-Reply-To: References: Message-ID: <66332b4f-cc5a-7f04-13b8-fd75da368ffc@hawaii.edu> Jon, The relevant parameters are 'scale_units' (not 'units') and 'scale'. I think the docstring entry for 'scale_units' will clarify the situation: scale_units : [ 'width' | 'height' | 'dots' | 'inches' | 'x' | 'y' | 'xy' ], \ None, optional If the *scale* kwarg is *None*, the arrow length unit. Default is *None*. e.g. *scale_units* is 'inches', *scale* is 2.0, and ``(u,v) = (1,0)``, then the vector will be 0.5 inches long. If *scale_units* is 'width'/'height', then the vector will be half the width/height of the axes. If *scale_units* is 'x' then the vector will be 0.5 x-axis units. To plot vectors in the x-y plane, with u and v having the same units as x and y, use ``angles='xy', scale_units='xy', scale=1``. In other words, data_value * scale_units / scale = size in scale_units I suspect it would have been less confusing if scale had been defined as the reciprocal of what it is--but we are stuck with it as-is. Eric On 2018/03/01 10:53 AM, Slavin, Jonathan wrote: > Hi, > > I'm making a plot in which I plot a bunch of velocity vectors that show > the deviation of the material from it's average velocity.? I use > quiverkey to show the size scale of the vectors, but I'd also like to > show the mean velocity vector on the plot. > So, what I need is the meaning of the scale value. I'm using > units='dots' and have set the scale value by trial and error to 0.75 to > get a good looking plot.? Given these, can someone tell me how to > translate some value from a magnitude for a vector to a length on my > plot?? I've looked at the code for quiver and quiverkey and it's a bit > opaque to me, at least without spending significant time studying it. > > 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 > From tcaswell at gmail.com Sat Mar 3 12:16:20 2018 From: tcaswell at gmail.com (Thomas Caswell) Date: Sat, 03 Mar 2018 17:16:20 +0000 Subject: [Matplotlib-users] Efficiency in connecting two subplot. In-Reply-To: References: <2718503.CSJC07vTRv@portable> <1794988.hQncGMomWA@portable> <3552955.lNGLj3qyV6@portable> Message-ID: It looks like you are redrawing the _whole_ figure every time. You can use blitting (see https://matplotlib.org/api/animation_api.html#funcanimation for details) to only re-draw the axes that is changing. Tom On Tue, Feb 20, 2018 at 3:28 PM Benjamin Root wrote: > Yup, that's pretty much it. Since you have it all in a class, then doing > `self.counter` makes a lot of sense. You can also tune it accordingly to do > only every 3rd, 4th, 5th or what-have-you. > > Cheers! > Ben Root > > On Tue, Feb 20, 2018 at 3:03 PM, Christophe Bal > wrote: > >> Thanks >> >> Christophe BAL >> Enseignant Agr?g? de Math?matiques >> Programmeur Python Amateur >> >> Le 20 f?vr. 2018 20:02, "?ric Depagne" a ?crit : >> >>> Hi Christophe, >>> >>> I am not sure it's what Ben had in mind (if not, I'm happy to know how >>> it >>> should have been done), but here is the way I did it. >>> >>> (my _on_move() method is a member of a class) >>> I added this to the __init__() : >>> self.counter = 0 >>> >>> Then I added the following lines to _on_move(): >>> self.counter += 1 >>> if self.counter %2 : >>> return >>> [snip all the details of the update of the plots) >>> self.counter = 0 >>> >>> And it updates the plot every other move. >>> >>> ?ric. >>> >>> -- >>> Un clavier azerty en vaut deux >>> ---------------------------------------------------------- >>> ?ric Depagne >>> >>> >>> >> _______________________________________________ >> 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 mckauf at gmail.com Sun Mar 4 11:23:15 2018 From: mckauf at gmail.com (Mike Kaufman) Date: Sun, 4 Mar 2018 11:23:15 -0500 Subject: [Matplotlib-users] Matplotlib 3D: Remove axis ticks & draw upper edge border? In-Reply-To: References: <1519911012702-0.post@n5.nabble.com> Message-ID: <0e1c9335-8538-db30-7809-d8d4c220c8c1@gmail.com> What I did as a workaround this is to modify the plot limits: ######################################################################### # ######################################################################### def equalize_plotlimits_3d(ax): xl = ax.get_xlim() yl = ax.get_ylim() zl = ax.get_zlim() xr = xl[1] - xl[0] yr = yl[1] - yl[0] zr = zl[1] - zl[0] xave = (xl[1] + xl[0])/2 yave = (yl[1] + yl[0])/2 zave = (zl[1] + zl[0])/2 maxr = max([xr,yr,zr]) ax.set_xlim(xave-maxr/2, xave+maxr/2) ax.set_ylim(yave-maxr/2, yave+maxr/2) ax.set_zlim(zave-maxr/2, zave+maxr/2) xl = ax.get_xlim() yl = ax.get_ylim() zl = ax.get_zlim() return [xl,yl,zl] ######################################################################### # ######################################################################### def pan(axis, shift, ax=None, dodraw=True): if not ax: ax = gca() which = dict(x=0,y=1,z=2) setter = [ax.set_xlim, ax.set_ylim, ax.set_zlim] getter = [ax.get_xlim, ax.get_ylim, ax.get_zlim] lim = getter[which[axis]]() lim[0] += shift lim[1] += shift setter[which[axis]](lim) if dodraw: draw() def xpan(*args, **kwargs): pan('x', *args, **kwargs) def ypan(*args, **kwargs): pan('y', *args, **kwargs) def zpan(*args, **kwargs): pan('z', *args, **kwargs) ######################################################################### # ######################################################################### def zoom(scale, ax=None, dodraw=True): if not ax: ax = gca() xl = ax.get_xlim() yl = ax.get_ylim() zl = ax.get_zlim() xr = xl[1] - xl[0] yr = yl[1] - yl[0] zr = zl[1] - zl[0] xave = (xl[1] + xl[0])/2 yave = (yl[1] + yl[0])/2 zave = (zl[1] + zl[0])/2 maxr = max([xr,yr,zr]) ax.set_xlim(xave-maxr/2/scale, xave+maxr/2/scale) ax.set_ylim(yave-maxr/2/scale, yave+maxr/2/scale) ax.set_zlim(zave-maxr/2/scale, zave+maxr/2/scale) xl = ax.get_xlim() yl = ax.get_ylim() zl = ax.get_zlim() if dodraw: draw() On 3/1/18 11:44 AM, Benjamin Root wrote: > Sorry, those features are just not possible with the current design. The > code assumes that all rotations are done from the center. And the tick > marks aren't handled the same way they are in 2D graphs, unfortunately. > Also, the code has just three backing panels. It is possible to make one > or more of them invisible, but you can't add more panels. In fact, you > wouldn't want other panels to appear because it is assumed that these > panels will always appear behind any other artists. Any other panels > would run the risk of being composed incorrectly with the contents of > the plot, creating "Escher effects" -- visual paradoxes. Nothing is > stopping you, though, from putting in your own panel from a Poly3D or > Patch3D object. In fact, you can just create a Patch artist and put it > through the 2d to 3d converter function in mplot3d.art3d. > > I would consider the current state of tick control to be buggy, and I > agree that effort should be spent fixing it. Having the ability to > specify an arbitrary point of rotation is an interesting feature and I > wouldn't be opposed to a merge request adding that feature. > > > On Thu, Mar 1, 2018 at 8:30 AM, fosa > wrote: > > Hello, > > I've been trying to no avail to use the settings that usually work with > matplotlib 2D.? I'd like to remove the 3D graph ticks, and extend the > darkened color edge to the upper sides as well.? As a bonus if > someone knows > how to control the axis of rotation for a 3d animation, to effectively > control the centering, that would be a great help as well. > > Here is a self contained code block that I've been hacking away at > with a > dull knife: > > import numpy as np > import matplotlib as mpl > from matplotlib import pyplot as plt > from matplotlib import animation > from mpl_toolkits.mplot3d import Axes3D > > mpl.rcParams['ytick.color'] = 'white' > #mpl.rcParams['ytick.left'] = False > > sample = np.random.random_integers(low=1,high=5, size=(10,3)) > > # Create a figure and a 3D Axes > fig = plt.figure(figsize=(5,5)) > > ax = Axes3D(fig) > > #ax.w_xaxis.set_tick_params(color='white') > > #ax.axes.tick_params > ax.axes.tick_params(bottom=False, color='blue') > ##['size', 'width', 'color', 'tickdir', 'pad', 'labelsize', > ##'labelcolor', 'zorder', 'gridOn', 'tick1On', 'tick2On', > ##'label1On', 'label2On', 'length', 'direction', 'left', 'bottom', > ##'right', 'top', 'labelleft', 'labelbottom', > ##'labelright', 'labeltop', 'labelrotation'] > > colors = np.mean(sample[:, :], axis=1) > > ax.scatter(sample[:,0], sample[:,1], sample[:,2], > > ? ? ? ? ? ?marker='o', s=20, c=colors, alpha=1) > > ax.tick_params(color='red') > ax.spines['left'].set_color('green') > > frame1 = plt.gca() > frame1.axes.xaxis.set_visible(False) > #frame1.axes.xaxis.axes.set_xticks([]) > frame1.axes.xaxis.set_ticklabels([]) > frame1.axes.yaxis.set_ticklabels([]) > frame1.axes.zaxis.set_ticklabels([]) > #frame1.axes.yaxis.set_tick_params(color='white') > > And the image it generates: > > > > Setting #frame1.axes.xaxis.axes.set_xticks([]) causes all the grid > lines to > disappear, instead of just the ticks themselves. > Is it required to go into whatever is drawing/rendering and adjust the > length of the grid line? T_T > > > > > > -- > Sent from: > http://matplotlib.1069221.n5.nabble.com/matplotlib-users-f3.html > > _______________________________________________ > 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 fabien.maussion at gmail.com Mon Mar 5 03:44:42 2018 From: fabien.maussion at gmail.com (Fabien) Date: Mon, 5 Mar 2018 09:44:42 +0100 Subject: [Matplotlib-users] matplotlib._cntr.Cntr gone in 2.2 Message-ID: Hi all, matplotlib._cntr.Cntr is gone in version 2.2. I know this was a private module but it ended up being used by some (a quick online search will show you some examples. ie this SO post: https://stackoverflow.com/questions/18304722/python-find-contour-lines-from-matplotlib-pyplot-contour). The use case for this class (as shown by the examples online) was to obtain polygon contours of labeled regions in a 2D array. Is there an alternative implementation available? The solutions I've found online imply making a plot, which isn't really what I'm looking for. Thanks a lot! Fabien From tcaswell at gmail.com Mon Mar 5 09:03:13 2018 From: tcaswell at gmail.com (Thomas Caswell) Date: Mon, 05 Mar 2018 14:03:13 +0000 Subject: [Matplotlib-users] matplotlib._cntr.Cntr gone in 2.2 In-Reply-To: References: Message-ID: Fabien, I suggest looking at skimage ( http://scikit-image.org/docs/dev/auto_examples/edges/plot_contours.html ) for contouring code. If you are absolutely dependent on that API, the source is available from previous releases and you are welcome to vendor or create a stand-alone library (not sure how hard that would actually be). Please do not use private APIs. We can (and will!) change them with no notice. Tom On Mon, Mar 5, 2018 at 3:45 AM Fabien wrote: > Hi all, > > matplotlib._cntr.Cntr is gone in version 2.2. I know this was a private > module but it ended up being used by some (a quick online search will > show you some examples. ie this SO post: > > https://stackoverflow.com/questions/18304722/python-find-contour-lines-from-matplotlib-pyplot-contour > ). > > The use case for this class (as shown by the examples online) was to > obtain polygon contours of labeled regions in a 2D array. > Is there an alternative implementation available? The solutions I've > found online imply making a plot, which isn't really what I'm looking for. > > Thanks a lot! > > Fabien > > > _______________________________________________ > 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 fabien.maussion at gmail.com Mon Mar 5 11:12:19 2018 From: fabien.maussion at gmail.com (Fabien) Date: Mon, 5 Mar 2018 17:12:19 +0100 Subject: [Matplotlib-users] matplotlib._cntr.Cntr gone in 2.2 In-Reply-To: References: Message-ID: Hi Thomas, On 03/05/2018 03:03 PM, Thomas Caswell wrote: > I suggest looking at skimage ( > http://scikit-image.org/docs/dev/auto_examples/edges/plot_contours.html?) for > contouring code. Thanks! Looks like this is exactly what I was looking for. It's probably not around since as long as matplotlib and therefore not prominent on the forums dealing with the question. Thanks a lot! > Please do not use private APIs.? We can (and will!) change them with no > notice. You are right, but... ;-) Best, Fabien From fabien.maussion at gmail.com Mon Mar 5 12:49:09 2018 From: fabien.maussion at gmail.com (Fabien) Date: Mon, 5 Mar 2018 18:49:09 +0100 Subject: [Matplotlib-users] matplotlib._cntr.Cntr gone in 2.2 In-Reply-To: References: Message-ID: > On 03/05/2018 03:03 PM, Thomas Caswell wrote: >> I suggest looking at skimage ( >> http://scikit-image.org/docs/dev/auto_examples/edges/plot_contours.html?) >> for contouring code. For the record (and to my own surprise), it seems that skimage and the deprecated Cntr are producing *exactly* the same results (appart from the order of the vertices of course). I haven't tested it in all possible cases of course, but changing to skimage simplified the code and passed through all our tests. Thanks! Fabien From tcaswell at gmail.com Tue Mar 6 20:44:23 2018 From: tcaswell at gmail.com (Thomas Caswell) Date: Wed, 07 Mar 2018 01:44:23 +0000 Subject: [Matplotlib-users] ANN: Matplotlib 2.2.0 released Message-ID: Folks, We are happy to announce the release of Matplotlib 2.2.0! The first release of the v2.2 LTS series and the last version of Matplotlib to support python2. There will be bug-fix release for this series until 2020. This release includes new features including: - An experimental constrained layout manager - Color blind friendly color map (cividis) and color cycle (tableau-colorblind10) - native support for numpy.datetime64 types - animated gif writing via pillow - TkAgg now works with pypy - cairo based backends for Qt, Tk, and WX For full details see https://matplotlib.org/users/whats_new.html There are several API changes in this release: - To support the constrained layout Matplotlib has a new required dependency (kiwisolver). - The `matplotlib.finance` module has been removed, development has moved to a stand-alone project. For more details see https://matplotlib.org/api/api_changes.html The next feature release of Matplotlib will be 3.0, targeted for July 2018 will support python 3.5+. We are looking for a release manager for the 2.2.x series. Thank you again to everyone (~100) people who helped to get the release done and out the door! Tom -------------- next part -------------- An HTML attachment was scrubbed... URL: From parker.charles at gmail.com Thu Mar 8 10:51:21 2018 From: parker.charles at gmail.com (Chad Parker) Date: Thu, 8 Mar 2018 10:51:21 -0500 Subject: [Matplotlib-users] Scaled Secondary Axis that is Slaved to Primary Message-ID: All- I frequently find myself trying to create plots that use a secondary axis to indicate data in a second set of units. For example, I might plot a data set with an x-axis in data number (e.g. the output of an analog to digital converter), and then wish to display the calibrated units on a secondary x-axis (e.g. volts). There are quite a few examples that do this by creating a secondary axis using twiny(), and then setting the limits of the secondary x-axis to the scaled limits of the primary, and possibly setting the ticks to line up as well. import matplotlib.pyplot as plt import numpy as np from scipy.stats import norm f, ax = plt.subplots(1) x_dn = np.arange(4096) y = norm.pdf(x_dn, 2048, 64) v = lambda x: x*5.0/4096 ax.plot(x_dn, y) ax.grid(True) ax_top = ax.twiny() ax_top.grid(True) ax_top.set_xticks([v(x) for x in ax.get_xticks()]) # optional, aligns the grids ax_top.set_xlim([v(x) for x in ax.get_xlim()]) This isn't too painful if you're only doing it once. However, if you subsequently want to change the limits (from the command line) you have to explicitly set the limits of both axes or they will become out of sync (aside: they also can get out of sync if you set the secondary limits before the ticks, because setting the ticks can change the limits!). If you do set the ticks to line up the grids, then you also have to recompute those for the secondary axis. ax.set_xlim([1500, 2500]) # now they're out of sync ax_top.set_xticks([v(x) for x in ax.get_xticks()]) # ticks correct, but in wrong places ax_top.set_xlim([v(x) for x in ax.get_xlim()]) # all's well again. It just seems like there ought to be a better way. I apologize if it's out there and I missed it. Thanks, --Chad -------------- next part -------------- An HTML attachment was scrubbed... URL: From jayme.c.fosa at gmail.com Thu Mar 8 11:18:57 2018 From: jayme.c.fosa at gmail.com (fosa) Date: Thu, 8 Mar 2018 09:18:57 -0700 (MST) Subject: [Matplotlib-users] Matplotlib 3D: Remove axis ticks & draw upper edge border? In-Reply-To: <1519911012702-0.post@n5.nabble.com> References: <1519911012702-0.post@n5.nabble.com> Message-ID: <1520525937737-0.post@n5.nabble.com> Hi Mike thanks for replying. I can't quite get your methods to work. Would you mind posting a barebones example of a 3d plot with the ticks disabled? -- Sent from: http://matplotlib.1069221.n5.nabble.com/matplotlib-users-f3.html From mathoscope at netcourrier.com Thu Mar 8 11:29:11 2018 From: mathoscope at netcourrier.com (Vincent Douce Mathoscope) Date: Thu, 8 Mar 2018 17:29:11 +0100 Subject: [Matplotlib-users] filling In-Reply-To: <1520525937737-0.post@n5.nabble.com> References: <1519911012702-0.post@n5.nabble.com> <1520525937737-0.post@n5.nabble.com> Message-ID: <45189718-7D64-4052-845E-9165790311F1@netcourrier.com> hi i have a draw in black and white as a mosaic i can get the coordinates of one point in each field af the mosaic what i miss would be an option to "fill" does such an option exist in Matplotlib ? ?????????????????????????? Vincent Douce :=: Mathoscope :=: http://mathoscope.xyz 06?13?11?07?26 Bagn?res de Bigorre 65200 From pmhobson at gmail.com Thu Mar 8 12:13:43 2018 From: pmhobson at gmail.com (Paul Hobson) Date: Thu, 8 Mar 2018 09:13:43 -0800 Subject: [Matplotlib-users] filling In-Reply-To: <45189718-7D64-4052-845E-9165790311F1@netcourrier.com> References: <1519911012702-0.post@n5.nabble.com> <1520525937737-0.post@n5.nabble.com> <45189718-7D64-4052-845E-9165790311F1@netcourrier.com> Message-ID: Do you have an example image for reference? Can you share the code you've already written. Matplotlib can draw full or hollow polygons that represent an area and use full or hollow markers that represent a point. There is also the concept of a "span" that is boundless in one dimension, and constrained in the other: https://matplotlib.org/gallery/api/span_regions.html#sphx-glr-gallery-api-span-regions-py -paul On Thu, Mar 8, 2018 at 8:29 AM, Vincent Douce Mathoscope < mathoscope at netcourrier.com> wrote: > hi > i have a draw in black and white as a mosaic > i can get the coordinates of one point in each field af the mosaic > what i miss would be an option to "fill" > does such an option exist in Matplotlib ? > > ?????????????????????????? > Vincent Douce > :=: Mathoscope :=: > http://mathoscope.xyz > 06?13?11?07?26 > Bagn?res de Bigorre 65200 > > > > > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jni.soma at gmail.com Thu Mar 8 20:58:49 2018 From: jni.soma at gmail.com (Juan Nunez-Iglesias) Date: Fri, 09 Mar 2018 12:58:49 +1100 Subject: [Matplotlib-users] Scaled Secondary Axis that is Slaved to Primary In-Reply-To: References: Message-ID: <1520560729.3343373.1296823960.480848F8@webmail.messagingengine.com> Hi Chad, Tom Caswell answered a similar question from me last year: https://mail.python.org/pipermail/matplotlib-users/2017-May/000888.html Look towards the very end of the example to see how to do arbitrary things automatically when xlims and ylims change. HTH! Juan. On Fri, Mar 9, 2018, at 2:51 AM, Chad Parker wrote: > All- > I frequently find myself trying to create plots that use a secondary > axis to indicate data in a second set of units. For example, I might > plot a data set with an x-axis in data number (e.g. the output of an > analog to digital converter), and then wish to display the calibrated > units on a secondary x-axis (e.g. volts).> > There are quite a few examples that do this by creating a secondary > axis using twiny(), and then setting the limits of the secondary x- > axis to the scaled limits of the primary, and possibly setting the > ticks to line up as well.> import matplotlib.pyplot as plt > import numpy as np > from scipy.stats import norm > > f, ax = plt.subplots(1) > x_dn = np.arange(4096) > y = norm.pdf(x_dn, 2048, 64) > v = lambda x: x*5.0/4096 > > ax.plot(x_dn, y) > ax.grid(True) > ax_top = ax.twiny() > ax_top.grid(True) > ax_top.set_xticks([v(x) for x in ax.get_xticks()]) # optional, aligns > the grids> ax_top.set_xlim([v(x) for x in ax.get_xlim()]) > > This isn't too painful if you're only doing it once. However, if you > subsequently want to change the limits (from the command line) you > have to explicitly set the limits of both axes or they will become out > of sync (aside: they also can get out of sync if you set the secondary > limits before the ticks, because setting the ticks can change the > limits!). If you do set the ticks to line up the grids, then you also > have to recompute those for the secondary axis.> ax.set_xlim([1500, 2500]) # now they're out of sync > ax_top.set_xticks([v(x) for x in ax.get_xticks()]) # ticks correct, > but in wrong places> ax_top.set_xlim([v(x) for x in ax.get_xlim()]) # all's well again. > It just seems like there ought to be a better way. I apologize if it's > out there and I missed it.> Thanks, > --Chad > _________________________________________________ > 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 anntzer.lee at gmail.com Tue Mar 13 15:53:33 2018 From: anntzer.lee at gmail.com (Antony Lee) Date: Tue, 13 Mar 2018 12:53:33 -0700 Subject: [Matplotlib-users] mplcairo 0.1a1 Message-ID: Hi all, I have just pushed a first pre-release of mplcairo to PyPI ( https://pypi.python.org/pypi/mplcairo). As mentioned a few times on the mailing list, it is a new Matplotlib backend based on the well-known cairo library, supporting output to both raster (including interactively) and vector formats. In other words, it provides the functionality of Matplotlib's {,qt5,gtk3,wx,tk,macos}agg, pdf, ps, and svg backends :-) As for any backend, use e.g. by calling `matplotlib.use("module://mplcairo.qt")`, or setting your MPLBACKEND environment variable to `module://mplcairo.qt`. Please check the README for additional information. manylinux, osx, and windows wheels are available (3.6 only; may look into older Python (3...) versions later). On Linux and OSX, the wheels declare a dependency on pycairo (which is how I get a handle onto libcairo); you may want to get it e.g. from conda. On Windows, the wheel includes cairo. I am reasonably confident that the manylinux and windows wheels "work" (of course, feedback is more than welcome), but would particularly appreciate help regarding the OSX wheels. Briefly speaking, for OSX, I have only managed to coerce Travis to build a macos_10_12 wheel (corresponding to the version from Homebrew, and apparently working with it), but conda's Python only accepts wheels up to macos_10_9 (so basically conda's Python can't use the wheels: you need to build mplcairo yourself); moreover, because it appears impossible to statically link libc++ on OSX, mplcairo specifically needs to be imported before matplotlib. If you don't, mplcairo won't eat your data, but may well segfault your process. Any insight regarding the intricacies of cross-version compatibility and/or dynamic loading on OSX would be appreciated... Enjoy (hopefully :-)), Antony -------------- next part -------------- An HTML attachment was scrubbed... URL: From kitecamguy at gmail.com Fri Mar 16 12:41:42 2018 From: kitecamguy at gmail.com (Glenn Nelson) Date: Fri, 16 Mar 2018 09:41:42 -0700 Subject: [Matplotlib-users] Scaled Secondary Axis that is Slaved to Primary In-Reply-To: References: Message-ID: I believe I saw an excellent example of this using Bokeh. There was a map, and you could drag a rectangle in it and have that area show up in a linked box. Also could move the rectangle around. Sorry for lack of information - it's on my work computer and I'm not there. I realize this does not use matplotlib, but it's good to know about alternative ways of doing things. ---- Glenn Nelson in Santa Cruz social: http://google.com/+GlennNelson see my Kite Aerial Photos at http://www.glenn-nelson.us/kap On Thu, Mar 8, 2018 at 7:51 AM, Chad Parker wrote: > All- > > I frequently find myself trying to create plots that use a secondary axis > to indicate data in a second set of units. For example, I might plot a data > set with an x-axis in data number (e.g. the output of an analog to digital > converter), and then wish to display the calibrated units on a secondary > x-axis (e.g. volts). > > There are quite a few examples that do this by creating a secondary axis > using twiny(), and then setting the limits of the secondary x-axis to the > scaled limits of the primary, and possibly setting the ticks to line up as > well. > > import matplotlib.pyplot as plt > import numpy as np > from scipy.stats import norm > > f, ax = plt.subplots(1) > x_dn = np.arange(4096) > y = norm.pdf(x_dn, 2048, 64) > > v = lambda x: x*5.0/4096 > > ax.plot(x_dn, y) > ax.grid(True) > ax_top = ax.twiny() > ax_top.grid(True) > ax_top.set_xticks([v(x) for x in ax.get_xticks()]) # optional, aligns the > grids > ax_top.set_xlim([v(x) for x in ax.get_xlim()]) > > This isn't too painful if you're only doing it once. However, if you > subsequently want to change the limits (from the command line) you have to > explicitly set the limits of both axes or they will become out of sync > (aside: they also can get out of sync if you set the secondary limits > before the ticks, because setting the ticks can change the limits!). If you > do set the ticks to line up the grids, then you also have to recompute > those for the secondary axis. > > ax.set_xlim([1500, 2500]) # now they're out of sync > ax_top.set_xticks([v(x) for x in ax.get_xticks()]) # ticks correct, but > in wrong places > ax_top.set_xlim([v(x) for x in ax.get_xlim()]) # all's well again. > > It just seems like there ought to be a better way. I apologize if it's out > there and I missed it. > > Thanks, > --Chad > > _______________________________________________ > 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 Mar 17 14:24:26 2018 From: tcaswell at gmail.com (Thomas Caswell) Date: Sat, 17 Mar 2018 18:24:26 +0000 Subject: [Matplotlib-users] [REL] Matplotlib 2.2.2 Message-ID: Folks, Happy to announce Matplotlib 2.2.2, the second bug-fix release of the v2.2 LTS series. This release fixes a number of critical bugs from 2.2.0: - restores matplotlib.verbose (fixing embedding in pycharm) - preserve precision when color mapping small portions of data with extreme outliers - fixes saving long movies with ffmpeg - fixes UnbourdLocal error in contour labeling - fixes import failure on python 3.4.0 and 3.4.1 - fixes compile time failures with clang on 32bit platforms - fixes an icon in the Tk backends - fixes several issues with Tables - fixes expanding offset boxes with tight_layout - revert changes to the font caching to avoid a possible bug in backports.lru_cache - numerous docstring and documentation fixes We have reverted the deprecation of `font_manager.TempCache`. Thank you to everyone who submitted bug reports and worked on this! v2.2.1 is tagged, but we do not plan to release / publish to pypi. Tom -------------- next part -------------- An HTML attachment was scrubbed... URL: From m.hagerty at isti.com Tue Mar 20 17:21:34 2018 From: m.hagerty at isti.com (Mike Hagerty) Date: Tue, 20 Mar 2018 17:21:34 -0400 Subject: [Matplotlib-users] How to turn off matplotlib DEBUG msgs Message-ID: I recently installed the latest version of matplotlib via conda: # packages in environment: matplotlib 2.2.2 py27_0 conda-forge Now, as soon as matplotlib is imported by another module, it generates a ton of DEBUG messages (see below). How do I turn these off ?? Oddly, if I use the interactive python and import matplotlib directly, I don't get the messages, so it has something to do with how the code I'm using (obspy) imports the matplotlib module. I'm using mac osx 10.10.5 and I get similar results with python2.7 and python3.6 (conda) environments. Any advice would be appreciated. Cheers! -Mike > > >>> from obspy.taup import TauPyModel > [ DEBUG] $HOME=/Users/mth > [ DEBUG] matplotlib data path /usr/local/anaconda/envs/ > obspy_3.6/lib/python3.6/site-packages/matplotlib/mpl-data > [ DEBUG] loaded rc file /usr/local/anaconda/envs/ > obspy_3.6/lib/python3.6/site-packages/matplotlib/mpl-data/matplotlibrc > [ DEBUG] matplotlib version 2.2.2 > [ DEBUG] interactive is False > [ DEBUG] platform is darwin > [ DEBUG] loaded modules: ['builtins', 'sys', '_frozen_importlib', '_imp', > '_warnings', '_thread', '_weakref', '_frozen_importlib_external', '_io', > 'marshal', 'posix', 'zipimport', 'encodings', 'codecs', '_codecs', > 'encodings.aliases', 'encodings.utf_8', '_signal', '__main__', > 'encodings.latin_1', 'io', 'abc', '_weakrefset', 'site', 'os', 'errno', > 'stat', '_stat', 'posixpath', 'genericpath', 'os.path', '_collections_abc', > '_sitebuiltins', 'sysconfig', '_sysconfigdata_m_darwin_darwin', > '_osx_support', 're', 'enum', 'types', 'functools', '_functools', > 'collections', 'operator', '_operator', 'keyword', 'heapq', '_heapq', > 'itertools', 'reprlib', '_collections', 'weakref', 'collections.abc', > 'sre_compile', '_sre', 'sre_parse', 'sre_constants', '_locale', 'copyreg', > '_bootlocale', 'importlib', 'importlib._bootstrap', 'importlib._bootstrap_external', > 'warnings', 'importlib.util', 'importlib.abc', 'importlib.machinery', > 'contextlib', 'mpl_toolkits', 'encodings.cp437', 'readline', 'atexit', > 'rlcompleter', 'logging', 'time', 'traceback', 'linecache', 'tokenize', > 'token', 'string', '_string', 'threading', 'lib', 'lib.libyaml', 'yaml', > 'yaml.error', 'yaml.tokens', 'yaml.events', 'yaml.nodes', 'yaml.loader', > 'yaml.reader', 'yaml.scanner', 'yaml.parser', 'yaml.composer', > 'yaml.constructor', 'datetime', 'math', '_datetime', 'base64', 'struct', > '_struct', 'binascii', 'yaml.resolver', 'yaml.dumper', 'yaml.emitter', > 'yaml.serializer', 'yaml.representer', 'yaml.cyaml', '_yaml', 'lib.liblog', > 'lib.process_cmd', 'getopt', 'gettext', 'locale', 'copy', 'obspy', > '__future__', 'future', 'future.builtins', 'future.builtins.iterators', > 'future.utils', 'numbers', 'inspect', 'ast', '_ast', 'dis', 'opcode', > '_opcode', 'future.builtins.misc', 'requests', 'urllib3', > 'urllib3.connectionpool', 'socket', '_socket', 'selectors', 'select', > 'urllib3.exceptions', 'urllib3.packages', 'urllib3.packages.ssl_match_hostname', > 'ssl', 'ipaddress', 'textwrap', '_ssl', 'urllib3.packages.six', > 'urllib3.packages.six.moves', 'http', 'http.client', 'email', > 'email.parser', 'email.feedparser', 'email.errors', 'email._policybase', > 'email.header', 'email.quoprimime', 'email.base64mime', 'email.charset', > 'email.encoders', 'quopri', 'email.utils', 'random', 'hashlib', '_hashlib', > '_blake2', '_sha3', 'bisect', '_bisect', '_random', 'urllib', > 'urllib.parse', 'email._parseaddr', 'calendar', 'email.message', 'uu', > 'email._encoded_words', 'email.iterators', 'urllib3.packages.six.moves.http_client', > 'queue', 'urllib3.connection', 'urllib3.util', 'urllib3.util.connection', > 'urllib3.util.wait', 'urllib3.util.selectors', 'urllib3.util.request', > 'urllib3.util.response', 'urllib3.util.ssl_', 'hmac', > 'urllib3.util.timeout', 'urllib3.util.retry', 'urllib3.util.url', > 'urllib3._collections', 'urllib3.request', 'urllib3.filepost', 'uuid', > 'ctypes', '_ctypes', 'ctypes._endian', 'ctypes.util', 'shutil', 'fnmatch', > 'zlib', 'bz2', '_compression', '_bz2', 'lzma', '_lzma', 'pwd', 'grp', > 'subprocess', 'signal', '_posixsubprocess', 'ctypes.macholib', > 'ctypes.macholib.dyld', 'ctypes.macholib.framework', > 'ctypes.macholib.dylib', 'urllib3.fields', 'mimetypes', > 'urllib3.packages.six.moves.urllib', 'urllib3.packages.six.moves.urllib.parse', > 'urllib3.response', 'urllib3.poolmanager', 'chardet', 'chardet.compat', > 'chardet.universaldetector', 'chardet.charsetgroupprober', 'chardet.enums', > 'chardet.charsetprober', 'chardet.escprober', 'chardet.codingstatemachine', > 'chardet.escsm', 'chardet.latin1prober', 'chardet.mbcsgroupprober', > 'chardet.utf8prober', 'chardet.mbcssm', 'chardet.sjisprober', > 'chardet.mbcharsetprober', 'chardet.chardistribution', 'chardet.euctwfreq', > 'chardet.euckrfreq', 'chardet.gb2312freq', 'chardet.big5freq', > 'chardet.jisfreq', 'chardet.jpcntx', 'chardet.eucjpprober', > 'chardet.gb2312prober', 'chardet.euckrprober', 'chardet.cp949prober', > 'chardet.big5prober', 'chardet.euctwprober', 'chardet.sbcsgroupprober', > 'chardet.sbcharsetprober', 'chardet.langcyrillicmodel', > 'chardet.langgreekmodel', 'chardet.langbulgarianmodel', > 'chardet.langthaimodel', 'chardet.langhebrewmodel', 'chardet.hebrewprober', > 'chardet.langturkishmodel', 'chardet.version', 'requests.exceptions', > 'urllib3.contrib', 'urllib3.contrib.pyopenssl', 'OpenSSL', > 'OpenSSL.crypto', 'six', 'cryptography', 'cryptography.__about__', > 'cryptography.x509', 'cryptography.x509.certificate_transparency', > 'cryptography.x509.base', 'cryptography.utils', 'cryptography.hazmat', > 'cryptography.hazmat.primitives', 'cryptography.hazmat.primitives.asymmetric', > 'cryptography.hazmat.primitives.asymmetric.dsa', 'cryptography.hazmat. > primitives.asymmetric.ec', 'cryptography.hazmat.primitives.asymmetric.rsa', > 'cryptography.exceptions', 'cryptography.hazmat.backends', > 'cryptography.hazmat.backends.interfaces', 'cryptography.x509.extensions', > 'asn1crypto', 'asn1crypto.version', 'asn1crypto.keys', > 'asn1crypto._elliptic_curve', 'asn1crypto._int', 'platform', > 'asn1crypto.util', 'asn1crypto._errors', 'asn1crypto._iri', > 'encodings.idna', 'stringprep', 'unicodedata', 'asn1crypto._types', > 'asn1crypto._ordereddict', 'asn1crypto._ffi', 'asn1crypto._perf', > 'asn1crypto._perf._big_num_ctypes', 'asn1crypto.algos', > 'asn1crypto.core', 'asn1crypto._teletex_codec', 'asn1crypto.parser', > 'cryptography.hazmat.primitives.constant_time', > 'cryptography.hazmat.bindings', '_cffi_backend', '_constant_time.lib', > '_constant_time', 'cryptography.hazmat.bindings._constant_time', > 'cryptography.hazmat.primitives.serialization', > 'cryptography.x509.general_name', 'idna', 'idna.package_data', > 'idna.core', 'idna.idnadata', 'idna.intranges', 'six.moves', ' > cryptography.x509.name', 'cryptography.x509.oid', 'cryptography.hazmat.primitives.hashes', > 'OpenSSL._util', 'cryptography.hazmat.bindings.openssl', > 'cryptography.hazmat.bindings.openssl.binding', '_openssl.lib', > '_openssl', 'cryptography.hazmat.bindings._openssl', > 'cryptography.hazmat.bindings.openssl._conditional', 'OpenSSL.SSL', > 'OpenSSL.version', 'cryptography.hazmat.backends.openssl', > 'cryptography.hazmat.backends.openssl.backend', > 'cryptography.hazmat.backends.openssl.aead', > 'cryptography.hazmat.backends.openssl.ciphers', 'cryptography.hazmat.primitives.ciphers', > 'cryptography.hazmat.primitives.ciphers.base', 'cryptography.hazmat.primitives.ciphers.modes', > 'cryptography.hazmat.backends.openssl.cmac', 'cryptography.hazmat.primitives.mac', > 'cryptography.hazmat.backends.openssl.decode_asn1', > 'cryptography.hazmat.backends.openssl.dh', 'cryptography.hazmat.primitives.asymmetric.dh', > 'cryptography.hazmat.backends.openssl.dsa', 'cryptography.hazmat.backends.openssl.utils', > 'cryptography.hazmat.primitives.asymmetric.utils', ' > cryptography.hazmat.backends.openssl.ec', 'cryptography.hazmat.backends.openssl.encode_asn1', > 'cryptography.hazmat.backends.openssl.hashes', > 'cryptography.hazmat.backends.openssl.hmac', > 'cryptography.hazmat.backends.openssl.rsa', 'cryptography.hazmat. > primitives.asymmetric.padding', 'cryptography.hazmat.backends.openssl.x25519', > 'cryptography.hazmat.primitives.asymmetric.x25519', > 'cryptography.hazmat.backends.openssl.x509', 'cryptography.hazmat. > primitives.ciphers.algorithms', 'cryptography.hazmat.primitives.kdf', > 'cryptography.hazmat.primitives.kdf.scrypt', > 'urllib3.packages.backports', 'urllib3.packages.backports.makefile', > 'requests.__version__', 'requests.utils', 'cgi', 'html', 'html.entities', > 'tempfile', 'requests.certs', 'certifi', 'certifi.core', > 'requests._internal_utils', 'requests.compat', 'json', 'json.decoder', > 'json.scanner', '_json', 'json.encoder', 'urllib.request', 'urllib.error', > 'urllib.response', '_scproxy', 'http.cookiejar', 'http.cookies', > 'requests.cookies', 'requests.structures', 'requests.packages', > 'requests.packages.urllib3', 'requests.packages.urllib3.connectionpool', > 'requests.packages.urllib3.exceptions', 'requests.packages.urllib3.packages', > 'requests.packages.urllib3.packages.ssl_match_hostname', > 'requests.packages.urllib3.packages.six', 'requests.packages.urllib3.packages.six.moves', > 'requests.packages.urllib3.packages.six.moves.http_client', > 'requests.packages.urllib3.connection', 'requests.packages.urllib3.util', > 'requests.packages.urllib3.util.connection', 'requests.packages.urllib3.util.wait', > 'requests.packages.urllib3.util.selectors', 'requests.packages.urllib3.util.request', > 'requests.packages.urllib3.util.response', 'requests.packages.urllib3.util.ssl_', > 'requests.packages.urllib3.util.timeout', 'requests.packages.urllib3.util.retry', > 'requests.packages.urllib3.util.url', 'requests.packages.urllib3._collections', > 'requests.packages.urllib3.request', 'requests.packages.urllib3.filepost', > 'requests.packages.urllib3.fields', 'requests.packages.urllib3.packages.six.moves.urllib', > 'requests.packages.urllib3.packages.six.moves.urllib.parse', > 'requests.packages.urllib3.response', 'requests.packages.urllib3.poolmanager', > 'requests.packages.urllib3.contrib', 'requests.packages.urllib3.contrib.pyopenssl', > 'requests.packages.urllib3.packages.backports', > 'requests.packages.urllib3.packages.backports.makefile', > 'requests.packages.idna', 'requests.packages.idna.package_data', > 'requests.packages.idna.core', 'requests.packages.idna.idnadata', > 'requests.packages.idna.intranges', 'requests.packages.chardet', > 'requests.packages.chardet.compat', 'requests.packages.chardet.universaldetector', > 'requests.packages.chardet.charsetgroupprober', > 'requests.packages.chardet.enums', 'requests.packages.chardet.charsetprober', > 'requests.packages.chardet.escprober', 'requests.packages.chardet.codingstatemachine', > 'requests.packages.chardet.escsm', 'requests.packages.chardet.latin1prober', > 'requests.packages.chardet.mbcsgroupprober', 'requests.packages.chardet.utf8prober', > 'requests.packages.chardet.mbcssm', 'requests.packages.chardet.sjisprober', > 'requests.packages.chardet.mbcharsetprober', 'requests.packages.chardet.chardistribution', > 'requests.packages.chardet.euctwfreq', 'requests.packages.chardet.euckrfreq', > 'requests.packages.chardet.gb2312freq', 'requests.packages.chardet.big5freq', > 'requests.packages.chardet.jisfreq', 'requests.packages.chardet.jpcntx', > 'requests.packages.chardet.eucjpprober', 'requests.packages.chardet.gb2312prober', > 'requests.packages.chardet.euckrprober', 'requests.packages.chardet.cp949prober', > 'requests.packages.chardet.big5prober', 'requests.packages.chardet.euctwprober', > 'requests.packages.chardet.sbcsgroupprober', 'requests.packages.chardet.sbcharsetprober', > 'requests.packages.chardet.langcyrillicmodel', 'requests.packages.chardet.langgreekmodel', > 'requests.packages.chardet.langbulgarianmodel', > 'requests.packages.chardet.langthaimodel', 'requests.packages.chardet.langhebrewmodel', > 'requests.packages.chardet.hebrewprober', 'requests.packages.chardet.langturkishmodel', > 'requests.packages.chardet.version', 'requests.models', 'requests.hooks', > 'requests.auth', 'requests.status_codes', 'requests.api', > 'requests.sessions', 'requests.adapters', 'urllib3.contrib.socks', 'socks', > 'obspy.core', 'obspy.core.utcdatetime', 'obspy.core.util', > 'obspy.core.util.attribdict', 'obspy.core.util.base', 'doctest', > 'argparse', 'difflib', 'pdb', 'cmd', 'bdb', 'code', 'codeop', 'glob', > 'pprint', 'unittest', 'unittest.result', 'unittest.util', 'unittest.case', > 'unittest.suite', 'unittest.loader', 'unittest.main', 'unittest.runner', > 'unittest.signals', 'numpy', 'numpy._globals', 'numpy.__config__', > 'numpy.version', 'numpy._import_tools', 'numpy.add_newdocs', 'numpy.lib', ' > numpy.lib.info', 'numpy.lib.type_check', 'numpy.core', 'numpy.core.info', > 'numpy.core.multiarray', 'numpy.core.umath', 'numpy.core._internal', > 'numpy.compat', 'numpy.compat._inspect', 'numpy.compat.py3k', 'pathlib', > 'ntpath', 'numpy.core.numerictypes', 'numpy.core.numeric', 'pickle', > '_compat_pickle', '_pickle', 'numpy.core.fromnumeric', > 'numpy.core._methods', 'numpy.core.arrayprint', 'numpy.core.defchararray', > 'numpy.core.records', 'numpy.core.memmap', 'numpy.core.function_base', > 'numpy.core.machar', 'numpy.core.getlimits', 'numpy.core.shape_base', > 'numpy.core.einsumfunc', 'numpy.testing', 'numpy.testing.decorators', > 'numpy.testing.nose_tools', 'numpy.testing.nose_tools.decorators', > 'numpy.testing.nose_tools.utils', 'numpy.lib.utils', > 'numpy.testing.nosetester', 'numpy.testing.nose_tools.nosetester', > 'numpy.testing.utils', 'numpy.lib.ufunclike', 'numpy.lib.index_tricks', > 'numpy.lib.function_base', 'numpy.lib.twodim_base', 'numpy.matrixlib', > 'numpy.matrixlib.defmatrix', 'numpy.lib.stride_tricks', 'numpy.lib.mixins', > 'numpy.lib.nanfunctions', 'numpy.lib.shape_base', 'numpy.lib.scimath', > 'numpy.lib.polynomial', 'numpy.linalg', 'numpy.linalg.info', > 'numpy.linalg.linalg', 'numpy.linalg.lapack_lite', > 'numpy.linalg._umath_linalg', 'numpy.lib.arraysetops', 'numpy.lib.npyio', > 'numpy.lib.format', 'numpy.lib._datasource', 'numpy.lib._iotools', > 'numpy.lib.financial', 'decimal', '_decimal', 'numpy.lib.arrayterator', > 'numpy.lib.arraypad', 'numpy.lib._version', 'numpy._distributor_init', > 'numpy._mklinit', 'numpy.fft', 'numpy.fft.info', 'numpy.fft.fftpack', > 'numpy.fft.fftpack_lite', 'numpy.fft.helper', 'numpy.polynomial', > 'numpy.polynomial.polynomial', 'numpy.polynomial.polyutils', > 'numpy.polynomial._polybase', 'numpy.polynomial.chebyshev', > 'numpy.polynomial.legendre', 'numpy.polynomial.hermite', > 'numpy.polynomial.hermite_e', 'numpy.polynomial.laguerre', 'numpy.random', ' > numpy.random.info', 'cython_runtime', 'mtrand', 'numpy.random.mtrand', > 'numpy.ctypeslib', 'numpy.ma', 'numpy.ma.core', 'numpy.ma.extras', > 'pkg_resources', 'zipfile', 'pkgutil', 'plistlib', 'xml', 'xml.parsers', > 'xml.parsers.expat', 'pyexpat.errors', 'pyexpat.model', 'pyexpat', > 'xml.parsers.expat.model', 'xml.parsers.expat.errors', > 'pkg_resources.extern', 'pkg_resources._vendor', > 'pkg_resources.extern.six', 'pkg_resources._vendor.six', > 'pkg_resources.extern.six.moves', 'pkg_resources._vendor.six.moves', > 'pkg_resources.py31compat', 'pkg_resources.extern.appdirs', > 'pkg_resources._vendor.packaging.__about__', 'pkg_resources.extern.packaging', > 'pkg_resources.extern.packaging.version', 'pkg_resources.extern.packaging._structures', > 'pkg_resources.extern.packaging.specifiers', 'pkg_resources.extern.packaging._compat', > 'pkg_resources.extern.packaging.requirements', 'pkg_resources.extern.pyparsing', > 'pkg_resources.extern.six.moves.urllib', 'pkg_resources.extern.packaging.markers', > 'obspy.core.util.misc', 'obspy.core.util.obspy_types', > 'obspy.core.util.testing', 'distutils', 'distutils.version', 'lxml', > '_cython_0_28', 'lxml.etree', 'lxml._elementpath', 'gzip', > 'obspy.core.util.version', 'obspy.core.trace', 'decorator', > 'obspy.core.compatibility', 'unittest.mock', 'configparser', > 'obspy.core.util.decorator', 'tarfile', 'obspy.core.util.deprecation_helpers', > 'obspy.core.stream', 'obspy.scripts', 'obspy.scripts.runtests', > 'obspy.core.event', 'obspy.core.event.base', 'obspy.core.event.header', > 'obspy.core.event.catalog', 'obspy.imaging', 'obspy.imaging.cm', > 'matplotlib', 'distutils.sysconfig', 'distutils.errors', > 'matplotlib.cbook', 'matplotlib.cbook.deprecation', > 'matplotlib.cbook._backports', 'matplotlib.compat', > 'matplotlib.compat.subprocess', 'matplotlib.rcsetup', > 'matplotlib.testing', 'matplotlib.fontconfig_pattern', 'pyparsing', > 'matplotlib.colors', 'matplotlib._color_data', 'cycler', > 'six.moves.urllib', 'six.moves.urllib.request', 'matplotlib._version', > 'dateutil', 'dateutil._version'] > [ DEBUG] CACHEDIR=/Users/mth/.matplotlib > [ DEBUG] Using fontManager instance from /Users/mth/.matplotlib/ > fontList.json > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jklymak at uvic.ca Tue Mar 20 17:37:45 2018 From: jklymak at uvic.ca (Jody Klymak) Date: Tue, 20 Mar 2018 14:37:45 -0700 Subject: [Matplotlib-users] How to turn off matplotlib DEBUG msgs In-Reply-To: References: Message-ID: <1F60758E-4952-467B-A42B-7660E6667A00@uvic.ca> matplotlib now uses the standard python logging library. You should ask `obspy` if they are setting the default debug level for other packages. But for now, something like the following in your script should quiet matplotlib down. ``` import logging mpl_logger = logging.getLogger(?matplotlib?) mpl_logger.setLevel(logging.WARNING) ``` https://matplotlib.org/faq/troubleshooting_faq.html https://docs.python.org/3/library/logging.html#module-logging Cheers, Jody > On 20 Mar 2018, at 14:21, Mike Hagerty wrote: > > I recently installed the latest version of matplotlib via conda: > # packages in environment: > matplotlib 2.2.2 py27_0 conda-forge > > Now, as soon as matplotlib is imported by another module, it generates a ton of DEBUG messages (see below). > > How do I turn these off ?? > > Oddly, if I use the interactive python and import matplotlib directly, I don't get the messages, so it > has something to do with how the code I'm using (obspy) imports the matplotlib module. > > I'm using mac osx 10.10.5 and I get similar results with python2.7 and python3.6 (conda) environments. > > Any advice would be appreciated. > > Cheers! > -Mike > > > > > >>> from obspy.taup import TauPyModel > [ DEBUG] $HOME=/Users/mth > [ DEBUG] matplotlib data path /usr/local/anaconda/envs/obspy_3.6/lib/python3.6/site-packages/matplotlib/mpl-data > [ DEBUG] loaded rc file /usr/local/anaconda/envs/obspy_3.6/lib/python3.6/site-packages/matplotlib/mpl-data/matplotlibrc > [ DEBUG] matplotlib version 2.2.2 > [ DEBUG] interactive is False > [ DEBUG] platform is darwin > [ DEBUG] loaded modules: ['builtins', 'sys', '_frozen_importlib', '_imp', '_warnings', '_thread', '_weakref', '_frozen_importlib_external', '_io', 'marshal', 'posix', 'zipimport', 'encodings', 'codecs', '_codecs', 'encodings.aliases', 'encodings.utf_8', '_signal', '__main__', 'encodings.latin_1', 'io', 'abc', '_weakrefset', 'site', 'os', 'errno', 'stat', '_stat', 'posixpath', 'genericpath', 'os.path', '_collections_abc', '_sitebuiltins', 'sysconfig', '_sysconfigdata_m_darwin_darwin', '_osx_support', 're', 'enum', 'types', 'functools', '_functools', 'collections', 'operator', '_operator', 'keyword', 'heapq', '_heapq', 'itertools', 'reprlib', '_collections', 'weakref', 'collections.abc', 'sre_compile', '_sre', 'sre_parse', 'sre_constants', '_locale', 'copyreg', '_bootlocale', 'importlib', 'importlib._bootstrap', 'importlib._bootstrap_external', 'warnings', 'importlib.util', 'importlib.abc', 'importlib.machinery', 'contextlib', 'mpl_toolkits', 'encodings.cp437', 'readline', 'atexit', 'rlcompleter', 'logging', 'time', 'traceback', 'linecache', 'tokenize', 'token', 'string', '_string', 'threading', 'lib', 'lib.libyaml', 'yaml', 'yaml.error', 'yaml.tokens', 'yaml.events', 'yaml.nodes', 'yaml.loader', 'yaml.reader', 'yaml.scanner', 'yaml.parser', 'yaml.composer', 'yaml.constructor', 'datetime', 'math', '_datetime', 'base64', 'struct', '_struct', 'binascii', 'yaml.resolver', 'yaml.dumper', 'yaml.emitter', 'yaml.serializer', 'yaml.representer', 'yaml.cyaml', '_yaml', 'lib.liblog', 'lib.process_cmd', 'getopt', 'gettext', 'locale', 'copy', 'obspy', '__future__', 'future', 'future.builtins', 'future.builtins.iterators', 'future.utils', 'numbers', 'inspect', 'ast', '_ast', 'dis', 'opcode', '_opcode', 'future.builtins.misc', 'requests', 'urllib3', 'urllib3.connectionpool', 'socket', '_socket', 'selectors', 'select', 'urllib3.exceptions', 'urllib3.packages', 'urllib3.packages.ssl_match_hostname', 'ssl', 'ipaddress', 'textwrap', '_ssl', 'urllib3.packages.six', 'urllib3.packages.six.moves', 'http', 'http.client', 'email', 'email.parser', 'email.feedparser', 'email.errors', 'email._policybase', 'email.header', 'email.quoprimime', 'email.base64mime', 'email.charset', 'email.encoders', 'quopri', 'email.utils', 'random', 'hashlib', '_hashlib', '_blake2', '_sha3', 'bisect', '_bisect', '_random', 'urllib', 'urllib.parse', 'email._parseaddr', 'calendar', 'email.message', 'uu', 'email._encoded_words', 'email.iterators', 'urllib3.packages.six.moves.http_client', 'queue', 'urllib3.connection', 'urllib3.util', 'urllib3.util.connection', 'urllib3.util.wait', 'urllib3.util.selectors', 'urllib3.util.request', 'urllib3.util.response', 'urllib3.util.ssl_', 'hmac', 'urllib3.util.timeout', 'urllib3.util.retry', 'urllib3.util.url', 'urllib3._collections', 'urllib3.request', 'urllib3.filepost', 'uuid', 'ctypes', '_ctypes', 'ctypes._endian', 'ctypes.util', 'shutil', 'fnmatch', 'zlib', 'bz2', '_compression', '_bz2', 'lzma', '_lzma', 'pwd', 'grp', 'subprocess', 'signal', '_posixsubprocess', 'ctypes.macholib', 'ctypes.macholib.dyld', 'ctypes.macholib.framework', 'ctypes.macholib.dylib', 'urllib3.fields', 'mimetypes', 'urllib3.packages.six.moves.urllib', 'urllib3.packages.six.moves.urllib.parse', 'urllib3.response', 'urllib3.poolmanager', 'chardet', 'chardet.compat', 'chardet.universaldetector', 'chardet.charsetgroupprober', 'chardet.enums', 'chardet.charsetprober', 'chardet.escprober', 'chardet.codingstatemachine', 'chardet.escsm', 'chardet.latin1prober', 'chardet.mbcsgroupprober', 'chardet.utf8prober', 'chardet.mbcssm', 'chardet.sjisprober', 'chardet.mbcharsetprober', 'chardet.chardistribution', 'chardet.euctwfreq', 'chardet.euckrfreq', 'chardet.gb2312freq', 'chardet.big5freq', 'chardet.jisfreq', 'chardet.jpcntx', 'chardet.eucjpprober', 'chardet.gb2312prober', 'chardet.euckrprober', 'chardet.cp949prober', 'chardet.big5prober', 'chardet.euctwprober', 'chardet.sbcsgroupprober', 'chardet.sbcharsetprober', 'chardet.langcyrillicmodel', 'chardet.langgreekmodel', 'chardet.langbulgarianmodel', 'chardet.langthaimodel', 'chardet.langhebrewmodel', 'chardet.hebrewprober', 'chardet.langturkishmodel', 'chardet.version', 'requests.exceptions', 'urllib3.contrib', 'urllib3.contrib.pyopenssl', 'OpenSSL', 'OpenSSL.crypto', 'six', 'cryptography', 'cryptography.__about__', 'cryptography.x509', 'cryptography.x509.certificate_transparency', 'cryptography.x509.base', 'cryptography.utils', 'cryptography.hazmat', 'cryptography.hazmat.primitives', 'cryptography.hazmat.primitives.asymmetric', 'cryptography.hazmat.primitives.asymmetric.dsa', 'cryptography.hazmat.primitives.asymmetric.ec', 'cryptography.hazmat.primitives.asymmetric.rsa', 'cryptography.exceptions', 'cryptography.hazmat.backends', 'cryptography.hazmat.backends.interfaces', 'cryptography.x509.extensions', 'asn1crypto', 'asn1crypto.version', 'asn1crypto.keys', 'asn1crypto._elliptic_curve', 'asn1crypto._int', 'platform', 'asn1crypto.util', 'asn1crypto._errors', 'asn1crypto._iri', 'encodings.idna', 'stringprep', 'unicodedata', 'asn1crypto._types', 'asn1crypto._ordereddict', 'asn1crypto._ffi', 'asn1crypto._perf', 'asn1crypto._perf._big_num_ctypes', 'asn1crypto.algos', 'asn1crypto.core', 'asn1crypto._teletex_codec', 'asn1crypto.parser', 'cryptography.hazmat.primitives.constant_time', 'cryptography.hazmat.bindings', '_cffi_backend', '_constant_time.lib', '_constant_time', 'cryptography.hazmat.bindings._constant_time', 'cryptography.hazmat.primitives.serialization', 'cryptography.x509.general_name', 'idna', 'idna.package_data', 'idna.core', 'idna.idnadata', 'idna.intranges', 'six.moves', 'cryptography.x509.name', 'cryptography.x509.oid', 'cryptography.hazmat.primitives.hashes', 'OpenSSL._util', 'cryptography.hazmat.bindings.openssl', 'cryptography.hazmat.bindings.openssl.binding', '_openssl.lib', '_openssl', 'cryptography.hazmat.bindings._openssl', 'cryptography.hazmat.bindings.openssl._conditional', 'OpenSSL.SSL', 'OpenSSL.version', 'cryptography.hazmat.backends.openssl', 'cryptography.hazmat.backends.openssl.backend', 'cryptography.hazmat.backends.openssl.aead', 'cryptography.hazmat.backends.openssl.ciphers', 'cryptography.hazmat.primitives.ciphers', 'cryptography.hazmat.primitives.ciphers.base', 'cryptography.hazmat.primitives.ciphers.modes', 'cryptography.hazmat.backends.openssl.cmac', 'cryptography.hazmat.primitives.mac', 'cryptography.hazmat.backends.openssl.decode_asn1', 'cryptography.hazmat.backends.openssl.dh', 'cryptography.hazmat.primitives.asymmetric.dh', 'cryptography.hazmat.backends.openssl.dsa', 'cryptography.hazmat.backends.openssl.utils', 'cryptography.hazmat.primitives.asymmetric.utils', 'cryptography.hazmat.backends.openssl.ec', 'cryptography.hazmat.backends.openssl.encode_asn1', 'cryptography.hazmat.backends.openssl.hashes', 'cryptography.hazmat.backends.openssl.hmac', 'cryptography.hazmat.backends.openssl.rsa', 'cryptography.hazmat.primitives.asymmetric.padding', 'cryptography.hazmat.backends.openssl.x25519', 'cryptography.hazmat.primitives.asymmetric.x25519', 'cryptography.hazmat.backends.openssl.x509', 'cryptography.hazmat.primitives.ciphers.algorithms', 'cryptography.hazmat.primitives.kdf', 'cryptography.hazmat.primitives.kdf.scrypt', 'urllib3.packages.backports', 'urllib3.packages.backports.makefile', 'requests.__version__', 'requests.utils', 'cgi', 'html', 'html.entities', 'tempfile', 'requests.certs', 'certifi', 'certifi.core', 'requests._internal_utils', 'requests.compat', 'json', 'json.decoder', 'json.scanner', '_json', 'json.encoder', 'urllib.request', 'urllib.error', 'urllib.response', '_scproxy', 'http.cookiejar', 'http.cookies', 'requests.cookies', 'requests.structures', 'requests.packages', 'requests.packages.urllib3', 'requests.packages.urllib3.connectionpool', 'requests.packages.urllib3.exceptions', 'requests.packages.urllib3.packages', 'requests.packages.urllib3.packages.ssl_match_hostname', 'requests.packages.urllib3.packages.six', 'requests.packages.urllib3.packages.six.moves', 'requests.packages.urllib3.packages.six.moves.http_client', 'requests.packages.urllib3.connection', 'requests.packages.urllib3.util', 'requests.packages.urllib3.util.connection', 'requests.packages.urllib3.util.wait', 'requests.packages.urllib3.util.selectors', 'requests.packages.urllib3.util.request', 'requests.packages.urllib3.util.response', 'requests.packages.urllib3.util.ssl_', 'requests.packages.urllib3.util.timeout', 'requests.packages.urllib3.util.retry', 'requests.packages.urllib3.util.url', 'requests.packages.urllib3._collections', 'requests.packages.urllib3.request', 'requests.packages.urllib3.filepost', 'requests.packages.urllib3.fields', 'requests.packages.urllib3.packages.six.moves.urllib', 'requests.packages.urllib3.packages.six.moves.urllib.parse', 'requests.packages.urllib3.response', 'requests.packages.urllib3.poolmanager', 'requests.packages.urllib3.contrib', 'requests.packages.urllib3.contrib.pyopenssl', 'requests.packages.urllib3.packages.backports', 'requests.packages.urllib3.packages.backports.makefile', 'requests.packages.idna', 'requests.packages.idna.package_data', 'requests.packages.idna.core', 'requests.packages.idna.idnadata', 'requests.packages.idna.intranges', 'requests.packages.chardet', 'requests.packages.chardet.compat', 'requests.packages.chardet.universaldetector', 'requests.packages.chardet.charsetgroupprober', 'requests.packages.chardet.enums', 'requests.packages.chardet.charsetprober', 'requests.packages.chardet.escprober', 'requests.packages.chardet.codingstatemachine', 'requests.packages.chardet.escsm', 'requests.packages.chardet.latin1prober', 'requests.packages.chardet.mbcsgroupprober', 'requests.packages.chardet.utf8prober', 'requests.packages.chardet.mbcssm', 'requests.packages.chardet.sjisprober', 'requests.packages.chardet.mbcharsetprober', 'requests.packages.chardet.chardistribution', 'requests.packages.chardet.euctwfreq', 'requests.packages.chardet.euckrfreq', 'requests.packages.chardet.gb2312freq', 'requests.packages.chardet.big5freq', 'requests.packages.chardet.jisfreq', 'requests.packages.chardet.jpcntx', 'requests.packages.chardet.eucjpprober', 'requests.packages.chardet.gb2312prober', 'requests.packages.chardet.euckrprober', 'requests.packages.chardet.cp949prober', 'requests.packages.chardet.big5prober', 'requests.packages.chardet.euctwprober', 'requests.packages.chardet.sbcsgroupprober', 'requests.packages.chardet.sbcharsetprober', 'requests.packages.chardet.langcyrillicmodel', 'requests.packages.chardet.langgreekmodel', 'requests.packages.chardet.langbulgarianmodel', 'requests.packages.chardet.langthaimodel', 'requests.packages.chardet.langhebrewmodel', 'requests.packages.chardet.hebrewprober', 'requests.packages.chardet.langturkishmodel', 'requests.packages.chardet.version', 'requests.models', 'requests.hooks', 'requests.auth', 'requests.status_codes', 'requests.api', 'requests.sessions', 'requests.adapters', 'urllib3.contrib.socks', 'socks', 'obspy.core', 'obspy.core.utcdatetime', 'obspy.core.util', 'obspy.core.util.attribdict', 'obspy.core.util.base', 'doctest', 'argparse', 'difflib', 'pdb', 'cmd', 'bdb', 'code', 'codeop', 'glob', 'pprint', 'unittest', 'unittest.result', 'unittest.util', 'unittest.case', 'unittest.suite', 'unittest.loader', 'unittest.main', 'unittest.runner', 'unittest.signals', 'numpy', 'numpy._globals', 'numpy.__config__', 'numpy.version', 'numpy._import_tools', 'numpy.add_newdocs', 'numpy.lib', 'numpy.lib.info', 'numpy.lib.type_check', 'numpy.core', 'numpy.core.info', 'numpy.core.multiarray', 'numpy.core.umath', 'numpy.core._internal', 'numpy.compat', 'numpy.compat._inspect', 'numpy.compat.py3k', 'pathlib', 'ntpath', 'numpy.core.numerictypes', 'numpy.core.numeric', 'pickle', '_compat_pickle', '_pickle', 'numpy.core.fromnumeric', 'numpy.core._methods', 'numpy.core.arrayprint', 'numpy.core.defchararray', 'numpy.core.records', 'numpy.core.memmap', 'numpy.core.function_base', 'numpy.core.machar', 'numpy.core.getlimits', 'numpy.core.shape_base', 'numpy.core.einsumfunc', 'numpy.testing', 'numpy.testing.decorators', 'numpy.testing.nose_tools', 'numpy.testing.nose_tools.decorators', 'numpy.testing.nose_tools.utils', 'numpy.lib.utils', 'numpy.testing.nosetester', 'numpy.testing.nose_tools.nosetester', 'numpy.testing.utils', 'numpy.lib.ufunclike', 'numpy.lib.index_tricks', 'numpy.lib.function_base', 'numpy.lib.twodim_base', 'numpy.matrixlib', 'numpy.matrixlib.defmatrix', 'numpy.lib.stride_tricks', 'numpy.lib.mixins', 'numpy.lib.nanfunctions', 'numpy.lib.shape_base', 'numpy.lib.scimath', 'numpy.lib.polynomial', 'numpy.linalg', 'numpy.linalg.info', 'numpy.linalg.linalg', 'numpy.linalg.lapack_lite', 'numpy.linalg._umath_linalg', 'numpy.lib.arraysetops', 'numpy.lib.npyio', 'numpy.lib.format', 'numpy.lib._datasource', 'numpy.lib._iotools', 'numpy.lib.financial', 'decimal', '_decimal', 'numpy.lib.arrayterator', 'numpy.lib.arraypad', 'numpy.lib._version', 'numpy._distributor_init', 'numpy._mklinit', 'numpy.fft', 'numpy.fft.info', 'numpy.fft.fftpack', 'numpy.fft.fftpack_lite', 'numpy.fft.helper', 'numpy.polynomial', 'numpy.polynomial.polynomial', 'numpy.polynomial.polyutils', 'numpy.polynomial._polybase', 'numpy.polynomial.chebyshev', 'numpy.polynomial.legendre', 'numpy.polynomial.hermite', 'numpy.polynomial.hermite_e', 'numpy.polynomial.laguerre', 'numpy.random', 'numpy.random.info', 'cython_runtime', 'mtrand', 'numpy.random.mtrand', 'numpy.ctypeslib', 'numpy.ma', 'numpy.ma.core', 'numpy.ma.extras', 'pkg_resources', 'zipfile', 'pkgutil', 'plistlib', 'xml', 'xml.parsers', 'xml.parsers.expat', 'pyexpat.errors', 'pyexpat.model', 'pyexpat', 'xml.parsers.expat.model', 'xml.parsers.expat.errors', 'pkg_resources.extern', 'pkg_resources._vendor', 'pkg_resources.extern.six', 'pkg_resources._vendor.six', 'pkg_resources.extern.six.moves', 'pkg_resources._vendor.six.moves', 'pkg_resources.py31compat', 'pkg_resources.extern.appdirs', 'pkg_resources._vendor.packaging.__about__', 'pkg_resources.extern.packaging', 'pkg_resources.extern.packaging.version', 'pkg_resources.extern.packaging._structures', 'pkg_resources.extern.packaging.specifiers', 'pkg_resources.extern.packaging._compat', 'pkg_resources.extern.packaging.requirements', 'pkg_resources.extern.pyparsing', 'pkg_resources.extern.six.moves.urllib', 'pkg_resources.extern.packaging.markers', 'obspy.core.util.misc', 'obspy.core.util.obspy_types', 'obspy.core.util.testing', 'distutils', 'distutils.version', 'lxml', '_cython_0_28', 'lxml.etree', 'lxml._elementpath', 'gzip', 'obspy.core.util.version', 'obspy.core.trace', 'decorator', 'obspy.core.compatibility', 'unittest.mock', 'configparser', 'obspy.core.util.decorator', 'tarfile', 'obspy.core.util.deprecation_helpers', 'obspy.core.stream', 'obspy.scripts', 'obspy.scripts.runtests', 'obspy.core.event', 'obspy.core.event.base', 'obspy.core.event.header', 'obspy.core.event.catalog', 'obspy.imaging', 'obspy.imaging.cm', 'matplotlib', 'distutils.sysconfig', 'distutils.errors', 'matplotlib.cbook', 'matplotlib.cbook.deprecation', 'matplotlib.cbook._backports', 'matplotlib.compat', 'matplotlib.compat.subprocess', 'matplotlib.rcsetup', 'matplotlib.testing', 'matplotlib.fontconfig_pattern', 'pyparsing', 'matplotlib.colors', 'matplotlib._color_data', 'cycler', 'six.moves.urllib', 'six.moves.urllib.request', 'matplotlib._version', 'dateutil', 'dateutil._version'] > [ DEBUG] CACHEDIR=/Users/mth/.matplotlib > [ DEBUG] Using fontManager instance from /Users/mth/.matplotlib/fontList.json > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users -- Jody Klymak http://web.uvic.ca/~jklymak/ From m.hagerty at isti.com Tue Mar 20 18:09:16 2018 From: m.hagerty at isti.com (Mike Hagerty) Date: Tue, 20 Mar 2018 18:09:16 -0400 Subject: [Matplotlib-users] How to turn off matplotlib DEBUG msgs In-Reply-To: <1F60758E-4952-467B-A42B-7660E6667A00@uvic.ca> References: <1F60758E-4952-467B-A42B-7660E6667A00@uvic.ca> Message-ID: Thanks, that seems to work. I was already getting the logger and setting the root logLevel - I thought that would be passed through but I guess matplotlib is configured earlier in the process. Cheers, -Mike On Tue, Mar 20, 2018 at 5:37 PM, Jody Klymak wrote: > > matplotlib now uses the standard python logging library. You should ask > `obspy` if they are setting the default debug level for other packages. > > But for now, something like the following in your script should quiet > matplotlib down. > > > ``` > import logging > mpl_logger = logging.getLogger(?matplotlib?) > mpl_logger.setLevel(logging.WARNING) > > ``` > > https://matplotlib.org/faq/troubleshooting_faq.html > https://docs.python.org/3/library/logging.html#module-logging > > > Cheers, Jody > > > On 20 Mar 2018, at 14:21, Mike Hagerty wrote: > > > > I recently installed the latest version of matplotlib via conda: > > # packages in environment: > > matplotlib 2.2.2 py27_0 conda-forge > > > > Now, as soon as matplotlib is imported by another module, it generates a > ton of DEBUG messages (see below). > > > > How do I turn these off ?? > > > > Oddly, if I use the interactive python and import matplotlib directly, I > don't get the messages, so it > > has something to do with how the code I'm using (obspy) imports the > matplotlib module. > > > > I'm using mac osx 10.10.5 and I get similar results with python2.7 and > python3.6 (conda) environments. > > > > Any advice would be appreciated. > > > > Cheers! > > -Mike > > > > > > > > > > >>> from obspy.taup import TauPyModel > > [ DEBUG] $HOME=/Users/mth > > [ DEBUG] matplotlib data path /usr/local/anaconda/envs/ > obspy_3.6/lib/python3.6/site-packages/matplotlib/mpl-data > > [ DEBUG] loaded rc file /usr/local/anaconda/envs/ > obspy_3.6/lib/python3.6/site-packages/matplotlib/mpl-data/matplotlibrc > > [ DEBUG] matplotlib version 2.2.2 > > [ DEBUG] interactive is False > > [ DEBUG] platform is darwin > > [ DEBUG] loaded modules: ['builtins', 'sys', '_frozen_importlib', > '_imp', '_warnings', '_thread', '_weakref', '_frozen_importlib_external', > '_io', 'marshal', 'posix', 'zipimport', 'encodings', 'codecs', '_codecs', > 'encodings.aliases', 'encodings.utf_8', '_signal', '__main__', > 'encodings.latin_1', 'io', 'abc', '_weakrefset', 'site', 'os', 'errno', > 'stat', '_stat', 'posixpath', 'genericpath', 'os.path', '_collections_abc', > '_sitebuiltins', 'sysconfig', '_sysconfigdata_m_darwin_darwin', > '_osx_support', 're', 'enum', 'types', 'functools', '_functools', > 'collections', 'operator', '_operator', 'keyword', 'heapq', '_heapq', > 'itertools', 'reprlib', '_collections', 'weakref', 'collections.abc', > 'sre_compile', '_sre', 'sre_parse', 'sre_constants', '_locale', 'copyreg', > '_bootlocale', 'importlib', 'importlib._bootstrap', 'importlib._bootstrap_external', > 'warnings', 'importlib.util', 'importlib.abc', 'importlib.machinery', > 'contextlib', 'mpl_toolkits', 'encodings.cp437', 'readline', 'atexit', > 'rlcompleter', 'logging', 'time', 'traceback', 'linecache', 'tokenize', > 'token', 'string', '_string', 'threading', 'lib', 'lib.libyaml', 'yaml', > 'yaml.error', 'yaml.tokens', 'yaml.events', 'yaml.nodes', 'yaml.loader', > 'yaml.reader', 'yaml.scanner', 'yaml.parser', 'yaml.composer', > 'yaml.constructor', 'datetime', 'math', '_datetime', 'base64', 'struct', > '_struct', 'binascii', 'yaml.resolver', 'yaml.dumper', 'yaml.emitter', > 'yaml.serializer', 'yaml.representer', 'yaml.cyaml', '_yaml', 'lib.liblog', > 'lib.process_cmd', 'getopt', 'gettext', 'locale', 'copy', 'obspy', > '__future__', 'future', 'future.builtins', 'future.builtins.iterators', > 'future.utils', 'numbers', 'inspect', 'ast', '_ast', 'dis', 'opcode', > '_opcode', 'future.builtins.misc', 'requests', 'urllib3', > 'urllib3.connectionpool', 'socket', '_socket', 'selectors', 'select', > 'urllib3.exceptions', 'urllib3.packages', 'urllib3.packages.ssl_match_hostname', > 'ssl', 'ipaddress', 'textwrap', '_ssl', 'urllib3.packages.six', > 'urllib3.packages.six.moves', 'http', 'http.client', 'email', > 'email.parser', 'email.feedparser', 'email.errors', 'email._policybase', > 'email.header', 'email.quoprimime', 'email.base64mime', 'email.charset', > 'email.encoders', 'quopri', 'email.utils', 'random', 'hashlib', '_hashlib', > '_blake2', '_sha3', 'bisect', '_bisect', '_random', 'urllib', > 'urllib.parse', 'email._parseaddr', 'calendar', 'email.message', 'uu', > 'email._encoded_words', 'email.iterators', 'urllib3.packages.six.moves.http_client', > 'queue', 'urllib3.connection', 'urllib3.util', 'urllib3.util.connection', > 'urllib3.util.wait', 'urllib3.util.selectors', 'urllib3.util.request', > 'urllib3.util.response', 'urllib3.util.ssl_', 'hmac', > 'urllib3.util.timeout', 'urllib3.util.retry', 'urllib3.util.url', > 'urllib3._collections', 'urllib3.request', 'urllib3.filepost', 'uuid', > 'ctypes', '_ctypes', 'ctypes._endian', 'ctypes.util', 'shutil', 'fnmatch', > 'zlib', 'bz2', '_compression', '_bz2', 'lzma', '_lzma', 'pwd', 'grp', > 'subprocess', 'signal', '_posixsubprocess', 'ctypes.macholib', > 'ctypes.macholib.dyld', 'ctypes.macholib.framework', > 'ctypes.macholib.dylib', 'urllib3.fields', 'mimetypes', > 'urllib3.packages.six.moves.urllib', 'urllib3.packages.six.moves.urllib.parse', > 'urllib3.response', 'urllib3.poolmanager', 'chardet', 'chardet.compat', > 'chardet.universaldetector', 'chardet.charsetgroupprober', 'chardet.enums', > 'chardet.charsetprober', 'chardet.escprober', 'chardet.codingstatemachine', > 'chardet.escsm', 'chardet.latin1prober', 'chardet.mbcsgroupprober', > 'chardet.utf8prober', 'chardet.mbcssm', 'chardet.sjisprober', > 'chardet.mbcharsetprober', 'chardet.chardistribution', 'chardet.euctwfreq', > 'chardet.euckrfreq', 'chardet.gb2312freq', 'chardet.big5freq', > 'chardet.jisfreq', 'chardet.jpcntx', 'chardet.eucjpprober', > 'chardet.gb2312prober', 'chardet.euckrprober', 'chardet.cp949prober', > 'chardet.big5prober', 'chardet.euctwprober', 'chardet.sbcsgroupprober', > 'chardet.sbcharsetprober', 'chardet.langcyrillicmodel', > 'chardet.langgreekmodel', 'chardet.langbulgarianmodel', > 'chardet.langthaimodel', 'chardet.langhebrewmodel', 'chardet.hebrewprober', > 'chardet.langturkishmodel', 'chardet.version', 'requests.exceptions', > 'urllib3.contrib', 'urllib3.contrib.pyopenssl', 'OpenSSL', > 'OpenSSL.crypto', 'six', 'cryptography', 'cryptography.__about__', > 'cryptography.x509', 'cryptography.x509.certificate_transparency', > 'cryptography.x509.base', 'cryptography.utils', 'cryptography.hazmat', > 'cryptography.hazmat.primitives', 'cryptography.hazmat.primitives.asymmetric', > 'cryptography.hazmat.primitives.asymmetric.dsa', 'cryptography.hazmat. > primitives.asymmetric.ec', 'cryptography.hazmat.primitives.asymmetric.rsa', > 'cryptography.exceptions', 'cryptography.hazmat.backends', > 'cryptography.hazmat.backends.interfaces', 'cryptography.x509.extensions', > 'asn1crypto', 'asn1crypto.version', 'asn1crypto.keys', > 'asn1crypto._elliptic_curve', 'asn1crypto._int', 'platform', > 'asn1crypto.util', 'asn1crypto._errors', 'asn1crypto._iri', > 'encodings.idna', 'stringprep', 'unicodedata', 'asn1crypto._types', > 'asn1crypto._ordereddict', 'asn1crypto._ffi', 'asn1crypto._perf', > 'asn1crypto._perf._big_num_ctypes', 'asn1crypto.algos', > 'asn1crypto.core', 'asn1crypto._teletex_codec', 'asn1crypto.parser', > 'cryptography.hazmat.primitives.constant_time', > 'cryptography.hazmat.bindings', '_cffi_backend', '_constant_time.lib', > '_constant_time', 'cryptography.hazmat.bindings._constant_time', > 'cryptography.hazmat.primitives.serialization', > 'cryptography.x509.general_name', 'idna', 'idna.package_data', > 'idna.core', 'idna.idnadata', 'idna.intranges', 'six.moves', ' > cryptography.x509.name', 'cryptography.x509.oid', 'cryptography.hazmat.primitives.hashes', > 'OpenSSL._util', 'cryptography.hazmat.bindings.openssl', > 'cryptography.hazmat.bindings.openssl.binding', '_openssl.lib', > '_openssl', 'cryptography.hazmat.bindings._openssl', > 'cryptography.hazmat.bindings.openssl._conditional', 'OpenSSL.SSL', > 'OpenSSL.version', 'cryptography.hazmat.backends.openssl', > 'cryptography.hazmat.backends.openssl.backend', > 'cryptography.hazmat.backends.openssl.aead', > 'cryptography.hazmat.backends.openssl.ciphers', 'cryptography.hazmat.primitives.ciphers', > 'cryptography.hazmat.primitives.ciphers.base', 'cryptography.hazmat.primitives.ciphers.modes', > 'cryptography.hazmat.backends.openssl.cmac', 'cryptography.hazmat.primitives.mac', > 'cryptography.hazmat.backends.openssl.decode_asn1', > 'cryptography.hazmat.backends.openssl.dh', 'cryptography.hazmat.primitives.asymmetric.dh', > 'cryptography.hazmat.backends.openssl.dsa', 'cryptography.hazmat.backends.openssl.utils', > 'cryptography.hazmat.primitives.asymmetric.utils', ' > cryptography.hazmat.backends.openssl.ec', 'cryptography.hazmat.backends.openssl.encode_asn1', > 'cryptography.hazmat.backends.openssl.hashes', > 'cryptography.hazmat.backends.openssl.hmac', > 'cryptography.hazmat.backends.openssl.rsa', 'cryptography.hazmat. > primitives.asymmetric.padding', 'cryptography.hazmat.backends.openssl.x25519', > 'cryptography.hazmat.primitives.asymmetric.x25519', > 'cryptography.hazmat.backends.openssl.x509', 'cryptography.hazmat. > primitives.ciphers.algorithms', 'cryptography.hazmat.primitives.kdf', > 'cryptography.hazmat.primitives.kdf.scrypt', > 'urllib3.packages.backports', 'urllib3.packages.backports.makefile', > 'requests.__version__', 'requests.utils', 'cgi', 'html', 'html.entities', > 'tempfile', 'requests.certs', 'certifi', 'certifi.core', > 'requests._internal_utils', 'requests.compat', 'json', 'json.decoder', > 'json.scanner', '_json', 'json.encoder', 'urllib.request', 'urllib.error', > 'urllib.response', '_scproxy', 'http.cookiejar', 'http.cookies', > 'requests.cookies', 'requests.structures', 'requests.packages', > 'requests.packages.urllib3', 'requests.packages.urllib3.connectionpool', > 'requests.packages.urllib3.exceptions', 'requests.packages.urllib3.packages', > 'requests.packages.urllib3.packages.ssl_match_hostname', > 'requests.packages.urllib3.packages.six', 'requests.packages.urllib3.packages.six.moves', > 'requests.packages.urllib3.packages.six.moves.http_client', > 'requests.packages.urllib3.connection', 'requests.packages.urllib3.util', > 'requests.packages.urllib3.util.connection', 'requests.packages.urllib3.util.wait', > 'requests.packages.urllib3.util.selectors', 'requests.packages.urllib3.util.request', > 'requests.packages.urllib3.util.response', 'requests.packages.urllib3.util.ssl_', > 'requests.packages.urllib3.util.timeout', 'requests.packages.urllib3.util.retry', > 'requests.packages.urllib3.util.url', 'requests.packages.urllib3._collections', > 'requests.packages.urllib3.request', 'requests.packages.urllib3.filepost', > 'requests.packages.urllib3.fields', 'requests.packages.urllib3.packages.six.moves.urllib', > 'requests.packages.urllib3.packages.six.moves.urllib.parse', > 'requests.packages.urllib3.response', 'requests.packages.urllib3.poolmanager', > 'requests.packages.urllib3.contrib', 'requests.packages.urllib3.contrib.pyopenssl', > 'requests.packages.urllib3.packages.backports', > 'requests.packages.urllib3.packages.backports.makefile', > 'requests.packages.idna', 'requests.packages.idna.package_data', > 'requests.packages.idna.core', 'requests.packages.idna.idnadata', > 'requests.packages.idna.intranges', 'requests.packages.chardet', > 'requests.packages.chardet.compat', 'requests.packages.chardet.universaldetector', > 'requests.packages.chardet.charsetgroupprober', > 'requests.packages.chardet.enums', 'requests.packages.chardet.charsetprober', > 'requests.packages.chardet.escprober', 'requests.packages.chardet.codingstatemachine', > 'requests.packages.chardet.escsm', 'requests.packages.chardet.latin1prober', > 'requests.packages.chardet.mbcsgroupprober', 'requests.packages.chardet.utf8prober', > 'requests.packages.chardet.mbcssm', 'requests.packages.chardet.sjisprober', > 'requests.packages.chardet.mbcharsetprober', 'requests.packages.chardet.chardistribution', > 'requests.packages.chardet.euctwfreq', 'requests.packages.chardet.euckrfreq', > 'requests.packages.chardet.gb2312freq', 'requests.packages.chardet.big5freq', > 'requests.packages.chardet.jisfreq', 'requests.packages.chardet.jpcntx', > 'requests.packages.chardet.eucjpprober', 'requests.packages.chardet.gb2312prober', > 'requests.packages.chardet.euckrprober', 'requests.packages.chardet.cp949prober', > 'requests.packages.chardet.big5prober', 'requests.packages.chardet.euctwprober', > 'requests.packages.chardet.sbcsgroupprober', 'requests.packages.chardet.sbcharsetprober', > 'requests.packages.chardet.langcyrillicmodel', 'requests.packages.chardet.langgreekmodel', > 'requests.packages.chardet.langbulgarianmodel', > 'requests.packages.chardet.langthaimodel', 'requests.packages.chardet.langhebrewmodel', > 'requests.packages.chardet.hebrewprober', 'requests.packages.chardet.langturkishmodel', > 'requests.packages.chardet.version', 'requests.models', 'requests.hooks', > 'requests.auth', 'requests.status_codes', 'requests.api', > 'requests.sessions', 'requests.adapters', 'urllib3.contrib.socks', 'socks', > 'obspy.core', 'obspy.core.utcdatetime', 'obspy.core.util', > 'obspy.core.util.attribdict', 'obspy.core.util.base', 'doctest', > 'argparse', 'difflib', 'pdb', 'cmd', 'bdb', 'code', 'codeop', 'glob', > 'pprint', 'unittest', 'unittest.result', 'unittest.util', 'unittest.case', > 'unittest.suite', 'unittest.loader', 'unittest.main', 'unittest.runner', > 'unittest.signals', 'numpy', 'numpy._globals', 'numpy.__config__', > 'numpy.version', 'numpy._import_tools', 'numpy.add_newdocs', 'numpy.lib', ' > numpy.lib.info', 'numpy.lib.type_check', 'numpy.core', 'numpy.core.info', > 'numpy.core.multiarray', 'numpy.core.umath', 'numpy.core._internal', > 'numpy.compat', 'numpy.compat._inspect', 'numpy.compat.py3k', 'pathlib', > 'ntpath', 'numpy.core.numerictypes', 'numpy.core.numeric', 'pickle', > '_compat_pickle', '_pickle', 'numpy.core.fromnumeric', > 'numpy.core._methods', 'numpy.core.arrayprint', 'numpy.core.defchararray', > 'numpy.core.records', 'numpy.core.memmap', 'numpy.core.function_base', > 'numpy.core.machar', 'numpy.core.getlimits', 'numpy.core.shape_base', > 'numpy.core.einsumfunc', 'numpy.testing', 'numpy.testing.decorators', > 'numpy.testing.nose_tools', 'numpy.testing.nose_tools.decorators', > 'numpy.testing.nose_tools.utils', 'numpy.lib.utils', > 'numpy.testing.nosetester', 'numpy.testing.nose_tools.nosetester', > 'numpy.testing.utils', 'numpy.lib.ufunclike', 'numpy.lib.index_tricks', > 'numpy.lib.function_base', 'numpy.lib.twodim_base', 'numpy.matrixlib', > 'numpy.matrixlib.defmatrix', 'numpy.lib.stride_tricks', 'numpy.lib.mixins', > 'numpy.lib.nanfunctions', 'numpy.lib.shape_base', 'numpy.lib.scimath', > 'numpy.lib.polynomial', 'numpy.linalg', 'numpy.linalg.info', > 'numpy.linalg.linalg', 'numpy.linalg.lapack_lite', > 'numpy.linalg._umath_linalg', 'numpy.lib.arraysetops', 'numpy.lib.npyio', > 'numpy.lib.format', 'numpy.lib._datasource', 'numpy.lib._iotools', > 'numpy.lib.financial', 'decimal', '_decimal', 'numpy.lib.arrayterator', > 'numpy.lib.arraypad', 'numpy.lib._version', 'numpy._distributor_init', > 'numpy._mklinit', 'numpy.fft', 'numpy.fft.info', 'numpy.fft.fftpack', > 'numpy.fft.fftpack_lite', 'numpy.fft.helper', 'numpy.polynomial', > 'numpy.polynomial.polynomial', 'numpy.polynomial.polyutils', > 'numpy.polynomial._polybase', 'numpy.polynomial.chebyshev', > 'numpy.polynomial.legendre', 'numpy.polynomial.hermite', > 'numpy.polynomial.hermite_e', 'numpy.polynomial.laguerre', 'numpy.random', ' > numpy.random.info', 'cython_runtime', 'mtrand', 'numpy.random.mtrand', > 'numpy.ctypeslib', 'numpy.ma', 'numpy.ma.core', 'numpy.ma.extras', > 'pkg_resources', 'zipfile', 'pkgutil', 'plistlib', 'xml', 'xml.parsers', > 'xml.parsers.expat', 'pyexpat.errors', 'pyexpat.model', 'pyexpat', > 'xml.parsers.expat.model', 'xml.parsers.expat.errors', > 'pkg_resources.extern', 'pkg_resources._vendor', > 'pkg_resources.extern.six', 'pkg_resources._vendor.six', > 'pkg_resources.extern.six.moves', 'pkg_resources._vendor.six.moves', > 'pkg_resources.py31compat', 'pkg_resources.extern.appdirs', > 'pkg_resources._vendor.packaging.__about__', 'pkg_resources.extern.packaging', > 'pkg_resources.extern.packaging.version', 'pkg_resources.extern.packaging._structures', > 'pkg_resources.extern.packaging.specifiers', 'pkg_resources.extern.packaging._compat', > 'pkg_resources.extern.packaging.requirements', 'pkg_resources.extern.pyparsing', > 'pkg_resources.extern.six.moves.urllib', 'pkg_resources.extern.packaging.markers', > 'obspy.core.util.misc', 'obspy.core.util.obspy_types', > 'obspy.core.util.testing', 'distutils', 'distutils.version', 'lxml', > '_cython_0_28', 'lxml.etree', 'lxml._elementpath', 'gzip', > 'obspy.core.util.version', 'obspy.core.trace', 'decorator', > 'obspy.core.compatibility', 'unittest.mock', 'configparser', > 'obspy.core.util.decorator', 'tarfile', 'obspy.core.util.deprecation_helpers', > 'obspy.core.stream', 'obspy.scripts', 'obspy.scripts.runtests', > 'obspy.core.event', 'obspy.core.event.base', 'obspy.core.event.header', > 'obspy.core.event.catalog', 'obspy.imaging', 'obspy.imaging.cm', > 'matplotlib', 'distutils.sysconfig', 'distutils.errors', > 'matplotlib.cbook', 'matplotlib.cbook.deprecation', > 'matplotlib.cbook._backports', 'matplotlib.compat', > 'matplotlib.compat.subprocess', 'matplotlib.rcsetup', > 'matplotlib.testing', 'matplotlib.fontconfig_pattern', 'pyparsing', > 'matplotlib.colors', 'matplotlib._color_data', 'cycler', > 'six.moves.urllib', 'six.moves.urllib.request', 'matplotlib._version', > 'dateutil', 'dateutil._version'] > > [ DEBUG] CACHEDIR=/Users/mth/.matplotlib > > [ DEBUG] Using fontManager instance from /Users/mth/.matplotlib/ > fontList.json > > > > _______________________________________________ > > 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 jklymak at uvic.ca Tue Mar 20 19:36:59 2018 From: jklymak at uvic.ca (Jody Klymak) Date: Tue, 20 Mar 2018 16:36:59 -0700 Subject: [Matplotlib-users] How to turn off matplotlib DEBUG msgs In-Reply-To: References: <1F60758E-4952-467B-A42B-7660E6667A00@uvic.ca> Message-ID: <6B1A1DE4-159E-48C7-A078-EC2734055DDC@uvic.ca> > On 20 Mar 2018, at 15:09, Mike Hagerty wrote: > > Thanks, that seems to work. > > I was already getting the logger and setting the root logLevel - I thought that would > be passed through but I guess matplotlib is configured earlier in the process. Matplotlib does NOT set the logging level. So if nothing else sets the logging level, it will be the logging-module-default (logging.WARNING). If it is being set to DEBUG, then something else you are importing is setting the default logging level; it shouldn?t. Cheers, Jody > Cheers, > -Mike > > On Tue, Mar 20, 2018 at 5:37 PM, Jody Klymak > wrote: > > matplotlib now uses the standard python logging library. You should ask `obspy` if they are setting the default debug level for other packages. > > But for now, something like the following in your script should quiet matplotlib down. > > > ``` > import logging > mpl_logger = logging.getLogger(?matplotlib?) > mpl_logger.setLevel(logging.WARNING) > > ``` > > https://matplotlib.org/faq/troubleshooting_faq.html > https://docs.python.org/3/library/logging.html#module-logging > > > Cheers, Jody > > > On 20 Mar 2018, at 14:21, Mike Hagerty > wrote: > > > > I recently installed the latest version of matplotlib via conda: > > # packages in environment: > > matplotlib 2.2.2 py27_0 conda-forge > > > > Now, as soon as matplotlib is imported by another module, it generates a ton of DEBUG messages (see below). > > > > How do I turn these off ?? > > > > Oddly, if I use the interactive python and import matplotlib directly, I don't get the messages, so it > > has something to do with how the code I'm using (obspy) imports the matplotlib module. > > > > I'm using mac osx 10.10.5 and I get similar results with python2.7 and python3.6 (conda) environments. > > > > Any advice would be appreciated. > > > > Cheers! > > -Mike > > > > > > > > > > >>> from obspy.taup import TauPyModel > > [ DEBUG] $HOME=/Users/mth > > [ DEBUG] matplotlib data path /usr/local/anaconda/envs/obspy_3.6/lib/python3.6/site-packages/matplotlib/mpl-data > > [ DEBUG] loaded rc file /usr/local/anaconda/envs/obspy_3.6/lib/python3.6/site-packages/matplotlib/mpl-data/matplotlibrc > > [ DEBUG] matplotlib version 2.2.2 > > [ DEBUG] interactive is False > > [ DEBUG] platform is darwin > > [ DEBUG] loaded modules: ['builtins', 'sys', '_frozen_importlib', '_imp', '_warnings', '_thread', '_weakref', '_frozen_importlib_external', '_io', 'marshal', 'posix', 'zipimport', 'encodings', 'codecs', '_codecs', 'encodings.aliases', 'encodings.utf_8', '_signal', '__main__', 'encodings.latin_1', 'io', 'abc', '_weakrefset', 'site', 'os', 'errno', 'stat', '_stat', 'posixpath', 'genericpath', 'os.path', '_collections_abc', '_sitebuiltins', 'sysconfig', '_sysconfigdata_m_darwin_darwin', '_osx_support', 're', 'enum', 'types', 'functools', '_functools', 'collections', 'operator', '_operator', 'keyword', 'heapq', '_heapq', 'itertools', 'reprlib', '_collections', 'weakref', 'collections.abc', 'sre_compile', '_sre', 'sre_parse', 'sre_constants', '_locale', 'copyreg', '_bootlocale', 'importlib', 'importlib._bootstrap', 'importlib._bootstrap_external', 'warnings', 'importlib.util', 'importlib.abc', 'importlib.machinery', 'contextlib', 'mpl_toolkits', 'encodings.cp437', 'readline', 'atexit', 'rlcompleter', 'logging', 'time', 'traceback', 'linecache', 'tokenize', 'token', 'string', '_string', 'threading', 'lib', 'lib.libyaml', 'yaml', 'yaml.error', 'yaml.tokens', 'yaml.events', 'yaml.nodes', 'yaml.loader', 'yaml.reader', 'yaml.scanner', 'yaml.parser', 'yaml.composer', 'yaml.constructor', 'datetime', 'math', '_datetime', 'base64', 'struct', '_struct', 'binascii', 'yaml.resolver', 'yaml.dumper', 'yaml.emitter', 'yaml.serializer', 'yaml.representer', 'yaml.cyaml', '_yaml', 'lib.liblog', 'lib.process_cmd', 'getopt', 'gettext', 'locale', 'copy', 'obspy', '__future__', 'future', 'future.builtins', 'future.builtins.iterators', 'future.utils', 'numbers', 'inspect', 'ast', '_ast', 'dis', 'opcode', '_opcode', 'future.builtins.misc', 'requests', 'urllib3', 'urllib3.connectionpool', 'socket', '_socket', 'selectors', 'select', 'urllib3.exceptions', 'urllib3.packages', 'urllib3.packages.ssl_match_hostname', 'ssl', 'ipaddress', 'textwrap', '_ssl', 'urllib3.packages.six', 'urllib3.packages.six.moves', 'http', 'http.client', 'email', 'email.parser', 'email.feedparser', 'email.errors', 'email._policybase', 'email.header', 'email.quoprimime', 'email.base64mime', 'email.charset', 'email.encoders', 'quopri', 'email.utils', 'random', 'hashlib', '_hashlib', '_blake2', '_sha3', 'bisect', '_bisect', '_random', 'urllib', 'urllib.parse', 'email._parseaddr', 'calendar', 'email.message', 'uu', 'email._encoded_words', 'email.iterators', 'urllib3.packages.six.moves.http_client', 'queue', 'urllib3.connection', 'urllib3.util', 'urllib3.util.connection', 'urllib3.util.wait', 'urllib3.util.selectors', 'urllib3.util.request', 'urllib3.util.response', 'urllib3.util.ssl_', 'hmac', 'urllib3.util.timeout', 'urllib3.util.retry', 'urllib3.util.url', 'urllib3._collections', 'urllib3.request', 'urllib3.filepost', 'uuid', 'ctypes', '_ctypes', 'ctypes._endian', 'ctypes.util', 'shutil', 'fnmatch', 'zlib', 'bz2', '_compression', '_bz2', 'lzma', '_lzma', 'pwd', 'grp', 'subprocess', 'signal', '_posixsubprocess', 'ctypes.macholib', 'ctypes.macholib.dyld', 'ctypes.macholib.framework', 'ctypes.macholib.dylib', 'urllib3.fields', 'mimetypes', 'urllib3.packages.six.moves.urllib', 'urllib3.packages.six.moves.urllib.parse', 'urllib3.response', 'urllib3.poolmanager', 'chardet', 'chardet.compat', 'chardet.universaldetector', 'chardet.charsetgroupprober', 'chardet.enums', 'chardet.charsetprober', 'chardet.escprober', 'chardet.codingstatemachine', 'chardet.escsm', 'chardet.latin1prober', 'chardet.mbcsgroupprober', 'chardet.utf8prober', 'chardet.mbcssm', 'chardet.sjisprober', 'chardet.mbcharsetprober', 'chardet.chardistribution', 'chardet.euctwfreq', 'chardet.euckrfreq', 'chardet.gb2312freq', 'chardet.big5freq', 'chardet.jisfreq', 'chardet.jpcntx', 'chardet.eucjpprober', 'chardet.gb2312prober', 'chardet.euckrprober', 'chardet.cp949prober', 'chardet.big5prober', 'chardet.euctwprober', 'chardet.sbcsgroupprober', 'chardet.sbcharsetprober', 'chardet.langcyrillicmodel', 'chardet.langgreekmodel', 'chardet.langbulgarianmodel', 'chardet.langthaimodel', 'chardet.langhebrewmodel', 'chardet.hebrewprober', 'chardet.langturkishmodel', 'chardet.version', 'requests.exceptions', 'urllib3.contrib', 'urllib3.contrib.pyopenssl', 'OpenSSL', 'OpenSSL.crypto', 'six', 'cryptography', 'cryptography.__about__', 'cryptography.x509', 'cryptography.x509.certificate_transparency', 'cryptography.x509.base', 'cryptography.utils', 'cryptography.hazmat', 'cryptography.hazmat.primitives', 'cryptography.hazmat.primitives.asymmetric', 'cryptography.hazmat.primitives.asymmetric.dsa', 'cryptography.hazmat.primitives.asymmetric.ec ', 'cryptography.hazmat.primitives.asymmetric.rsa', 'cryptography.exceptions', 'cryptography.hazmat.backends', 'cryptography.hazmat.backends.interfaces', 'cryptography.x509.extensions', 'asn1crypto', 'asn1crypto.version', 'asn1crypto.keys', 'asn1crypto._elliptic_curve', 'asn1crypto._int', 'platform', 'asn1crypto.util', 'asn1crypto._errors', 'asn1crypto._iri', 'encodings.idna', 'stringprep', 'unicodedata', 'asn1crypto._types', 'asn1crypto._ordereddict', 'asn1crypto._ffi', 'asn1crypto._perf', 'asn1crypto._perf._big_num_ctypes', 'asn1crypto.algos', 'asn1crypto.core', 'asn1crypto._teletex_codec', 'asn1crypto.parser', 'cryptography.hazmat.primitives.constant_time', 'cryptography.hazmat.bindings', '_cffi_backend', '_constant_time.lib', '_constant_time', 'cryptography.hazmat.bindings._constant_time', 'cryptography.hazmat.primitives.serialization', 'cryptography.x509.general_name', 'idna', 'idna.package_data', 'idna.core', 'idna.idnadata', 'idna.intranges', 'six.moves', 'cryptography.x509.name ', 'cryptography.x509.oid', 'cryptography.hazmat.primitives.hashes', 'OpenSSL._util', 'cryptography.hazmat.bindings.openssl', 'cryptography.hazmat.bindings.openssl.binding', '_openssl.lib', '_openssl', 'cryptography.hazmat.bindings._openssl', 'cryptography.hazmat.bindings.openssl._conditional', 'OpenSSL.SSL', 'OpenSSL.version', 'cryptography.hazmat.backends.openssl', 'cryptography.hazmat.backends.openssl.backend', 'cryptography.hazmat.backends.openssl.aead', 'cryptography.hazmat.backends.openssl.ciphers', 'cryptography.hazmat.primitives.ciphers', 'cryptography.hazmat.primitives.ciphers.base', 'cryptography.hazmat.primitives.ciphers.modes', 'cryptography.hazmat.backends.openssl.cmac', 'cryptography.hazmat.primitives.mac', 'cryptography.hazmat.backends.openssl.decode_asn1', 'cryptography.hazmat.backends.openssl.dh', 'cryptography.hazmat.primitives.asymmetric.dh', 'cryptography.hazmat.backends.openssl.dsa', 'cryptography.hazmat.backends.openssl.utils', 'cryptography.hazmat.primitives.asymmetric.utils', 'cryptography.hazmat.backends.openssl.ec ', 'cryptography.hazmat.backends.openssl.encode_asn1', 'cryptography.hazmat.backends.openssl.hashes', 'cryptography.hazmat.backends.openssl.hmac', 'cryptography.hazmat.backends.openssl.rsa', 'cryptography.hazmat.primitives.asymmetric.padding', 'cryptography.hazmat.backends.openssl.x25519', 'cryptography.hazmat.primitives.asymmetric.x25519', 'cryptography.hazmat.backends.openssl.x509', 'cryptography.hazmat.primitives.ciphers.algorithms', 'cryptography.hazmat.primitives.kdf', 'cryptography.hazmat.primitives.kdf.scrypt', 'urllib3.packages.backports', 'urllib3.packages.backports.makefile', 'requests.__version__', 'requests.utils', 'cgi', 'html', 'html.entities', 'tempfile', 'requests.certs', 'certifi', 'certifi.core', 'requests._internal_utils', 'requests.compat', 'json', 'json.decoder', 'json.scanner', '_json', 'json.encoder', 'urllib.request', 'urllib.error', 'urllib.response', '_scproxy', 'http.cookiejar', 'http.cookies', 'requests.cookies', 'requests.structures', 'requests.packages', 'requests.packages.urllib3', 'requests.packages.urllib3.connectionpool', 'requests.packages.urllib3.exceptions', 'requests.packages.urllib3.packages', 'requests.packages.urllib3.packages.ssl_match_hostname', 'requests.packages.urllib3.packages.six', 'requests.packages.urllib3.packages.six.moves', 'requests.packages.urllib3.packages.six.moves.http_client', 'requests.packages.urllib3.connection', 'requests.packages.urllib3.util', 'requests.packages.urllib3.util.connection', 'requests.packages.urllib3.util.wait', 'requests.packages.urllib3.util.selectors', 'requests.packages.urllib3.util.request', 'requests.packages.urllib3.util.response', 'requests.packages.urllib3.util.ssl_', 'requests.packages.urllib3.util.timeout', 'requests.packages.urllib3.util.retry', 'requests.packages.urllib3.util.url', 'requests.packages.urllib3._collections', 'requests.packages.urllib3.request', 'requests.packages.urllib3.filepost', 'requests.packages.urllib3.fields', 'requests.packages.urllib3.packages.six.moves.urllib', 'requests.packages.urllib3.packages.six.moves.urllib.parse', 'requests.packages.urllib3.response', 'requests.packages.urllib3.poolmanager', 'requests.packages.urllib3.contrib', 'requests.packages.urllib3.contrib.pyopenssl', 'requests.packages.urllib3.packages.backports', 'requests.packages.urllib3.packages.backports.makefile', 'requests.packages.idna', 'requests.packages.idna.package_data', 'requests.packages.idna.core', 'requests.packages.idna.idnadata', 'requests.packages.idna.intranges', 'requests.packages.chardet', 'requests.packages.chardet.compat', 'requests.packages.chardet.universaldetector', 'requests.packages.chardet.charsetgroupprober', 'requests.packages.chardet.enums', 'requests.packages.chardet.charsetprober', 'requests.packages.chardet.escprober', 'requests.packages.chardet.codingstatemachine', 'requests.packages.chardet.escsm', 'requests.packages.chardet.latin1prober', 'requests.packages.chardet.mbcsgroupprober', 'requests.packages.chardet.utf8prober', 'requests.packages.chardet.mbcssm', 'requests.packages.chardet.sjisprober', 'requests.packages.chardet.mbcharsetprober', 'requests.packages.chardet.chardistribution', 'requests.packages.chardet.euctwfreq', 'requests.packages.chardet.euckrfreq', 'requests.packages.chardet.gb2312freq', 'requests.packages.chardet.big5freq', 'requests.packages.chardet.jisfreq', 'requests.packages.chardet.jpcntx', 'requests.packages.chardet.eucjpprober', 'requests.packages.chardet.gb2312prober', 'requests.packages.chardet.euckrprober', 'requests.packages.chardet.cp949prober', 'requests.packages.chardet.big5prober', 'requests.packages.chardet.euctwprober', 'requests.packages.chardet.sbcsgroupprober', 'requests.packages.chardet.sbcharsetprober', 'requests.packages.chardet.langcyrillicmodel', 'requests.packages.chardet.langgreekmodel', 'requests.packages.chardet.langbulgarianmodel', 'requests.packages.chardet.langthaimodel', 'requests.packages.chardet.langhebrewmodel', 'requests.packages.chardet.hebrewprober', 'requests.packages.chardet.langturkishmodel', 'requests.packages.chardet.version', 'requests.models', 'requests.hooks', 'requests.auth', 'requests.status_codes', 'requests.api', 'requests.sessions', 'requests.adapters', 'urllib3.contrib.socks', 'socks', 'obspy.core', 'obspy.core.utcdatetime', 'obspy.core.util', 'obspy.core.util.attribdict', 'obspy.core.util.base', 'doctest', 'argparse', 'difflib', 'pdb', 'cmd', 'bdb', 'code', 'codeop', 'glob', 'pprint', 'unittest', 'unittest.result', 'unittest.util', 'unittest.case', 'unittest.suite', 'unittest.loader', 'unittest.main', 'unittest.runner', 'unittest.signals', 'numpy', 'numpy._globals', 'numpy.__config__', 'numpy.version', 'numpy._import_tools', 'numpy.add_newdocs', 'numpy.lib', 'numpy.lib.info ', 'numpy.lib.type_check', 'numpy.core', 'numpy.core.info ', 'numpy.core.multiarray', 'numpy.core.umath', 'numpy.core._internal', 'numpy.compat', 'numpy.compat._inspect', 'numpy.compat.py3k', 'pathlib', 'ntpath', 'numpy.core.numerictypes', 'numpy.core.numeric', 'pickle', '_compat_pickle', '_pickle', 'numpy.core.fromnumeric', 'numpy.core._methods', 'numpy.core.arrayprint', 'numpy.core.defchararray', 'numpy.core.records', 'numpy.core.memmap', 'numpy.core.function_base', 'numpy.core.machar', 'numpy.core.getlimits', 'numpy.core.shape_base', 'numpy.core.einsumfunc', 'numpy.testing', 'numpy.testing.decorators', 'numpy.testing.nose_tools', 'numpy.testing.nose_tools.decorators', 'numpy.testing.nose_tools.utils', 'numpy.lib.utils', 'numpy.testing.nosetester', 'numpy.testing.nose_tools.nosetester', 'numpy.testing.utils', 'numpy.lib.ufunclike', 'numpy.lib.index_tricks', 'numpy.lib.function_base', 'numpy.lib.twodim_base', 'numpy.matrixlib', 'numpy.matrixlib.defmatrix', 'numpy.lib.stride_tricks', 'numpy.lib.mixins', 'numpy.lib.nanfunctions', 'numpy.lib.shape_base', 'numpy.lib.scimath', 'numpy.lib.polynomial', 'numpy.linalg', 'numpy.linalg.info ', 'numpy.linalg.linalg', 'numpy.linalg.lapack_lite', 'numpy.linalg._umath_linalg', 'numpy.lib.arraysetops', 'numpy.lib.npyio', 'numpy.lib.format', 'numpy.lib._datasource', 'numpy.lib._iotools', 'numpy.lib.financial', 'decimal', '_decimal', 'numpy.lib.arrayterator', 'numpy.lib.arraypad', 'numpy.lib._version', 'numpy._distributor_init', 'numpy._mklinit', 'numpy.fft', 'numpy.fft.info ', 'numpy.fft.fftpack', 'numpy.fft.fftpack_lite', 'numpy.fft.helper', 'numpy.polynomial', 'numpy.polynomial.polynomial', 'numpy.polynomial.polyutils', 'numpy.polynomial._polybase', 'numpy.polynomial.chebyshev', 'numpy.polynomial.legendre', 'numpy.polynomial.hermite', 'numpy.polynomial.hermite_e', 'numpy.polynomial.laguerre', 'numpy.random', 'numpy.random.info ', 'cython_runtime', 'mtrand', 'numpy.random.mtrand', 'numpy.ctypeslib', 'numpy.ma ', 'numpy.ma.core', 'numpy.ma.extras', 'pkg_resources', 'zipfile', 'pkgutil', 'plistlib', 'xml', 'xml.parsers', 'xml.parsers.expat', 'pyexpat.errors', 'pyexpat.model', 'pyexpat', 'xml.parsers.expat.model', 'xml.parsers.expat.errors', 'pkg_resources.extern', 'pkg_resources._vendor', 'pkg_resources.extern.six', 'pkg_resources._vendor.six', 'pkg_resources.extern.six.moves', 'pkg_resources._vendor.six.moves', 'pkg_resources.py31compat', 'pkg_resources.extern.appdirs', 'pkg_resources._vendor.packaging.__about__', 'pkg_resources.extern.packaging', 'pkg_resources.extern.packaging.version', 'pkg_resources.extern.packaging._structures', 'pkg_resources.extern.packaging.specifiers', 'pkg_resources.extern.packaging._compat', 'pkg_resources.extern.packaging.requirements', 'pkg_resources.extern.pyparsing', 'pkg_resources.extern.six.moves.urllib', 'pkg_resources.extern.packaging.markers', 'obspy.core.util.misc', 'obspy.core.util.obspy_types', 'obspy.core.util.testing', 'distutils', 'distutils.version', 'lxml', '_cython_0_28', 'lxml.etree', 'lxml._elementpath', 'gzip', 'obspy.core.util.version', 'obspy.core.trace', 'decorator', 'obspy.core.compatibility', 'unittest.mock', 'configparser', 'obspy.core.util.decorator', 'tarfile', 'obspy.core.util.deprecation_helpers', 'obspy.core.stream', 'obspy.scripts', 'obspy.scripts.runtests', 'obspy.core.event', 'obspy.core.event.base', 'obspy.core.event.header', 'obspy.core.event.catalog', 'obspy.imaging', 'obspy.imaging.cm ', 'matplotlib', 'distutils.sysconfig', 'distutils.errors', 'matplotlib.cbook', 'matplotlib.cbook.deprecation', 'matplotlib.cbook._backports', 'matplotlib.compat', 'matplotlib.compat.subprocess', 'matplotlib.rcsetup', 'matplotlib.testing', 'matplotlib.fontconfig_pattern', 'pyparsing', 'matplotlib.colors', 'matplotlib._color_data', 'cycler', 'six.moves.urllib', 'six.moves.urllib.request', 'matplotlib._version', 'dateutil', 'dateutil._version'] > > [ DEBUG] CACHEDIR=/Users/mth/.matplotlib > > [ DEBUG] Using fontManager instance from /Users/mth/.matplotlib/fontList.json > > > > _______________________________________________ > > Matplotlib-users mailing list > > Matplotlib-users at python.org > > https://mail.python.org/mailman/listinfo/matplotlib-users > > -- > Jody Klymak > http://web.uvic.ca/~jklymak/ > > > > > > -- Jody Klymak http://web.uvic.ca/~jklymak/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From m.hagerty at isti.com Tue Mar 20 20:35:16 2018 From: m.hagerty at isti.com (Mike Hagerty) Date: Tue, 20 Mar 2018 20:35:16 -0400 Subject: [Matplotlib-users] How to turn off matplotlib DEBUG msgs In-Reply-To: <6B1A1DE4-159E-48C7-A078-EC2734055DDC@uvic.ca> References: <1F60758E-4952-467B-A42B-7660E6667A00@uvic.ca> <6B1A1DE4-159E-48C7-A078-EC2734055DDC@uvic.ca> Message-ID: Looking at file: .../python2.7/site-packages/matplotlib/__init__.py I see the function _wrap() which seems to set the logLevel to DEBUG : def _wrap(fmt, func, level=logging.DEBUG, always=True): """ return a callable function that wraps func and reports its output through logger if always is True, the report will occur on every function call; otherwise only on the first time the function is called """ ... I'm not sure that obspy explicitly calls _wrap() on this module, but that would explain the behavior I see where if I import matplotlib directly I don't get the debug messages, but if I import any obspy module (which loads matplotlib), I get all the debug messages. If that's the case, then maybe obspy needs to set the logLevel higher when loading the module (e.g., override the default level=logging.DEBUG) ? Cheers, -Mike On Tue, Mar 20, 2018 at 7:36 PM, Jody Klymak wrote: > > On 20 Mar 2018, at 15:09, Mike Hagerty wrote: > > Thanks, that seems to work. > > I was already getting the logger and setting the root logLevel - I thought > that would > be passed through but I guess matplotlib is configured earlier in the > process. > > > Matplotlib does NOT set the logging level. So if nothing else sets the > logging level, it will be the logging-module-default (logging.WARNING). If > it is being set to DEBUG, then something else you are importing is setting > the default logging level; it shouldn?t. > > Cheers, Jody > > > > Cheers, > -Mike > > On Tue, Mar 20, 2018 at 5:37 PM, Jody Klymak wrote: > >> >> matplotlib now uses the standard python logging library. You should ask >> `obspy` if they are setting the default debug level for other packages. >> >> But for now, something like the following in your script should quiet >> matplotlib down. >> >> >> ``` >> import logging >> mpl_logger = logging.getLogger(?matplotlib?) >> mpl_logger.setLevel(logging.WARNING) >> >> ``` >> >> https://matplotlib.org/faq/troubleshooting_faq.html >> https://docs.python.org/3/library/logging.html#module-logging >> >> >> Cheers, Jody >> >> > On 20 Mar 2018, at 14:21, Mike Hagerty wrote: >> > >> > I recently installed the latest version of matplotlib via conda: >> > # packages in environment: >> > matplotlib 2.2.2 py27_0 conda-forge >> > >> > Now, as soon as matplotlib is imported by another module, it generates >> a ton of DEBUG messages (see below). >> > >> > How do I turn these off ?? >> > >> > Oddly, if I use the interactive python and import matplotlib directly, >> I don't get the messages, so it >> > has something to do with how the code I'm using (obspy) imports the >> matplotlib module. >> > >> > I'm using mac osx 10.10.5 and I get similar results with python2.7 and >> python3.6 (conda) environments. >> > >> > Any advice would be appreciated. >> > >> > Cheers! >> > -Mike >> > >> > >> > >> > >> > >>> from obspy.taup import TauPyModel >> > [ DEBUG] $HOME=/Users/mth >> > [ DEBUG] matplotlib data path /usr/local/anaconda/envs/obspy >> _3.6/lib/python3.6/site-packages/matplotlib/mpl-data >> > [ DEBUG] loaded rc file /usr/local/anaconda/envs/obspy >> _3.6/lib/python3.6/site-packages/matplotlib/mpl-data/matplotlibrc >> > [ DEBUG] matplotlib version 2.2.2 >> > [ DEBUG] interactive is False >> > [ DEBUG] platform is darwin >> > [ DEBUG] loaded modules: ['builtins', 'sys', '_frozen_importlib', >> '_imp', '_warnings', '_thread', '_weakref', '_frozen_importlib_external', >> '_io', 'marshal', 'posix', 'zipimport', 'encodings', 'codecs', '_codecs', >> 'encodings.aliases', 'encodings.utf_8', '_signal', '__main__', >> 'encodings.latin_1', 'io', 'abc', '_weakrefset', 'site', 'os', 'errno', >> 'stat', '_stat', 'posixpath', 'genericpath', 'os.path', '_collections_abc', >> '_sitebuiltins', 'sysconfig', '_sysconfigdata_m_darwin_darwin', >> '_osx_support', 're', 'enum', 'types', 'functools', '_functools', >> 'collections', 'operator', '_operator', 'keyword', 'heapq', '_heapq', >> 'itertools', 'reprlib', '_collections', 'weakref', 'collections.abc', >> 'sre_compile', '_sre', 'sre_parse', 'sre_constants', '_locale', 'copyreg', >> '_bootlocale', 'importlib', 'importlib._bootstrap', >> 'importlib._bootstrap_external', 'warnings', 'importlib.util', >> 'importlib.abc', 'importlib.machinery', 'contextlib', 'mpl_toolkits', >> 'encodings.cp437', 'readline', 'atexit', 'rlcompleter', 'logging', 'time', >> 'traceback', 'linecache', 'tokenize', 'token', 'string', '_string', >> 'threading', 'lib', 'lib.libyaml', 'yaml', 'yaml.error', 'yaml.tokens', >> 'yaml.events', 'yaml.nodes', 'yaml.loader', 'yaml.reader', 'yaml.scanner', >> 'yaml.parser', 'yaml.composer', 'yaml.constructor', 'datetime', 'math', >> '_datetime', 'base64', 'struct', '_struct', 'binascii', 'yaml.resolver', >> 'yaml.dumper', 'yaml.emitter', 'yaml.serializer', 'yaml.representer', >> 'yaml.cyaml', '_yaml', 'lib.liblog', 'lib.process_cmd', 'getopt', >> 'gettext', 'locale', 'copy', 'obspy', '__future__', 'future', >> 'future.builtins', 'future.builtins.iterators', 'future.utils', 'numbers', >> 'inspect', 'ast', '_ast', 'dis', 'opcode', '_opcode', >> 'future.builtins.misc', 'requests', 'urllib3', 'urllib3.connectionpool', >> 'socket', '_socket', 'selectors', 'select', 'urllib3.exceptions', >> 'urllib3.packages', 'urllib3.packages.ssl_match_hostname', 'ssl', >> 'ipaddress', 'textwrap', '_ssl', 'urllib3.packages.six', >> 'urllib3.packages.six.moves', 'http', 'http.client', 'email', >> 'email.parser', 'email.feedparser', 'email.errors', 'email._policybase', >> 'email.header', 'email.quoprimime', 'email.base64mime', 'email.charset', >> 'email.encoders', 'quopri', 'email.utils', 'random', 'hashlib', '_hashlib', >> '_blake2', '_sha3', 'bisect', '_bisect', '_random', 'urllib', >> 'urllib.parse', 'email._parseaddr', 'calendar', 'email.message', 'uu', >> 'email._encoded_words', 'email.iterators', 'urllib3.packages.six.moves.http_client', >> 'queue', 'urllib3.connection', 'urllib3.util', 'urllib3.util.connection', >> 'urllib3.util.wait', 'urllib3.util.selectors', 'urllib3.util.request', >> 'urllib3.util.response', 'urllib3.util.ssl_', 'hmac', >> 'urllib3.util.timeout', 'urllib3.util.retry', 'urllib3.util.url', >> 'urllib3._collections', 'urllib3.request', 'urllib3.filepost', 'uuid', >> 'ctypes', '_ctypes', 'ctypes._endian', 'ctypes.util', 'shutil', 'fnmatch', >> 'zlib', 'bz2', '_compression', '_bz2', 'lzma', '_lzma', 'pwd', 'grp', >> 'subprocess', 'signal', '_posixsubprocess', 'ctypes.macholib', >> 'ctypes.macholib.dyld', 'ctypes.macholib.framework', >> 'ctypes.macholib.dylib', 'urllib3.fields', 'mimetypes', >> 'urllib3.packages.six.moves.urllib', 'urllib3.packages.six.moves.urllib.parse', >> 'urllib3.response', 'urllib3.poolmanager', 'chardet', 'chardet.compat', >> 'chardet.universaldetector', 'chardet.charsetgroupprober', 'chardet.enums', >> 'chardet.charsetprober', 'chardet.escprober', 'chardet.codingstatemachine', >> 'chardet.escsm', 'chardet.latin1prober', 'chardet.mbcsgroupprober', >> 'chardet.utf8prober', 'chardet.mbcssm', 'chardet.sjisprober', >> 'chardet.mbcharsetprober', 'chardet.chardistribution', 'chardet.euctwfreq', >> 'chardet.euckrfreq', 'chardet.gb2312freq', 'chardet.big5freq', >> 'chardet.jisfreq', 'chardet.jpcntx', 'chardet.eucjpprober', >> 'chardet.gb2312prober', 'chardet.euckrprober', 'chardet.cp949prober', >> 'chardet.big5prober', 'chardet.euctwprober', 'chardet.sbcsgroupprober', >> 'chardet.sbcharsetprober', 'chardet.langcyrillicmodel', >> 'chardet.langgreekmodel', 'chardet.langbulgarianmodel', >> 'chardet.langthaimodel', 'chardet.langhebrewmodel', 'chardet.hebrewprober', >> 'chardet.langturkishmodel', 'chardet.version', 'requests.exceptions', >> 'urllib3.contrib', 'urllib3.contrib.pyopenssl', 'OpenSSL', >> 'OpenSSL.crypto', 'six', 'cryptography', 'cryptography.__about__', >> 'cryptography.x509', 'cryptography.x509.certificate_transparency', >> 'cryptography.x509.base', 'cryptography.utils', 'cryptography.hazmat', >> 'cryptography.hazmat.primitives', 'cryptography.hazmat.primitives.asymmetric', >> 'cryptography.hazmat.primitives.asymmetric.dsa', ' >> cryptography.hazmat.primitives.asymmetric.ec', >> 'cryptography.hazmat.primitives.asymmetric.rsa', >> 'cryptography.exceptions', 'cryptography.hazmat.backends', >> 'cryptography.hazmat.backends.interfaces', 'cryptography.x509.extensions', >> 'asn1crypto', 'asn1crypto.version', 'asn1crypto.keys', >> 'asn1crypto._elliptic_curve', 'asn1crypto._int', 'platform', >> 'asn1crypto.util', 'asn1crypto._errors', 'asn1crypto._iri', >> 'encodings.idna', 'stringprep', 'unicodedata', 'asn1crypto._types', >> 'asn1crypto._ordereddict', 'asn1crypto._ffi', 'asn1crypto._perf', >> 'asn1crypto._perf._big_num_ctypes', 'asn1crypto.algos', >> 'asn1crypto.core', 'asn1crypto._teletex_codec', 'asn1crypto.parser', >> 'cryptography.hazmat.primitives.constant_time', >> 'cryptography.hazmat.bindings', '_cffi_backend', '_constant_time.lib', >> '_constant_time', 'cryptography.hazmat.bindings._constant_time', >> 'cryptography.hazmat.primitives.serialization', >> 'cryptography.x509.general_name', 'idna', 'idna.package_data', >> 'idna.core', 'idna.idnadata', 'idna.intranges', 'six.moves', ' >> cryptography.x509.name', 'cryptography.x509.oid', >> 'cryptography.hazmat.primitives.hashes', 'OpenSSL._util', >> 'cryptography.hazmat.bindings.openssl', 'cryptography.hazmat.bindings.openssl.binding', >> '_openssl.lib', '_openssl', 'cryptography.hazmat.bindings._openssl', >> 'cryptography.hazmat.bindings.openssl._conditional', 'OpenSSL.SSL', >> 'OpenSSL.version', 'cryptography.hazmat.backends.openssl', >> 'cryptography.hazmat.backends.openssl.backend', >> 'cryptography.hazmat.backends.openssl.aead', >> 'cryptography.hazmat.backends.openssl.ciphers', >> 'cryptography.hazmat.primitives.ciphers', 'cryptography.hazmat.primitives.ciphers.base', >> 'cryptography.hazmat.primitives.ciphers.modes', >> 'cryptography.hazmat.backends.openssl.cmac', >> 'cryptography.hazmat.primitives.mac', 'cryptography.hazmat.backends.openssl.decode_asn1', >> 'cryptography.hazmat.backends.openssl.dh', 'cryptography.hazmat.primitives.asymmetric.dh', >> 'cryptography.hazmat.backends.openssl.dsa', >> 'cryptography.hazmat.backends.openssl.utils', >> 'cryptography.hazmat.primitives.asymmetric.utils', ' >> cryptography.hazmat.backends.openssl.ec', 'cryptography.hazmat.backends.openssl.encode_asn1', >> 'cryptography.hazmat.backends.openssl.hashes', >> 'cryptography.hazmat.backends.openssl.hmac', >> 'cryptography.hazmat.backends.openssl.rsa', >> 'cryptography.hazmat.primitives.asymmetric.padding', >> 'cryptography.hazmat.backends.openssl.x25519', >> 'cryptography.hazmat.primitives.asymmetric.x25519', >> 'cryptography.hazmat.backends.openssl.x509', >> 'cryptography.hazmat.primitives.ciphers.algorithms', >> 'cryptography.hazmat.primitives.kdf', 'cryptography.hazmat.primitives.kdf.scrypt', >> 'urllib3.packages.backports', 'urllib3.packages.backports.makefile', >> 'requests.__version__', 'requests.utils', 'cgi', 'html', 'html.entities', >> 'tempfile', 'requests.certs', 'certifi', 'certifi.core', >> 'requests._internal_utils', 'requests.compat', 'json', 'json.decoder', >> 'json.scanner', '_json', 'json.encoder', 'urllib.request', 'urllib.error', >> 'urllib.response', '_scproxy', 'http.cookiejar', 'http.cookies', >> 'requests.cookies', 'requests.structures', 'requests.packages', >> 'requests.packages.urllib3', 'requests.packages.urllib3.connectionpool', >> 'requests.packages.urllib3.exceptions', 'requests.packages.urllib3.packages', >> 'requests.packages.urllib3.packages.ssl_match_hostname', >> 'requests.packages.urllib3.packages.six', 'requests.packages.urllib3.packages.six.moves', >> 'requests.packages.urllib3.packages.six.moves.http_client', >> 'requests.packages.urllib3.connection', 'requests.packages.urllib3.util', >> 'requests.packages.urllib3.util.connection', >> 'requests.packages.urllib3.util.wait', 'requests.packages.urllib3.util.selectors', >> 'requests.packages.urllib3.util.request', 'requests.packages.urllib3.util.response', >> 'requests.packages.urllib3.util.ssl_', 'requests.packages.urllib3.util.timeout', >> 'requests.packages.urllib3.util.retry', 'requests.packages.urllib3.util.url', >> 'requests.packages.urllib3._collections', 'requests.packages.urllib3.request', >> 'requests.packages.urllib3.filepost', 'requests.packages.urllib3.fields', >> 'requests.packages.urllib3.packages.six.moves.urllib', >> 'requests.packages.urllib3.packages.six.moves.urllib.parse', >> 'requests.packages.urllib3.response', 'requests.packages.urllib3.poolmanager', >> 'requests.packages.urllib3.contrib', 'requests.packages.urllib3.contrib.pyopenssl', >> 'requests.packages.urllib3.packages.backports', >> 'requests.packages.urllib3.packages.backports.makefile', >> 'requests.packages.idna', 'requests.packages.idna.package_data', >> 'requests.packages.idna.core', 'requests.packages.idna.idnadata', >> 'requests.packages.idna.intranges', 'requests.packages.chardet', ' >> requests.packages.chardet.compat', 'requests.packages.chardet.universaldetector', >> 'requests.packages.chardet.charsetgroupprober', >> 'requests.packages.chardet.enums', 'requests.packages.chardet.charsetprober', >> 'requests.packages.chardet.escprober', 'requests.packages.chardet.codingstatemachine', >> 'requests.packages.chardet.escsm', 'requests.packages.chardet.latin1prober', >> 'requests.packages.chardet.mbcsgroupprober', >> 'requests.packages.chardet.utf8prober', 'requests.packages.chardet.mbcssm', >> 'requests.packages.chardet.sjisprober', 'requests.packages.chardet.mbcharsetprober', >> 'requests.packages.chardet.chardistribution', >> 'requests.packages.chardet.euctwfreq', 'requests.packages.chardet.euckrfreq', >> 'requests.packages.chardet.gb2312freq', 'requests.packages.chardet.big5freq', >> 'requests.packages.chardet.jisfreq', 'requests.packages.chardet.jpcntx', >> 'requests.packages.chardet.eucjpprober', 'requests.packages.chardet.gb2312prober', >> 'requests.packages.chardet.euckrprober', 'requests.packages.chardet.cp949prober', >> 'requests.packages.chardet.big5prober', 'requests.packages.chardet.euctwprober', >> 'requests.packages.chardet.sbcsgroupprober', >> 'requests.packages.chardet.sbcharsetprober', >> 'requests.packages.chardet.langcyrillicmodel', >> 'requests.packages.chardet.langgreekmodel', >> 'requests.packages.chardet.langbulgarianmodel', >> 'requests.packages.chardet.langthaimodel', 'requests.packages.chardet.langhebrewmodel', >> 'requests.packages.chardet.hebrewprober', 'requests.packages.chardet.langturkishmodel', >> 'requests.packages.chardet.version', 'requests.models', >> 'requests.hooks', 'requests.auth', 'requests.status_codes', 'requests.api', >> 'requests.sessions', 'requests.adapters', 'urllib3.contrib.socks', 'socks', >> 'obspy.core', 'obspy.core.utcdatetime', 'obspy.core.util', >> 'obspy.core.util.attribdict', 'obspy.core.util.base', 'doctest', >> 'argparse', 'difflib', 'pdb', 'cmd', 'bdb', 'code', 'codeop', 'glob', >> 'pprint', 'unittest', 'unittest.result', 'unittest.util', 'unittest.case', >> 'unittest.suite', 'unittest.loader', 'unittest.main', 'unittest.runner', >> 'unittest.signals', 'numpy', 'numpy._globals', 'numpy.__config__', >> 'numpy.version', 'numpy._import_tools', 'numpy.add_newdocs', 'numpy.lib', ' >> numpy.lib.info', 'numpy.lib.type_check', 'numpy.core', 'numpy.core.info', >> 'numpy.core.multiarray', 'numpy.core.umath', 'numpy.core._internal', >> 'numpy.compat', 'numpy.compat._inspect', 'numpy.compat.py3k', 'pathlib', >> 'ntpath', 'numpy.core.numerictypes', 'numpy.core.numeric', 'pickle', >> '_compat_pickle', '_pickle', 'numpy.core.fromnumeric', >> 'numpy.core._methods', 'numpy.core.arrayprint', 'numpy.core.defchararray', >> 'numpy.core.records', 'numpy.core.memmap', 'numpy.core.function_base', >> 'numpy.core.machar', 'numpy.core.getlimits', 'numpy.core.shape_base', >> 'numpy.core.einsumfunc', 'numpy.testing', 'numpy.testing.decorators', >> 'numpy.testing.nose_tools', 'numpy.testing.nose_tools.decorators', >> 'numpy.testing.nose_tools.utils', 'numpy.lib.utils', >> 'numpy.testing.nosetester', 'numpy.testing.nose_tools.nosetester', >> 'numpy.testing.utils', 'numpy.lib.ufunclike', 'numpy.lib.index_tricks', >> 'numpy.lib.function_base', 'numpy.lib.twodim_base', 'numpy.matrixlib', >> 'numpy.matrixlib.defmatrix', 'numpy.lib.stride_tricks', 'numpy.lib.mixins', >> 'numpy.lib.nanfunctions', 'numpy.lib.shape_base', 'numpy.lib.scimath', >> 'numpy.lib.polynomial', 'numpy.linalg', 'numpy.linalg.info', >> 'numpy.linalg.linalg', 'numpy.linalg.lapack_lite', >> 'numpy.linalg._umath_linalg', 'numpy.lib.arraysetops', 'numpy.lib.npyio', >> 'numpy.lib.format', 'numpy.lib._datasource', 'numpy.lib._iotools', >> 'numpy.lib.financial', 'decimal', '_decimal', 'numpy.lib.arrayterator', >> 'numpy.lib.arraypad', 'numpy.lib._version', 'numpy._distributor_init', >> 'numpy._mklinit', 'numpy.fft', 'numpy.fft.info', 'numpy.fft.fftpack', >> 'numpy.fft.fftpack_lite', 'numpy.fft.helper', 'numpy.polynomial', >> 'numpy.polynomial.polynomial', 'numpy.polynomial.polyutils', >> 'numpy.polynomial._polybase', 'numpy.polynomial.chebyshev', >> 'numpy.polynomial.legendre', 'numpy.polynomial.hermite', >> 'numpy.polynomial.hermite_e', 'numpy.polynomial.laguerre', 'numpy.random', ' >> numpy.random.info', 'cython_runtime', 'mtrand', 'numpy.random.mtrand', >> 'numpy.ctypeslib', 'numpy.ma', 'numpy.ma.core', 'numpy.ma.extras', >> 'pkg_resources', 'zipfile', 'pkgutil', 'plistlib', 'xml', 'xml.parsers', >> 'xml.parsers.expat', 'pyexpat.errors', 'pyexpat.model', 'pyexpat', >> 'xml.parsers.expat.model', 'xml.parsers.expat.errors', >> 'pkg_resources.extern', 'pkg_resources._vendor', >> 'pkg_resources.extern.six', 'pkg_resources._vendor.six', >> 'pkg_resources.extern.six.moves', 'pkg_resources._vendor.six.moves', >> 'pkg_resources.py31compat', 'pkg_resources.extern.appdirs', >> 'pkg_resources._vendor.packaging.__about__', >> 'pkg_resources.extern.packaging', 'pkg_resources.extern.packaging.version', >> 'pkg_resources.extern.packaging._structures', >> 'pkg_resources.extern.packaging.specifiers', >> 'pkg_resources.extern.packaging._compat', 'pkg_resources.extern.packaging.requirements', >> 'pkg_resources.extern.pyparsing', 'pkg_resources.extern.six.moves.urllib', >> 'pkg_resources.extern.packaging.markers', 'obspy.core.util.misc', >> 'obspy.core.util.obspy_types', 'obspy.core.util.testing', 'distutils', >> 'distutils.version', 'lxml', '_cython_0_28', 'lxml.etree', >> 'lxml._elementpath', 'gzip', 'obspy.core.util.version', 'obspy.core.trace', >> 'decorator', 'obspy.core.compatibility', 'unittest.mock', 'configparser', >> 'obspy.core.util.decorator', 'tarfile', 'obspy.core.util.deprecation_helpers', >> 'obspy.core.stream', 'obspy.scripts', 'obspy.scripts.runtests', >> 'obspy.core.event', 'obspy.core.event.base', 'obspy.core.event.header', >> 'obspy.core.event.catalog', 'obspy.imaging', 'obspy.imaging.cm', >> 'matplotlib', 'distutils.sysconfig', 'distutils.errors', >> 'matplotlib.cbook', 'matplotlib.cbook.deprecation', >> 'matplotlib.cbook._backports', 'matplotlib.compat', >> 'matplotlib.compat.subprocess', 'matplotlib.rcsetup', >> 'matplotlib.testing', 'matplotlib.fontconfig_pattern', 'pyparsing', >> 'matplotlib.colors', 'matplotlib._color_data', 'cycler', >> 'six.moves.urllib', 'six.moves.urllib.request', 'matplotlib._version', >> 'dateutil', 'dateutil._version'] >> > [ DEBUG] CACHEDIR=/Users/mth/.matplotlib >> > [ DEBUG] Using fontManager instance from /Users/mth/.matplotlib/fontLis >> t.json >> > >> > _______________________________________________ >> > Matplotlib-users mailing list >> > Matplotlib-users at python.org >> > https://mail.python.org/mailman/listinfo/matplotlib-users >> >> -- >> Jody Klymak >> http://web.uvic.ca/~jklymak/ >> >> >> >> >> >> > > -- > Jody Klymak > http://web.uvic.ca/~jklymak/ > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From efiring at hawaii.edu Tue Mar 20 21:10:50 2018 From: efiring at hawaii.edu (Eric Firing) Date: Tue, 20 Mar 2018 15:10:50 -1000 Subject: [Matplotlib-users] How to turn off matplotlib DEBUG msgs In-Reply-To: References: <1F60758E-4952-467B-A42B-7660E6667A00@uvic.ca> <6B1A1DE4-159E-48C7-A078-EC2734055DDC@uvic.ca> Message-ID: <1150424d-c0a5-d3f8-62f8-bbad2d68512f@hawaii.edu> On 2018/03/20 2:35 PM, Mike Hagerty wrote: > I see the function _wrap() which seems to set the logLevel to DEBUG : > > def _wrap(fmt, func, level=logging.DEBUG, always=True): That is setting the level of the message being emitted, not the level of the logger. Eric From m.hagerty at isti.com Thu Mar 22 10:56:11 2018 From: m.hagerty at isti.com (Mike Hagerty) Date: Thu, 22 Mar 2018 10:56:11 -0400 Subject: [Matplotlib-users] How to turn off matplotlib DEBUG msgs In-Reply-To: <6B1A1DE4-159E-48C7-A078-EC2734055DDC@uvic.ca> References: <1F60758E-4952-467B-A42B-7660E6667A00@uvic.ca> <6B1A1DE4-159E-48C7-A078-EC2734055DDC@uvic.ca> Message-ID: Just to complete the circle: This was my error. My codes all have access to a central (root) logger that I configure, thus any module may change the logLevel. I had left a logLevel set to DEBUG in one of my modules that loaded before obspy (and hence before matplotlib). The way it must work is: obspy gets the root logger and reads the logLevel, and this is passed on to matplotlib to set its logLevel from (or else matplotlib reads the root logLevel itself). Cheers, -Mike On Tue, Mar 20, 2018 at 7:36 PM, Jody Klymak wrote: > > On 20 Mar 2018, at 15:09, Mike Hagerty wrote: > > Thanks, that seems to work. > > I was already getting the logger and setting the root logLevel - I thought > that would > be passed through but I guess matplotlib is configured earlier in the > process. > > > Matplotlib does NOT set the logging level. So if nothing else sets the > logging level, it will be the logging-module-default (logging.WARNING). If > it is being set to DEBUG, then something else you are importing is setting > the default logging level; it shouldn?t. > > Cheers, Jody > > > > Cheers, > -Mike > > On Tue, Mar 20, 2018 at 5:37 PM, Jody Klymak wrote: > >> >> matplotlib now uses the standard python logging library. You should ask >> `obspy` if they are setting the default debug level for other packages. >> >> But for now, something like the following in your script should quiet >> matplotlib down. >> >> >> ``` >> import logging >> mpl_logger = logging.getLogger(?matplotlib?) >> mpl_logger.setLevel(logging.WARNING) >> >> ``` >> >> https://matplotlib.org/faq/troubleshooting_faq.html >> https://docs.python.org/3/library/logging.html#module-logging >> >> >> Cheers, Jody >> >> > On 20 Mar 2018, at 14:21, Mike Hagerty wrote: >> > >> > I recently installed the latest version of matplotlib via conda: >> > # packages in environment: >> > matplotlib 2.2.2 py27_0 conda-forge >> > >> > Now, as soon as matplotlib is imported by another module, it generates >> a ton of DEBUG messages (see below). >> > >> > How do I turn these off ?? >> > >> > Oddly, if I use the interactive python and import matplotlib directly, >> I don't get the messages, so it >> > has something to do with how the code I'm using (obspy) imports the >> matplotlib module. >> > >> > I'm using mac osx 10.10.5 and I get similar results with python2.7 and >> python3.6 (conda) environments. >> > >> > Any advice would be appreciated. >> > >> > Cheers! >> > -Mike >> > >> > >> > >> > >> > >>> from obspy.taup import TauPyModel >> > [ DEBUG] $HOME=/Users/mth >> > [ DEBUG] matplotlib data path /usr/local/anaconda/envs/obspy >> _3.6/lib/python3.6/site-packages/matplotlib/mpl-data >> > [ DEBUG] loaded rc file /usr/local/anaconda/envs/obspy >> _3.6/lib/python3.6/site-packages/matplotlib/mpl-data/matplotlibrc >> > [ DEBUG] matplotlib version 2.2.2 >> > [ DEBUG] interactive is False >> > [ DEBUG] platform is darwin >> > [ DEBUG] loaded modules: ['builtins', 'sys', '_frozen_importlib', >> '_imp', '_warnings', '_thread', '_weakref', '_frozen_importlib_external', >> '_io', 'marshal', 'posix', 'zipimport', 'encodings', 'codecs', '_codecs', >> 'encodings.aliases', 'encodings.utf_8', '_signal', '__main__', >> 'encodings.latin_1', 'io', 'abc', '_weakrefset', 'site', 'os', 'errno', >> 'stat', '_stat', 'posixpath', 'genericpath', 'os.path', '_collections_abc', >> '_sitebuiltins', 'sysconfig', '_sysconfigdata_m_darwin_darwin', >> '_osx_support', 're', 'enum', 'types', 'functools', '_functools', >> 'collections', 'operator', '_operator', 'keyword', 'heapq', '_heapq', >> 'itertools', 'reprlib', '_collections', 'weakref', 'collections.abc', >> 'sre_compile', '_sre', 'sre_parse', 'sre_constants', '_locale', 'copyreg', >> '_bootlocale', 'importlib', 'importlib._bootstrap', >> 'importlib._bootstrap_external', 'warnings', 'importlib.util', >> 'importlib.abc', 'importlib.machinery', 'contextlib', 'mpl_toolkits', >> 'encodings.cp437', 'readline', 'atexit', 'rlcompleter', 'logging', 'time', >> 'traceback', 'linecache', 'tokenize', 'token', 'string', '_string', >> 'threading', 'lib', 'lib.libyaml', 'yaml', 'yaml.error', 'yaml.tokens', >> 'yaml.events', 'yaml.nodes', 'yaml.loader', 'yaml.reader', 'yaml.scanner', >> 'yaml.parser', 'yaml.composer', 'yaml.constructor', 'datetime', 'math', >> '_datetime', 'base64', 'struct', '_struct', 'binascii', 'yaml.resolver', >> 'yaml.dumper', 'yaml.emitter', 'yaml.serializer', 'yaml.representer', >> 'yaml.cyaml', '_yaml', 'lib.liblog', 'lib.process_cmd', 'getopt', >> 'gettext', 'locale', 'copy', 'obspy', '__future__', 'future', >> 'future.builtins', 'future.builtins.iterators', 'future.utils', 'numbers', >> 'inspect', 'ast', '_ast', 'dis', 'opcode', '_opcode', >> 'future.builtins.misc', 'requests', 'urllib3', 'urllib3.connectionpool', >> 'socket', '_socket', 'selectors', 'select', 'urllib3.exceptions', >> 'urllib3.packages', 'urllib3.packages.ssl_match_hostname', 'ssl', >> 'ipaddress', 'textwrap', '_ssl', 'urllib3.packages.six', >> 'urllib3.packages.six.moves', 'http', 'http.client', 'email', >> 'email.parser', 'email.feedparser', 'email.errors', 'email._policybase', >> 'email.header', 'email.quoprimime', 'email.base64mime', 'email.charset', >> 'email.encoders', 'quopri', 'email.utils', 'random', 'hashlib', '_hashlib', >> '_blake2', '_sha3', 'bisect', '_bisect', '_random', 'urllib', >> 'urllib.parse', 'email._parseaddr', 'calendar', 'email.message', 'uu', >> 'email._encoded_words', 'email.iterators', 'urllib3.packages.six.moves.http_client', >> 'queue', 'urllib3.connection', 'urllib3.util', 'urllib3.util.connection', >> 'urllib3.util.wait', 'urllib3.util.selectors', 'urllib3.util.request', >> 'urllib3.util.response', 'urllib3.util.ssl_', 'hmac', >> 'urllib3.util.timeout', 'urllib3.util.retry', 'urllib3.util.url', >> 'urllib3._collections', 'urllib3.request', 'urllib3.filepost', 'uuid', >> 'ctypes', '_ctypes', 'ctypes._endian', 'ctypes.util', 'shutil', 'fnmatch', >> 'zlib', 'bz2', '_compression', '_bz2', 'lzma', '_lzma', 'pwd', 'grp', >> 'subprocess', 'signal', '_posixsubprocess', 'ctypes.macholib', >> 'ctypes.macholib.dyld', 'ctypes.macholib.framework', >> 'ctypes.macholib.dylib', 'urllib3.fields', 'mimetypes', >> 'urllib3.packages.six.moves.urllib', 'urllib3.packages.six.moves.urllib.parse', >> 'urllib3.response', 'urllib3.poolmanager', 'chardet', 'chardet.compat', >> 'chardet.universaldetector', 'chardet.charsetgroupprober', 'chardet.enums', >> 'chardet.charsetprober', 'chardet.escprober', 'chardet.codingstatemachine', >> 'chardet.escsm', 'chardet.latin1prober', 'chardet.mbcsgroupprober', >> 'chardet.utf8prober', 'chardet.mbcssm', 'chardet.sjisprober', >> 'chardet.mbcharsetprober', 'chardet.chardistribution', 'chardet.euctwfreq', >> 'chardet.euckrfreq', 'chardet.gb2312freq', 'chardet.big5freq', >> 'chardet.jisfreq', 'chardet.jpcntx', 'chardet.eucjpprober', >> 'chardet.gb2312prober', 'chardet.euckrprober', 'chardet.cp949prober', >> 'chardet.big5prober', 'chardet.euctwprober', 'chardet.sbcsgroupprober', >> 'chardet.sbcharsetprober', 'chardet.langcyrillicmodel', >> 'chardet.langgreekmodel', 'chardet.langbulgarianmodel', >> 'chardet.langthaimodel', 'chardet.langhebrewmodel', 'chardet.hebrewprober', >> 'chardet.langturkishmodel', 'chardet.version', 'requests.exceptions', >> 'urllib3.contrib', 'urllib3.contrib.pyopenssl', 'OpenSSL', >> 'OpenSSL.crypto', 'six', 'cryptography', 'cryptography.__about__', >> 'cryptography.x509', 'cryptography.x509.certificate_transparency', >> 'cryptography.x509.base', 'cryptography.utils', 'cryptography.hazmat', >> 'cryptography.hazmat.primitives', 'cryptography.hazmat.primitives.asymmetric', >> 'cryptography.hazmat.primitives.asymmetric.dsa', ' >> cryptography.hazmat.primitives.asymmetric.ec', >> 'cryptography.hazmat.primitives.asymmetric.rsa', >> 'cryptography.exceptions', 'cryptography.hazmat.backends', >> 'cryptography.hazmat.backends.interfaces', 'cryptography.x509.extensions', >> 'asn1crypto', 'asn1crypto.version', 'asn1crypto.keys', >> 'asn1crypto._elliptic_curve', 'asn1crypto._int', 'platform', >> 'asn1crypto.util', 'asn1crypto._errors', 'asn1crypto._iri', >> 'encodings.idna', 'stringprep', 'unicodedata', 'asn1crypto._types', >> 'asn1crypto._ordereddict', 'asn1crypto._ffi', 'asn1crypto._perf', >> 'asn1crypto._perf._big_num_ctypes', 'asn1crypto.algos', >> 'asn1crypto.core', 'asn1crypto._teletex_codec', 'asn1crypto.parser', >> 'cryptography.hazmat.primitives.constant_time', >> 'cryptography.hazmat.bindings', '_cffi_backend', '_constant_time.lib', >> '_constant_time', 'cryptography.hazmat.bindings._constant_time', >> 'cryptography.hazmat.primitives.serialization', >> 'cryptography.x509.general_name', 'idna', 'idna.package_data', >> 'idna.core', 'idna.idnadata', 'idna.intranges', 'six.moves', ' >> cryptography.x509.name', 'cryptography.x509.oid', >> 'cryptography.hazmat.primitives.hashes', 'OpenSSL._util', >> 'cryptography.hazmat.bindings.openssl', 'cryptography.hazmat.bindings.openssl.binding', >> '_openssl.lib', '_openssl', 'cryptography.hazmat.bindings._openssl', >> 'cryptography.hazmat.bindings.openssl._conditional', 'OpenSSL.SSL', >> 'OpenSSL.version', 'cryptography.hazmat.backends.openssl', >> 'cryptography.hazmat.backends.openssl.backend', >> 'cryptography.hazmat.backends.openssl.aead', >> 'cryptography.hazmat.backends.openssl.ciphers', >> 'cryptography.hazmat.primitives.ciphers', 'cryptography.hazmat.primitives.ciphers.base', >> 'cryptography.hazmat.primitives.ciphers.modes', >> 'cryptography.hazmat.backends.openssl.cmac', >> 'cryptography.hazmat.primitives.mac', 'cryptography.hazmat.backends.openssl.decode_asn1', >> 'cryptography.hazmat.backends.openssl.dh', 'cryptography.hazmat.primitives.asymmetric.dh', >> 'cryptography.hazmat.backends.openssl.dsa', >> 'cryptography.hazmat.backends.openssl.utils', >> 'cryptography.hazmat.primitives.asymmetric.utils', ' >> cryptography.hazmat.backends.openssl.ec', 'cryptography.hazmat.backends.openssl.encode_asn1', >> 'cryptography.hazmat.backends.openssl.hashes', >> 'cryptography.hazmat.backends.openssl.hmac', >> 'cryptography.hazmat.backends.openssl.rsa', >> 'cryptography.hazmat.primitives.asymmetric.padding', >> 'cryptography.hazmat.backends.openssl.x25519', >> 'cryptography.hazmat.primitives.asymmetric.x25519', >> 'cryptography.hazmat.backends.openssl.x509', >> 'cryptography.hazmat.primitives.ciphers.algorithms', >> 'cryptography.hazmat.primitives.kdf', 'cryptography.hazmat.primitives.kdf.scrypt', >> 'urllib3.packages.backports', 'urllib3.packages.backports.makefile', >> 'requests.__version__', 'requests.utils', 'cgi', 'html', 'html.entities', >> 'tempfile', 'requests.certs', 'certifi', 'certifi.core', >> 'requests._internal_utils', 'requests.compat', 'json', 'json.decoder', >> 'json.scanner', '_json', 'json.encoder', 'urllib.request', 'urllib.error', >> 'urllib.response', '_scproxy', 'http.cookiejar', 'http.cookies', >> 'requests.cookies', 'requests.structures', 'requests.packages', >> 'requests.packages.urllib3', 'requests.packages.urllib3.connectionpool', >> 'requests.packages.urllib3.exceptions', 'requests.packages.urllib3.packages', >> 'requests.packages.urllib3.packages.ssl_match_hostname', >> 'requests.packages.urllib3.packages.six', 'requests.packages.urllib3.packages.six.moves', >> 'requests.packages.urllib3.packages.six.moves.http_client', >> 'requests.packages.urllib3.connection', 'requests.packages.urllib3.util', >> 'requests.packages.urllib3.util.connection', >> 'requests.packages.urllib3.util.wait', 'requests.packages.urllib3.util.selectors', >> 'requests.packages.urllib3.util.request', 'requests.packages.urllib3.util.response', >> 'requests.packages.urllib3.util.ssl_', 'requests.packages.urllib3.util.timeout', >> 'requests.packages.urllib3.util.retry', 'requests.packages.urllib3.util.url', >> 'requests.packages.urllib3._collections', 'requests.packages.urllib3.request', >> 'requests.packages.urllib3.filepost', 'requests.packages.urllib3.fields', >> 'requests.packages.urllib3.packages.six.moves.urllib', >> 'requests.packages.urllib3.packages.six.moves.urllib.parse', >> 'requests.packages.urllib3.response', 'requests.packages.urllib3.poolmanager', >> 'requests.packages.urllib3.contrib', 'requests.packages.urllib3.contrib.pyopenssl', >> 'requests.packages.urllib3.packages.backports', >> 'requests.packages.urllib3.packages.backports.makefile', >> 'requests.packages.idna', 'requests.packages.idna.package_data', >> 'requests.packages.idna.core', 'requests.packages.idna.idnadata', >> 'requests.packages.idna.intranges', 'requests.packages.chardet', ' >> requests.packages.chardet.compat', 'requests.packages.chardet.universaldetector', >> 'requests.packages.chardet.charsetgroupprober', >> 'requests.packages.chardet.enums', 'requests.packages.chardet.charsetprober', >> 'requests.packages.chardet.escprober', 'requests.packages.chardet.codingstatemachine', >> 'requests.packages.chardet.escsm', 'requests.packages.chardet.latin1prober', >> 'requests.packages.chardet.mbcsgroupprober', >> 'requests.packages.chardet.utf8prober', 'requests.packages.chardet.mbcssm', >> 'requests.packages.chardet.sjisprober', 'requests.packages.chardet.mbcharsetprober', >> 'requests.packages.chardet.chardistribution', >> 'requests.packages.chardet.euctwfreq', 'requests.packages.chardet.euckrfreq', >> 'requests.packages.chardet.gb2312freq', 'requests.packages.chardet.big5freq', >> 'requests.packages.chardet.jisfreq', 'requests.packages.chardet.jpcntx', >> 'requests.packages.chardet.eucjpprober', 'requests.packages.chardet.gb2312prober', >> 'requests.packages.chardet.euckrprober', 'requests.packages.chardet.cp949prober', >> 'requests.packages.chardet.big5prober', 'requests.packages.chardet.euctwprober', >> 'requests.packages.chardet.sbcsgroupprober', >> 'requests.packages.chardet.sbcharsetprober', >> 'requests.packages.chardet.langcyrillicmodel', >> 'requests.packages.chardet.langgreekmodel', >> 'requests.packages.chardet.langbulgarianmodel', >> 'requests.packages.chardet.langthaimodel', 'requests.packages.chardet.langhebrewmodel', >> 'requests.packages.chardet.hebrewprober', 'requests.packages.chardet.langturkishmodel', >> 'requests.packages.chardet.version', 'requests.models', >> 'requests.hooks', 'requests.auth', 'requests.status_codes', 'requests.api', >> 'requests.sessions', 'requests.adapters', 'urllib3.contrib.socks', 'socks', >> 'obspy.core', 'obspy.core.utcdatetime', 'obspy.core.util', >> 'obspy.core.util.attribdict', 'obspy.core.util.base', 'doctest', >> 'argparse', 'difflib', 'pdb', 'cmd', 'bdb', 'code', 'codeop', 'glob', >> 'pprint', 'unittest', 'unittest.result', 'unittest.util', 'unittest.case', >> 'unittest.suite', 'unittest.loader', 'unittest.main', 'unittest.runner', >> 'unittest.signals', 'numpy', 'numpy._globals', 'numpy.__config__', >> 'numpy.version', 'numpy._import_tools', 'numpy.add_newdocs', 'numpy.lib', ' >> numpy.lib.info', 'numpy.lib.type_check', 'numpy.core', 'numpy.core.info', >> 'numpy.core.multiarray', 'numpy.core.umath', 'numpy.core._internal', >> 'numpy.compat', 'numpy.compat._inspect', 'numpy.compat.py3k', 'pathlib', >> 'ntpath', 'numpy.core.numerictypes', 'numpy.core.numeric', 'pickle', >> '_compat_pickle', '_pickle', 'numpy.core.fromnumeric', >> 'numpy.core._methods', 'numpy.core.arrayprint', 'numpy.core.defchararray', >> 'numpy.core.records', 'numpy.core.memmap', 'numpy.core.function_base', >> 'numpy.core.machar', 'numpy.core.getlimits', 'numpy.core.shape_base', >> 'numpy.core.einsumfunc', 'numpy.testing', 'numpy.testing.decorators', >> 'numpy.testing.nose_tools', 'numpy.testing.nose_tools.decorators', >> 'numpy.testing.nose_tools.utils', 'numpy.lib.utils', >> 'numpy.testing.nosetester', 'numpy.testing.nose_tools.nosetester', >> 'numpy.testing.utils', 'numpy.lib.ufunclike', 'numpy.lib.index_tricks', >> 'numpy.lib.function_base', 'numpy.lib.twodim_base', 'numpy.matrixlib', >> 'numpy.matrixlib.defmatrix', 'numpy.lib.stride_tricks', 'numpy.lib.mixins', >> 'numpy.lib.nanfunctions', 'numpy.lib.shape_base', 'numpy.lib.scimath', >> 'numpy.lib.polynomial', 'numpy.linalg', 'numpy.linalg.info', >> 'numpy.linalg.linalg', 'numpy.linalg.lapack_lite', >> 'numpy.linalg._umath_linalg', 'numpy.lib.arraysetops', 'numpy.lib.npyio', >> 'numpy.lib.format', 'numpy.lib._datasource', 'numpy.lib._iotools', >> 'numpy.lib.financial', 'decimal', '_decimal', 'numpy.lib.arrayterator', >> 'numpy.lib.arraypad', 'numpy.lib._version', 'numpy._distributor_init', >> 'numpy._mklinit', 'numpy.fft', 'numpy.fft.info', 'numpy.fft.fftpack', >> 'numpy.fft.fftpack_lite', 'numpy.fft.helper', 'numpy.polynomial', >> 'numpy.polynomial.polynomial', 'numpy.polynomial.polyutils', >> 'numpy.polynomial._polybase', 'numpy.polynomial.chebyshev', >> 'numpy.polynomial.legendre', 'numpy.polynomial.hermite', >> 'numpy.polynomial.hermite_e', 'numpy.polynomial.laguerre', 'numpy.random', ' >> numpy.random.info', 'cython_runtime', 'mtrand', 'numpy.random.mtrand', >> 'numpy.ctypeslib', 'numpy.ma', 'numpy.ma.core', 'numpy.ma.extras', >> 'pkg_resources', 'zipfile', 'pkgutil', 'plistlib', 'xml', 'xml.parsers', >> 'xml.parsers.expat', 'pyexpat.errors', 'pyexpat.model', 'pyexpat', >> 'xml.parsers.expat.model', 'xml.parsers.expat.errors', >> 'pkg_resources.extern', 'pkg_resources._vendor', >> 'pkg_resources.extern.six', 'pkg_resources._vendor.six', >> 'pkg_resources.extern.six.moves', 'pkg_resources._vendor.six.moves', >> 'pkg_resources.py31compat', 'pkg_resources.extern.appdirs', >> 'pkg_resources._vendor.packaging.__about__', >> 'pkg_resources.extern.packaging', 'pkg_resources.extern.packaging.version', >> 'pkg_resources.extern.packaging._structures', >> 'pkg_resources.extern.packaging.specifiers', >> 'pkg_resources.extern.packaging._compat', 'pkg_resources.extern.packaging.requirements', >> 'pkg_resources.extern.pyparsing', 'pkg_resources.extern.six.moves.urllib', >> 'pkg_resources.extern.packaging.markers', 'obspy.core.util.misc', >> 'obspy.core.util.obspy_types', 'obspy.core.util.testing', 'distutils', >> 'distutils.version', 'lxml', '_cython_0_28', 'lxml.etree', >> 'lxml._elementpath', 'gzip', 'obspy.core.util.version', 'obspy.core.trace', >> 'decorator', 'obspy.core.compatibility', 'unittest.mock', 'configparser', >> 'obspy.core.util.decorator', 'tarfile', 'obspy.core.util.deprecation_helpers', >> 'obspy.core.stream', 'obspy.scripts', 'obspy.scripts.runtests', >> 'obspy.core.event', 'obspy.core.event.base', 'obspy.core.event.header', >> 'obspy.core.event.catalog', 'obspy.imaging', 'obspy.imaging.cm', >> 'matplotlib', 'distutils.sysconfig', 'distutils.errors', >> 'matplotlib.cbook', 'matplotlib.cbook.deprecation', >> 'matplotlib.cbook._backports', 'matplotlib.compat', >> 'matplotlib.compat.subprocess', 'matplotlib.rcsetup', >> 'matplotlib.testing', 'matplotlib.fontconfig_pattern', 'pyparsing', >> 'matplotlib.colors', 'matplotlib._color_data', 'cycler', >> 'six.moves.urllib', 'six.moves.urllib.request', 'matplotlib._version', >> 'dateutil', 'dateutil._version'] >> > [ DEBUG] CACHEDIR=/Users/mth/.matplotlib >> > [ DEBUG] Using fontManager instance from /Users/mth/.matplotlib/fontLis >> t.json >> > >> > _______________________________________________ >> > Matplotlib-users mailing list >> > Matplotlib-users at python.org >> > https://mail.python.org/mailman/listinfo/matplotlib-users >> >> -- >> Jody Klymak >> http://web.uvic.ca/~jklymak/ >> >> >> >> >> >> > > -- > Jody Klymak > http://web.uvic.ca/~jklymak/ > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From oc-spam65 at laposte.net Fri Mar 23 17:28:35 2018 From: oc-spam65 at laposte.net (Olivier) Date: Fri, 23 Mar 2018 22:28:35 +0100 Subject: [Matplotlib-users] Impossible to hide cursor data / imshow() / Toolbar message / format_cursor_data() In-Reply-To: References: Message-ID: <4afd6c86-1384-a414-8541-a17ba13a6f06@laposte.net> Hello, Please consider the figure produced by "im = imshow(scipy.misc.face())". The message in the Toolbar reflects the position of the cursor and displays for example: "x=843.9 y=384.7 [91, 102, 88]" I changed the method "im.axes.format_coord()" in order to show specific information in the Toolbar message, and this works fine. However, the value of the cursor data, i.e. the string " [91, 102, 88]" in the example above, is still printed after my home-made coordinate information. PROBLEM: I don't want this information to be displayed. NOT A SOLUTION: I overrode the method "im.format_cursor_data()" so that it returns either "" or 'None'. However, in both cases, the brackets are still displayed, showing either " []" or " [None]", which I find unsatisfactory. It seems that the brackets are hardcoded in "backend_bases.NavigationToolbar2.mouse_move()". Is there a clean way to get rid of the cursor data and the brackets? If not, I suggest the patch below. Does it make sense? The effect is simply that if "im.format_cursor_data()" returns 'None', no cursor data will be appended to the coordinate information. Best regards, Olivier """ --- backend_bases.py 2017-12-10 04:59:43.000000000 +0100 +++ temp/backend_bases.py 2018-03-23 22:09:10.611351451 +0100 @@ -2898,7 +2898,9 @@ if a is not event.inaxes.patch: data = a.get_cursor_data(event) if data is not None: - s += ' [%s]' % a.format_cursor_data(data) + data_str = a.format_cursor_data(data) + if data_str is not None: + s += ' [%s]' % data_str if len(self.mode): self.set_message('%s, %s' % (self.mode, s)) """ From ben.v.root at gmail.com Fri Mar 23 19:50:03 2018 From: ben.v.root at gmail.com (Benjamin Root) Date: Fri, 23 Mar 2018 19:50:03 -0400 Subject: [Matplotlib-users] Impossible to hide cursor data / imshow() / Toolbar message / format_cursor_data() In-Reply-To: <4afd6c86-1384-a414-8541-a17ba13a6f06@laposte.net> References: <4afd6c86-1384-a414-8541-a17ba13a6f06@laposte.net> Message-ID: I think this is reasonable. Can you make a Pull Request with this change? On Fri, Mar 23, 2018 at 5:28 PM, Olivier via Matplotlib-users < matplotlib-users at python.org> wrote: > Hello, > > Please consider the figure produced by "im = imshow(scipy.misc.face())". > The message in the Toolbar reflects the position of the cursor and displays > for example: > > "x=843.9 y=384.7 [91, 102, 88]" > > I changed the method "im.axes.format_coord()" in order to show specific > information in the Toolbar message, and this works fine. > > However, the value of the cursor data, i.e. the string " [91, 102, 88]" in > the example above, is still printed after my home-made coordinate > information. > > PROBLEM: I don't want this information to be displayed. > > NOT A SOLUTION: I overrode the method "im.format_cursor_data()" so that it > returns either "" or 'None'. However, in both cases, the brackets are still > displayed, showing either " []" or " [None]", which I find unsatisfactory. > > It seems that the brackets are hardcoded in "backend_bases.NavigationToolb > ar2.mouse_move()". > > Is there a clean way to get rid of the cursor data and the brackets? > > If not, I suggest the patch below. Does it make sense? The effect is > simply that if "im.format_cursor_data()" returns 'None', no cursor data > will be appended to the coordinate information. > > Best regards, > > Olivier > > """ > --- backend_bases.py 2017-12-10 04:59:43.000000000 +0100 > +++ temp/backend_bases.py 2018-03-23 22:09:10.611351451 +0100 > @@ -2898,7 +2898,9 @@ > if a is not event.inaxes.patch: > data = a.get_cursor_data(event) > if data is not None: > - s += ' [%s]' % a.format_cursor_data(data) > + data_str = a.format_cursor_data(data) > + if data_str is not None: > + s += ' [%s]' % data_str > > if len(self.mode): > self.set_message('%s, %s' % (self.mode, s)) > """ > > _______________________________________________ > 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 Mar 23 19:51:48 2018 From: ben.v.root at gmail.com (Benjamin Root) Date: Fri, 23 Mar 2018 19:51:48 -0400 Subject: [Matplotlib-users] Impossible to hide cursor data / imshow() / Toolbar message / format_cursor_data() In-Reply-To: References: <4afd6c86-1384-a414-8541-a17ba13a6f06@laposte.net> Message-ID: Perhaps it might make sense to generalize this stuff even further with some sort of format string approach with named components. So, people could modify the format string without needing to do a massive code modification? On Fri, Mar 23, 2018 at 7:50 PM, Benjamin Root wrote: > I think this is reasonable. Can you make a Pull Request with this change? > > On Fri, Mar 23, 2018 at 5:28 PM, Olivier via Matplotlib-users < > matplotlib-users at python.org> wrote: > >> Hello, >> >> Please consider the figure produced by "im = imshow(scipy.misc.face())". >> The message in the Toolbar reflects the position of the cursor and displays >> for example: >> >> "x=843.9 y=384.7 [91, 102, 88]" >> >> I changed the method "im.axes.format_coord()" in order to show specific >> information in the Toolbar message, and this works fine. >> >> However, the value of the cursor data, i.e. the string " [91, 102, 88]" >> in the example above, is still printed after my home-made coordinate >> information. >> >> PROBLEM: I don't want this information to be displayed. >> >> NOT A SOLUTION: I overrode the method "im.format_cursor_data()" so that >> it returns either "" or 'None'. However, in both cases, the brackets are >> still displayed, showing either " []" or " [None]", which I find >> unsatisfactory. >> >> It seems that the brackets are hardcoded in "backend_bases.NavigationToolb >> ar2.mouse_move()". >> >> Is there a clean way to get rid of the cursor data and the brackets? >> >> If not, I suggest the patch below. Does it make sense? The effect is >> simply that if "im.format_cursor_data()" returns 'None', no cursor data >> will be appended to the coordinate information. >> >> Best regards, >> >> Olivier >> >> """ >> --- backend_bases.py 2017-12-10 04:59:43.000000000 +0100 >> +++ temp/backend_bases.py 2018-03-23 22:09:10.611351451 +0100 >> @@ -2898,7 +2898,9 @@ >> if a is not event.inaxes.patch: >> data = a.get_cursor_data(event) >> if data is not None: >> - s += ' [%s]' % a.format_cursor_data(data) >> + data_str = a.format_cursor_data(data) >> + if data_str is not None: >> + s += ' [%s]' % data_str >> >> if len(self.mode): >> self.set_message('%s, %s' % (self.mode, s)) >> """ >> >> _______________________________________________ >> 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 voodoo.bender at gmail.com Sat Mar 24 11:38:56 2018 From: voodoo.bender at gmail.com (alberto) Date: Sat, 24 Mar 2018 15:38:56 +0000 Subject: [Matplotlib-users] Plot data Message-ID: Hi , I'm trying to plot data (at 300K )with jupyter. apparently I do not get any error message, but no plot is generated. How can I solve it? I link my files regards Alberto https://drive.google.com/file/d/1VHMuXRWx8OhmIQsKYE8jj5WLkUhotOy_/view?usp=sharing https://drive.google.com/file/d/1dDpcs_DSweQLCETR08yC_CeqUQPUITtZ/view?usp=sharing https://drive.google.com/file/d/1H3RpjcKjaRLv-sOkDBBvQcmbqej3vSDM/view?usp=sharing -------------- next part -------------- An HTML attachment was scrubbed... URL: From oc-spam65 at laposte.net Sun Mar 25 13:11:57 2018 From: oc-spam65 at laposte.net (Olivier) Date: Sun, 25 Mar 2018 19:11:57 +0200 Subject: [Matplotlib-users] Impossible to hide cursor data / imshow() / Toolbar message / format_cursor_data() In-Reply-To: References: <4afd6c86-1384-a414-8541-a17ba13a6f06@laposte.net> Message-ID: > I think this is reasonable. Can you make a Pull Request with this change? OK, I tried to (my first time): https://github.com/matplotlib/matplotlib/pull/10878/files -- Olivier From ravi.thakkar369 at gmail.com Thu Mar 29 13:05:12 2018 From: ravi.thakkar369 at gmail.com (Ravi Thakkar) Date: Thu, 29 Mar 2018 12:05:12 -0500 Subject: [Matplotlib-users] Lien&bar combination graph. Message-ID: Hi, Guys, I am new to programming field, learning python to represent my research data. Anyone here please help me to get the x axis label and separate label on both y axis. (as indicated in attached image). Code is attached. -- Ravi. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- import matplotlib.pyplot as plt import numpy as np import pandas as pd width = 1 # width of a bar m1_t = pd.DataFrame({ 'SD-0' :[246,211,212,85.3,131,370,124.3,115.8,135.3,145.2,104.3,59,42.4,55.8,20.2,13.9,5.15], 'SD-15' :[236,176,169,126,152,86.8,98,212,164,131,91,77.9,18.5,30.5,21.4,6.3,13.5], '15':[715,1260,639,783,949,1032,1155,1343,1095,744,451,304,251,110,88.6,56.2,52.2], '0' :[530,1173,762,669.5,867,1018,1221,1203,1148,632,501,338,265,195,135,111,107]}) m1_t[['SD-0','SD-15']].plot(kind='bar', width = width) m1_t['0'].plot(secondary_y=True,label='0 ppt',marker='o') m1_t['15'].plot(secondary_y=True,label='15 ppt',marker='o') ax = plt.gca() plt.xlim([-width, len(m1_t['15'])-width]) ax.set_xticklabels(('0.25','0.5','1','2','4','6','8','12','24','48','96','144','192','288','336','432','528')) ax.legend(loc='upper right', bbox_to_anchor=(1,0.85)) plt.title("Fish Study") plt.ylabel("Concentration") plt.xlabel("time") plt.tight_layout() plt.show() -------------- next part -------------- A non-text attachment was scrubbed... Name: Figure_1.png Type: image/png Size: 47443 bytes Desc: not available URL: From vincent.adrien at gmail.com Thu Mar 29 13:25:31 2018 From: vincent.adrien at gmail.com (vincent.adrien at gmail.com) Date: Thu, 29 Mar 2018 10:25:31 -0700 Subject: [Matplotlib-users] Lien&bar combination graph. In-Reply-To: References: Message-ID: <2b4b87e8-32e4-7148-000a-b56e4709e21a@gmail.com> Hi Ravi, You are using plotting capabilities wrapped by pandas, which hide a bit the ?usual? objects used in the vanilla Matplotlib tutorials that you could find :/ (AFAICT). Please find attach one way to get what you would like if I understood correctly your wish. I personally tend to only use to object-oriented interface but if you really prefer the pyplot interface ("plt.*"), remember that the commands apply generally to the last active object, which is relevant. Hopefully this helps a bit. Best, Adrien On 03/29/2018 10:05 AM, Ravi Thakkar wrote: > Hi, > Guys, I am new to programming field, learning python to represent my > research data. > Anyone here please help me to get the x axis label and separate label on > both y axis. (as indicated in attached image). > Code is attached. > > -- > Ravi. > > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > -------------- next part -------------- A non-text attachment was scrubbed... Name: fish-study-graph_afv1.py Type: text/x-python Size: 1208 bytes Desc: not available URL: From jni.soma at gmail.com Fri Mar 30 10:45:34 2018 From: jni.soma at gmail.com (Juan Nunez-Iglesias) Date: Fri, 30 Mar 2018 10:45:34 -0400 Subject: [Matplotlib-users] Lien&bar combination graph. In-Reply-To: References: <36ff2f89-189f-4388-8c5f-d1ca07e4bd9a@Spark> Message-ID: Ah, I didn?t notice that you were doing pandas plotting instead of matplotlib. This is ok: pandas plot takes an ax= keyword that lets you specify an axis on which to plot. You can then ignore the secondary_y nonsense which is unnecessary if you use the matplotlib object-oriented API. The code below works for me. (Apologies for the primary y label, as I don?t know what your quantities represent. ;) Note, the title and x label need to happen on the first axes you declare, which in this case is ax_bar. If I tried to add them to ax_line nothing happened. import matplotlib.pyplot as plt import numpy as np import pandas as pd width = 1 # width of a bar m1_t = pd.DataFrame({ ? ? 'SD-0' :[246,211,212,85.3,131,370,124.3,115.8,135.3,145.2,104.3,59,42.4,55.8,20.2,13.9,5.15], ? ? 'SD-15' :[236,176,169,126,152,86.8,98,212,164,131,91,77.9,18.5,30.5,21.4,6.3,13.5], ? ? '15':[715,1260,639,783,949,1032,1155,1343,1095,744,451,304,251,110,88.6,56.2,52.2], ? ? '0' :[530,1173,762,669.5,867,1018,1221,1203,1148,632,501,338,265,195,135,111,107]}) fig, ax_bar = plt.subplots() ax_line = ax_bar.twinx() m1_t[['SD-0','SD-15']].plot(kind='bar', width = width, ax=ax_bar) m1_t['0'].plot(label='0 ppt',marker='o', ax=ax_line) m1_t['15'].plot(label='15 ppt',marker='o', ax=ax_line) ax_line.set_xlim(-width, m1_t.shape[0] + width) ax_line.set_xticklabels(('0.25','0.5','1','2','4','6','8','12','24','48','96','144','192','288','336','432','528')) ax_line.legend(loc='upper right', bbox_to_anchor=(1,0.85)) ax_line.set_ylabel("Concentration") ax_bar.set_title("Fish Study") ax_bar.set_xlabel("time") ax_bar.set_ylabel("whatever") plt.tight_layout() plt.show() On 29 Mar 2018, 6:46 PM -0400, Ravi Thakkar , wrote: > Hi Juan, > Thanks. I want to draw bar graph and its showing error. I dont have mathematically derived data on axis, I have straight forward observations.? ?I want to compare concentration of two different drug on by bar graph and another with two line graph. All in same graph. If you can suggest any example. TIA. > > > > On Thu, Mar 29, 2018 at 12:20 PM, Juan Nunez-Iglesias wrote: > > > Hi Ravi, and welcome! > > > > > > I think this example does what you want? > > > https://matplotlib.org/examples/api/two_scales.html > > > > > > Juan. > > > > > > On 29 Mar 2018, 1:11 PM -0400, Ravi Thakkar , wrote: > > > > Hi, > > > > Guys, I am new to programming field, learning python to represent my research data. > > > > Anyone here please help me to get the x axis label and separate label on both y axis. (as indicated in attached image). > > > > Code is attached. > > > > > > > > -- > > > > Ravi. > > > > _______________________________________________ > > > > 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 ravi.thakkar369 at gmail.com Fri Mar 30 11:25:19 2018 From: ravi.thakkar369 at gmail.com (Ravi Thakkar) Date: Fri, 30 Mar 2018 10:25:19 -0500 Subject: [Matplotlib-users] Lien&bar combination graph. In-Reply-To: References: <36ff2f89-189f-4388-8c5f-d1ca07e4bd9a@Spark> Message-ID: Thanks Juan. Thanks a lot. :) With Thanks and Regards. ------------------------------------------------------------------------- Ravindra Thakkar Associate Scientist, Kansas State University, Manhattan, Kansas (USA) ------------------------------------------------------------------------- On Fri, Mar 30, 2018 at 9:45 AM, Juan Nunez-Iglesias wrote: > Ah, I didn?t notice that you were doing pandas plotting instead of > matplotlib. This is ok: pandas plot takes an ax= keyword that lets you > specify an axis on which to plot. You can then ignore the secondary_y > nonsense which is unnecessary if you use the matplotlib object-oriented > API. The code below works for me. (Apologies for the primary y label, as I > don?t know what your quantities represent. ;) > > Note, the title and x label need to happen on the first axes you declare, > which in this case is ax_bar. If I tried to add them to ax_line nothing > happened. > > import matplotlib.pyplot as plt > import numpy as np > import pandas as pd > > width = 1 # width of a bar > > m1_t = pd.DataFrame({ > 'SD-0' :[246,211,212,85.3,131,370,124.3,115.8,135.3,145.2,104.3, > 59,42.4,55.8,20.2,13.9,5.15], > 'SD-15' :[236,176,169,126,152,86.8,98,212,164,131,91,77.9,18.5,30.5, > 21.4,6.3,13.5], > '15':[715,1260,639,783,949,1032,1155,1343,1095,744,451, > 304,251,110,88.6,56.2,52.2], > '0' :[530,1173,762,669.5,867,1018,1221,1203,1148,632,501,338, > 265,195,135,111,107]}) > > fig, ax_bar = plt.subplots() > ax_line = ax_bar.twinx() > > m1_t[['SD-0','SD-15']].plot(kind='bar', width = width, ax=ax_bar) > m1_t['0'].plot(label='0 ppt',marker='o', ax=ax_line) > m1_t['15'].plot(label='15 ppt',marker='o', ax=ax_line) > > ax_line.set_xlim(-width, m1_t.shape[0] + width) > ax_line.set_xticklabels(('0.25','0.5','1','2','4','6','8', > '12','24','48','96','144','192','288','336','432','528')) > ax_line.legend(loc='upper right', bbox_to_anchor=(1,0.85)) > > ax_line.set_ylabel("Concentration") > ax_bar.set_title("Fish Study") > ax_bar.set_xlabel("time") > ax_bar.set_ylabel("whatever") > > plt.tight_layout() > plt.show() > > > On 29 Mar 2018, 6:46 PM -0400, Ravi Thakkar , > wrote: > > Hi Juan, > Thanks. I want to draw bar graph and its showing error. I dont have > mathematically derived data on axis, I have straight forward observations. > I want to compare concentration of two different drug on by bar graph and > another with two line graph. All in same graph. If you can suggest any > example. TIA. > > > On Thu, Mar 29, 2018 at 12:20 PM, Juan Nunez-Iglesias > wrote: > >> Hi Ravi, and welcome! >> >> I think this example does what you want? >> https://matplotlib.org/examples/api/two_scales.html >> >> Juan. >> >> On 29 Mar 2018, 1:11 PM -0400, Ravi Thakkar , >> wrote: >> >> Hi, >> Guys, I am new to programming field, learning python to represent my >> research data. >> Anyone here please help me to get the x axis label and separate label on >> both y axis. (as indicated in attached image). >> Code is attached. >> >> -- >> Ravi. >> _______________________________________________ >> Matplotlib-users mailing list >> Matplotlib-users at python.org >> https://mail.python.org/mailman/listinfo/matplotlib-users >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jni.soma at gmail.com Fri Mar 30 11:35:12 2018 From: jni.soma at gmail.com (Juan Nunez-Iglesias) Date: Fri, 30 Mar 2018 11:35:12 -0400 Subject: [Matplotlib-users] Lien&bar combination graph. In-Reply-To: References: <36ff2f89-189f-4388-8c5f-d1ca07e4bd9a@Spark> Message-ID: <4a45caca-15b8-43e9-86da-e225b6623595@Spark> No prob, and thank you for providing a simple runnable example ? that?s gold when asking for help. =) On 30 Mar 2018, 11:25 AM -0400, Ravi Thakkar , wrote: > Thanks Juan. Thanks a lot. :) > > With Thanks and Regards. > ------------------------------------------------------------------------- > Ravindra Thakkar > Associate Scientist, > Kansas State?University, > Manhattan, Kansas (USA) > ------------------------------------------------------------------------- > > > On Fri, Mar 30, 2018 at 9:45 AM, Juan Nunez-Iglesias wrote: > > > Ah, I didn?t notice that you were doing pandas plotting instead of matplotlib. This is ok: pandas plot takes an ax= keyword that lets you specify an axis on which to plot. You can then ignore the secondary_y nonsense which is unnecessary if you use the matplotlib object-oriented API. The code below works for me. (Apologies for the primary y label, as I don?t know what your quantities represent. ;) > > > > > > Note, the title and x label need to happen on the first axes you declare, which in this case is ax_bar. If I tried to add them to ax_line nothing happened. > > > > > > import matplotlib.pyplot as plt > > > import numpy as np > > > import pandas as pd > > > > > > width = 1 # width of a bar > > > > > > m1_t = pd.DataFrame({ > > > ? ? 'SD-0' :[246,211,212,85.3,131,370,124.3,115.8,135.3,145.2,104.3,59,42.4,55.8,20.2,13.9,5.15], > > > ? ? 'SD-15' :[236,176,169,126,152,86.8,98,212,164,131,91,77.9,18.5,30.5,21.4,6.3,13.5], > > > ? ? '15':[715,1260,639,783,949,1032,1155,1343,1095,744,451,304,251,110,88.6,56.2,52.2], > > > ? ? '0' :[530,1173,762,669.5,867,1018,1221,1203,1148,632,501,338,265,195,135,111,107]}) > > > > > > fig, ax_bar = plt.subplots() > > > ax_line = ax_bar.twinx() > > > > > > m1_t[['SD-0','SD-15']].plot(kind='bar', width = width, ax=ax_bar) > > > m1_t['0'].plot(label='0 ppt',marker='o', ax=ax_line) > > > m1_t['15'].plot(label='15 ppt',marker='o', ax=ax_line) > > > > > > ax_line.set_xlim(-width, m1_t.shape[0] + width) > > > ax_line.set_xticklabels(('0.25','0.5','1','2','4','6','8','12','24','48','96','144','192','288','336','432','528')) > > > ax_line.legend(loc='upper right', bbox_to_anchor=(1,0.85)) > > > > > > ax_line.set_ylabel("Concentration") > > > ax_bar.set_title("Fish Study") > > > ax_bar.set_xlabel("time") > > > ax_bar.set_ylabel("whatever") > > > > > > plt.tight_layout() > > > plt.show() > > > > > > > > > On 29 Mar 2018, 6:46 PM -0400, Ravi Thakkar , wrote: > > > > Hi Juan, > > > > Thanks. I want to draw bar graph and its showing error. I dont have mathematically derived data on axis, I have straight forward observations.? ?I want to compare concentration of two different drug on by bar graph and another with two line graph. All in same graph. If you can suggest any example. TIA. > > > > > > > > > > > > > On Thu, Mar 29, 2018 at 12:20 PM, Juan Nunez-Iglesias wrote: > > > > > > Hi Ravi, and welcome! > > > > > > > > > > > > I think this example does what you want? > > > > > > https://matplotlib.org/examples/api/two_scales.html > > > > > > > > > > > > Juan. > > > > > > > > > > > > On 29 Mar 2018, 1:11 PM -0400, Ravi Thakkar , wrote: > > > > > > > Hi, > > > > > > > Guys, I am new to programming field, learning python to represent my research data. > > > > > > > Anyone here please help me to get the x axis label and separate label on both y axis. (as indicated in attached image). > > > > > > > Code is attached. > > > > > > > > > > > > > > -- > > > > > > > Ravi. > > > > > > > _______________________________________________ > > > > > > > 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: