From jklymak at uvic.ca Sat Aug 5 13:05:06 2017 From: jklymak at uvic.ca (Klymak Jody) Date: Sat, 5 Aug 2017 10:05:06 -0700 Subject: [Matplotlib-users] Single Colorbar for multiple subplots In-Reply-To: <1500474709725-48091.post@n5.nabble.com> References: <1500474709725-48091.post@n5.nabble.com> Message-ID: <66035CFC-12AD-4F06-9A2B-4581EC8533A2@uvic.ca> I modified matplotlib to let you do this by passing an array of axes to the ax argument of colorbar. It's in the git master branch but that has other bugs so you may not want to use it yet. But the way to do this with older releases is to make the axis you want to put the colorbar in manually (cbax=fig.add_axes) with the correct position and then pass cbax to colorbar as the argument to the parameter cax. Of course you may need to make the other subplots smaller prob using the subplots_adjust method if the figure. Cheers. Jody Sent from my iPhone > On Jul 19, 2017, at 07:31, danjames95 wrote: > > Hi, > > I am trying to plot 4 subplots in a 2 by 2 grid for mean sea level pressure > data over the four seasons. > > I have managed to plot all four in the same figure with their own individual > colorbars, however, I would ideally like the figure to display one colorbar > at the bottom to represent all four figures and I have been unsuccessful in > doing this so far. There have been a few posts on this but as this is my > first assignment (i'm a student at university) with python, I'm struggling > to understand the answers! > > The section of my code which involves the plotting of data is as follows: > > ... > #Select Projection > lon_0= 0 > lat_0=lats.mean() > > m = Basemap(projection = 'cyl', lat_0=lat_0, lon_0=lon_0, resolution = 'l') > #Convert Lons and Lats > x,y = np.meshgrid (lons_shifted,lats) > xx,yy= m(x,y) > > v = np.linspace(980, 1030, 11, endpoint=True) > > fig = plt.figure() > > plt.subplot(2, 2, 1) > set1 = m.contourf(xx,yy,MSLP_WINTER, v) > m.drawmapboundary() > m.drawcoastlines() > plt.title('Winter') > bar = plt.colorbar(orientation = 'horizontal', ticks = v, format = '%.0f') > plt.xlim(-80,20) > plt.ylim (20,70) > > plt.subplot(2, 2, 2) > set2 = m.contourf(xx,yy,MSLP_SPRING, v) > m.drawmapboundary() > m.drawcoastlines() > plt.title('Spring') > bar = plt.colorbar(orientation = 'horizontal', ticks = v) > plt.xlim(-80,20) > plt.ylim (20,70) > > plt.subplot(2, 2, 3) > set3 = m.contourf(xx,yy,MSLP_SUMMER, v) > m.drawmapboundary() > m.drawcoastlines() > plt.title('Summer') > bar = plt.colorbar(orientation = 'horizontal', ticks = v) > plt.xlim(-80,20) > plt.ylim (20,70) > > plt.subplot(2, 2, 4) > set4 = m.contourf(xx,yy,MSLP_AUTUMN, v) > m.drawmapboundary() > m.drawcoastlines() > plt.title('Autumn') > bar = plt.colorbar(orientation = 'horizontal', ticks = v) > plt.xlim(-80,20) > plt.ylim (20,70) > > plt.suptitle("Seasonally Averaged Mean Sea Level Pressure between 2006 to > 2016") > > plt.show() > > This creates the following image: > > > Any help would be very much appreciated. > Also, if there any obvious bad habits within this code, please feel free to > point them out! > > Thanks, > Dan > > > > -- > View this message in context: http://matplotlib.1069221.n5.nabble.com/Single-Colorbar-for-multiple-subplots-tp48091.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users From tcaswell at gmail.com Sat Aug 5 13:35:49 2017 From: tcaswell at gmail.com (Thomas Caswell) Date: Sat, 05 Aug 2017 17:35:49 +0000 Subject: [Matplotlib-users] Windows7: figure window "not responding" In-Reply-To: References: Message-ID: I do exactly this as well (but on linux)! The symptoms your are describing sounds like the GUI event loop is not being spun behind the scenes (see https://github.com/matplotlib/matplotlib/pull/4779 for some draft text at explaining how all of that works). Have you tried doing `%matplotlib` is IPython? Tom On Sat, Aug 5, 2017 at 12:39 PM Strozzi, David J. wrote: > This problem has been driving me nuts, posted it elsewhere, so far no > one's been able to help. I am running Python 3.6.1 from Anaconda (all > packages updated to latest and greatest) on Windows 7. ipython and mpl > figure windows work fine from a console, or spyder. The problem is when I > try running ipython within emacs using elpy. > > > To back up, the workflow I'm shooting for is using emacs as my IDE, and > running python within emacs. I've done this for many years with the Yorick > interpreter, and it's quite addictive. I get the same problem whether I > use the GNU windows build of emacs, or emacs -nw (terminal, no X) from > cygwin (ver 25.2 both cases). elpy seems to be a good Python package for > emacs, and nominally supports using ipython. > > > OK, so - I can use ipython + emacs + elpy. The only problem is matplotlib > figures. When I do figure(), a figure window appears, but is not fully > rendered (e.g. no buttons), and the window title says "Not responding". If > I do a plot(), nothing is plotted. Playing with ion() and show() doesn't > help. > > > I've posted this on the elpy github, various stackexchange forums, no one > has had any ideas yet. > > > Any help is greatly appreciated! > > Dave > _______________________________________________ > 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 Aug 5 19:31:20 2017 From: tcaswell at gmail.com (Thomas Caswell) Date: Sat, 05 Aug 2017 23:31:20 +0000 Subject: [Matplotlib-users] animation in thread In-Reply-To: <1495666809985-48056.post@n5.nabble.com> References: <1495666441748-48055.post@n5.nabble.com> <1495666809985-48056.post@n5.nabble.com> Message-ID: GUI frameworks tend to require they be on the main thread. Which backend / gui framework are you using here? In general you will have to arrange things so that the main thread owns the GUI windows + plotting and the child threads own the computation. Tom On Sat, Aug 5, 2017 at 12:37 PM arash wrote: > (Resending to correct formatting) > > I am new to matplotlib and I am trying to get started with animation > library. > There is an example here for a simple strip chart: > > https://matplotlib.org/examples/animation/strip_chart_demo.html > > I tried to use this example in a thread. I created a simple > *threading.Thread* class, and in it's *run()* method, called: > > *ani = animation.FuncAnimation(fig, scope.update, emitter, > interval=10,True) > plt.show()* > > here is class: > > * > import matplotlib.pyplot as plt > import matplotlib.animation as animation > > class graph(threading.Thread): > > def __init__(self, feeder): > threading.Thread.__init__(self) > self.fig, self.ax = plt.subplots() > self.scope = Scope(self.ax) > self.feeder=feeder > self.running=True > > def run(self): > while self.running: > ani = animation.FuncAnimation(self.fig, self.scope.update, > self.feeder.emit_ch1(), interval=1, blit=True) > plt.show() > * > but when I start this thread, it never shows the windows. Isn't this right > usage? > > > > -- > View this message in context: > http://matplotlib.1069221.n5.nabble.com/animation-in-thread-tp48055p48056.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tcaswell at gmail.com Sat Aug 5 19:34:37 2017 From: tcaswell at gmail.com (Thomas Caswell) Date: Sat, 05 Aug 2017 23:34:37 +0000 Subject: [Matplotlib-users] Combine two histogramm in one histogramm In-Reply-To: <1495844922945-48057.post@n5.nabble.com> References: <1495844922945-48057.post@n5.nabble.com> Message-ID: I think you are looking for stacked histograms: http://matplotlib.org/examples/pylab_examples/bar_stacked.html Tom On Sat, Aug 5, 2017 at 12:36 PM bellafkih wrote: > Hello, > > I present a data of each month in histogram, so for each month, there two > percentages: first the percentage of messages updates (example: 80 %) and > the second, the percentage of non update messages (eg. 20%), i > must divide the update messages into two parts: the first : important > messages (eg. 70 %) and non important messages (eg 30%). > My current solution is to create two histograms, but i ask if there is a > possibility to create only graphic, so present the 70 % and 30 % in the > part > of 80% ? > > Thanks > > > > -- > View this message in context: > http://matplotlib.1069221.n5.nabble.com/Combine-two-histogramm-in-one-histogramm-tp48057.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tcaswell at gmail.com Sat Aug 5 19:37:58 2017 From: tcaswell at gmail.com (Thomas Caswell) Date: Sat, 05 Aug 2017 23:37:58 +0000 Subject: [Matplotlib-users] Superimpose circles on a contourf plot In-Reply-To: <1495197371826-48053.post@n5.nabble.com> References: <1495197371826-48053.post@n5.nabble.com> Message-ID: Fabian, The `Circle` artist is sized in data-space so it _should_ changes sizes as you zoom. If you just want to show markers sized in _screen_ space use `scatter` sc = ax.scatter([a.x for a in atoms], [a.y for a in atoms], s=[radii[a.number] for a in atoms]) should do the trick. Tom On Sat, Aug 5, 2017 at 12:36 PM SilverSurfer wrote: > Dear all > I am new to matplotlib and python. Up until now i was able to achieve what > i > wanted, but now i run into a weird problem. If i superimpose markers onto a > countourf plot they change their size when i zoom into and area off the > plot. > The information i use to plot the positions of the circles is gathered from > ASE (Atomic Simulation Environment ). > > I will first try to outline my code without suppling a MWE as this would be > hard to do at the moment: > __________________________ > ..... > from matplotlib import pyplot > from matplotlib.patches import Circle > from ase.io import read, write > from ase import Atom > from ase.atoms import Atoms > import pylab > > > > #xarray,yarray are the x and y coordinates ,DATA contains a density at this > point > niso=1#min max value > ncontours=512# number off contours > ###ploting starts here > > myplot = > > pylab.contourf(xarray,yarray,DATA,ncontours,antialiased=False,cmap=my_cmap,vmin=-niso,vmax=niso) > > atoms=read('somedata', format="vasp") > > for atom in atoms > color = my_colors_DCLN[atom.number] > radius = radii[atom.number] > struc = pylab.plot(atom.x, atom.y, color='black', > linestyle='solid', > marker='o', markerfacecolor=color, markersize=(1.2+radius*3.8),alpha=0.45) > #circle = Circle((atom.x, atom.y), (radius/3.5), > facecolor=color,edgecolor='k', linewidth=0.4)#alpha=10) > #ax.add_patch(circle)) > > #ax.axis('equal') > #ax.set_xticks([]) > #ax.set_yticks([]) > #ax.axis('off') > > > > > density_plot > pylab.axis('image') > plt.Figure() > > plt.draw() > > > pylab.show() > _______________________ > > If i use the normal markers from matplotlib everything works correct. My > DATA that i plot with contourf has the same dimensions as the atoms > object. > So i only need to have the xy coordinates of this object. > I can plot the atoms object fine if i do it like this: > > ____________ > import numpy as np > from matplotlib import pyplot > from ase.lattice.surface import fcc111 > from ase import Atom > from ase.data import covalent_radii as radii > from ase.data.colors import jmol_colors > from matplotlib.patches import Circle > from ase.io import read, write > fig, ax = pyplot.subplots() > > > atoms = read('somedata', format="vasp") > > > > > > for atom in atoms: > color = my_colors[atom.number] > radius = radii[atom.number] > circle = Circle((atom.x, atom.y), (radius), > facecolor=color,edgecolor='k', > linewidth=0.4) > ax.add_patch(circle) > > # Enforce the circles are round (equal x and y scales) and turn off > # tickmarks. > ax.axis('equal') > ax.set_xticks([]) > ax.set_yticks([]) > ax.axis('off') > > fig.savefig('out.png',dpi=300) > > pyplot.draw() > > > pyplot.show() > _____________________ > > > But i do not know what "fig, ax = pyplot.subplots()" does and how i could > incoporate this code in a way that i can supperimpose it to my contourf > plot. The Contourf plot is the important information and i just want to > show > the positions of certian atoms ( circles) ontop of this plot. > > Thank you in advance > > fabian > > > > > -- > View this message in context: > http://matplotlib.1069221.n5.nabble.com/Superimpose-circles-on-a-contourf-plot-tp48053.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tcaswell at gmail.com Sat Aug 5 19:42:08 2017 From: tcaswell at gmail.com (Thomas Caswell) Date: Sat, 05 Aug 2017 23:42:08 +0000 Subject: [Matplotlib-users] Matplotlib tkinter error In-Reply-To: <1495029955430-48051.post@n5.nabble.com> References: <1495029955430-48051.post@n5.nabble.com> Message-ID: Do you have a file called `tempfile.py` in the directory you are running the script from? The issue is that the module `tempfile` (which should be coming from the standard library) is reporting that it does not have an expected member (TemporaryFile). If you are shadowing that module with a local file you will see exceptions like this. The other option is that you python installation is broken. Tom On Sat, Aug 5, 2017 at 12:36 PM Pooja wrote: > Hi, > > I have been working on a piece of code and suddenly getting these errors: > /Users/poojabhalode/.bash_profile: line 1: .bashrc: No such file or > directory > [[ 2 -1 0] > [-1 2 -1] > [ 0 -1 2]] > [[ 3.41421356e+00 8.32667268e-17 -6.37995760e-17] > [ 0.00000000e+00 2.00000000e+00 1.35170527e-16] > [ 0.00000000e+00 0.00000000e+00 5.85786438e-01]] > 8.32667268469e-17 > 8.32667268469e-17 > -6.37995760397e-17 > 0.0 > 1.35170526715e-16 > 0.0 > 0.0 > [[ 3.41421356 0. 0. ] > [ 0. 2. 0. ] > [ 0. 0. 0.58578644]] > Traceback (most recent call last): > File "/Users/poojabhalode/Google Drive/PYTHON/files/1sttest/May17.py", > line 7, in > import matplotlib > File > > "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/__init__.py", > line 947, in > rcParams = rc_params() > File > > "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/__init__.py", > line 856, in rc_params > fname = matplotlib_fname() > File > > "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/__init__.py", > line 726, in matplotlib_fname > configdir = _get_configdir() > File > > "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/__init__.py", > line 597, in _get_configdir > return _get_config_or_cache_dir(_get_xdg_config_dir()) > File > > "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/__init__.py", > line 566, in _get_config_or_cache_dir > if not _is_writable_dir(p): > File > > "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/__init__.py", > line 228, in _is_writable_dir > t = tempfile.TemporaryFile(dir=p) > AttributeError: 'module' object has no attribute 'TemporaryFile' > [Finished in 0.2s with exit code 1] > [shell_cmd: python -u "/Users/poojabhalode/Google > Drive/PYTHON/files/1sttest/May17.py"] > [dir: /Users/poojabhalode/Google Drive/PYTHON/files/1sttest] > [path: /usr/bin:/bin:/usr/sbin:/sbin] > > > My code gives errors at the import statement itself: > > Code:: > import matplotlib > ERROR indicated here. > matplotlib.use("TkAgg") > from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, > NavigationToolbar2TkAgg > from matplotlib.figure import Figure > > Can someone please let me know what is going wrong with this? > Thank you. I would really appreciate it. > > Thanks! > > > > > -- > View this message in context: > http://matplotlib.1069221.n5.nabble.com/Matplotlib-tkinter-error-tp48051.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tcaswell at gmail.com Sat Aug 5 19:48:42 2017 From: tcaswell at gmail.com (Thomas Caswell) Date: Sat, 05 Aug 2017 23:48:42 +0000 Subject: [Matplotlib-users] Problem of memory leak using FigureCanvasTkAgg In-Reply-To: <1494500114526.97210@etu.univ-lyon1.fr> References: <1494500114526.97210@etu.univ-lyon1.fr> Message-ID: It is likely there things are not being garbage collected due to either a missed reference surviving or the circular references between the various objects is delaying gc from collecting them (I do not recall the details exactly off the top of my head, but running gc manually with more generations may help). However, if you are embedding in a GUI you are probably better off just doing the embedding directly (and skipping `pyplot` entirely, see https://matplotlib.org/examples/user_interfaces/embedding_in_tk.html ). Re-using the Figures / Axes / Artists to update the data (rather than starting from scratch every time) may also prevent the memory leaks _and_ give you a performance boost. Please subscribe to the list so that you can post without moderation. Tom On Sat, Aug 5, 2017 at 12:36 PM GARCIA PIERRE SIMON p0904379 < pierre.garcia at etu.univ-lyon1.fr> wrote: > Hello, > > I'm PhD student in Bioinformatic and I'm working on a project using > matplotlib and Tkinter but I've got a big problem of memory leak using > these modules. I'll be very grateful if you could help me to solve this > problem. Here is the link explaining what happends, with a reduced script: > > http://stackoverflow.com/questions/43097378/matplotlib-vs-tkinter-memory-leak-using-figurecanvastkagg > > Thank you in advance, > > > Sincerly, > > > > > Pierre Garcia, PhD Student > --------- > Bases Mol?culaires et Structurales des Syst?mes infectieux-UMR5086 > Institut de Biologie et Chimie des Prot?ines > 7 passage du Vercors > 69 367 Lyon cedex 07 > --------- > Laboratoire de Biom?trie et Biologie Evolutive-UMR5558 > UCBL Lyon 1 -B?t. Gr?gory Mendel > 43 bd du 11 novembre 1918 > 69622 VILLEURBANNE cedex > > > _______________________________________________ > 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 Aug 5 19:54:05 2017 From: tcaswell at gmail.com (Thomas Caswell) Date: Sat, 05 Aug 2017 23:54:05 +0000 Subject: [Matplotlib-users] Polygon Selector Demo In-Reply-To: References: Message-ID: The devdocs are built against current master (not 2.0.x ). That PolygonSelector was added very recently ( https://github.com/matplotlib/matplotlib/pull/8403 ), is currently only on the master branch, and will be included in the upcoming 2.1 release. Tom On Sat, Aug 5, 2017 at 12:36 PM Tap, Frank wrote: > Dear all, > > > > I try to run the Polygon Selector Demo ( > https://matplotlib.org/devdocs/gallery/widgets/polygon_selector_demo.html#sphx-glr-gallery-widgets-polygon-selector-demo-py) > but I get the following error: > > > > ImportError: cannot import name PolygonSelector > > > > I am using matplotlib 2.0.2. Can anybody please tell me what I?m doing > wrong? > > > > Regards, > > > > Frank > > dr. ir. Frank Tap | Software Engineer | Maritime Simulation & Software > Group > MARIN | T +31 317 49 32 11 <+31%20317%20493%20211> | r.tap at marin.nl | > www.marin.nl > > [image: LinkedIn] [image: > YouTube] [image: Twitter] > [image: Facebook] > > MARIN news: ?Hydrodynamics of Floating Offshore Structures? course, > Singapore & Houston > > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image015328.PNG Type: image/png Size: 293 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image25c33d.PNG Type: image/png Size: 331 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image4098a9.PNG Type: image/png Size: 333 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image371909.PNG Type: image/png Size: 253 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image015328.PNG Type: image/png Size: 293 bytes Desc: not available URL: From tcaswell at gmail.com Sat Aug 5 19:54:37 2017 From: tcaswell at gmail.com (Thomas Caswell) Date: Sat, 05 Aug 2017 23:54:37 +0000 Subject: [Matplotlib-users] figsize wrong in Qt5Agg import In-Reply-To: References: Message-ID: David, Was this fixed in 2.0.2 ? On Sat, Aug 5, 2017 at 12:35 PM David J Pine wrote: > Using the qt5agg backend, I get plots that are 2 times too small unless I > use pyplot. > > I just upgraded to matplotlib 2.01. I'm running on a Mac using the > Anaconda installation: 4.3.17 py36_0 > > This two scripts produce plots that are the same size. Why do I have to > double the figsize parameters when I do not use pyplot? Seems like a bug. > I didn't need to do this for the Qt4Agg backend. > > # script 1 > import matplotlib > matplotlib.use('Qt5Agg') > import matplotlib.pyplot as plt > fig1, ax = plt.subplots(figsize=(6, 4)) > ax.plot([1, 2, 3, 2, 3, 4, 3, 4, 5]) > ax.set_title('A simple plot') > ax.grid(True) > ax.set_xlabel('time') > ax.set_ylabel('volts') > plt.savefig('test1.pdf') > plt.show() > > # script 2 > import matplotlib > matplotlib.use('Qt5Agg') > from matplotlib.backends.backend_qt5agg \ > import FigureCanvasQTAgg as FigureCanvas > from matplotlib.figure import Figure > fig = Figure(figsize=(12, 8)) > canvas = FigureCanvas(fig) > ax = fig.add_subplot(111) > ax.plot([1, 2, 3, 2, 3, 4, 3, 4, 5]) > ax.set_title('A simple plot') > ax.grid(True) > ax.set_xlabel('time') > ax.set_ylabel('volts') > canvas.print_figure('test2.pdf') > canvas.show() > > _______________________________________________ > 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 Aug 5 19:58:22 2017 From: tcaswell at gmail.com (Thomas Caswell) Date: Sat, 05 Aug 2017 23:58:22 +0000 Subject: [Matplotlib-users] Embedding, Drawing, Curser in Tkinter In-Reply-To: <1494479878318-48038.post@n5.nabble.com> References: <1494479878318-48038.post@n5.nabble.com> Message-ID: Stefan, On a quick skim that does not look wrong. I would not use globals and have the callbacks be methods on your BOStrab_Fahrzeugeinschraenkung class. Tom On Sat, Aug 5, 2017 at 12:35 PM stefanxfg via Matplotlib-users < matplotlib-users at python.org> wrote: > Hello to everyone. > > I develop a GUI and i want to embedd Matplotlib in a Tkinter Canvas. Theres > is no problem until here. But i want to draw the lines and have a curser > line in the diagram. In the code below i embedd the canvas in the > INIT-Function. > > > > class BOStrab_Fahrzeugeinschraenkung: > def __init__(self, top=None): > ...... > self.ya = np.array(ddd) > self.yb = np.array(ddd) > self.z = np.array(ddd) > > self.canvasframe11 = Frame(self.TPanedwindow4_f2) > self.canvasframe11.place(x=0, y=0, relwidth=1.0, > relheight=0.95, > bordermode=INSIDE) > self.canvasframe12 = Frame(self.TPanedwindow4_f2) > self.canvasframe12.place(x=0, rely=0.95, relwidth=1.0, > bordermode=INSIDE) > > global ax1 > self.fig1 = Figure (figsize=(5,4), dpi=100) > > self.ax1 = self.fig1.add_subplot(111) #f?r 2d-Plot > self.ax1.set_title('Definition der LRUGL') > self.ax1.set_xlabel('Breite y [mm]') > self.ax1.set_ylabel('Hoehe z [mm]') > > self.ax1.axis([-2000,2000,0, 5000]) > self.ax1.grid(True) > self.ax1.plot(self.ya,self.z, color='red', linestyle='--', > marker='') > self.ax1.plot(self.yb,self.z, color='red', linestyle='--', > marker='') > > self.canvas1 = > FigureCanvasTkAgg(self.fig1,self.canvasframe11) > toolbar1 = NavigationToolbar2TkAgg(self.canvas1, > self.canvasframe12) > > self.canvas1.get_tk_widget().pack(fill=BOTH, expand=TRUE, > pady=2, padx=2, > anchor="n") > > > > In several examples i saw the drawing in def's and the input for the > drawing > from root. So the following code is function then. > > > def onMouseMove(event): > ax1.lines = [ax1.lines[0]] > ax1.axhline(y=event.ydata, color="k") > ax1.axvline(x=event.xdata, color="k") > > def updateData(): > global level1, val1 > clamp = lambda n, minn, maxn: max(min(maxn, n), minn) > yield 1 # FuncAnimation expects an iterator > > def visualize(i): > lineVal1.set_ydata(val1) > return lineVal1 > > > My question is. Is my way to embedd the code in Tkinter right? Or its > better > to declare the diagram functionalities outside the class and only draw into > the class? > > Best regards from Stefan > > > > -- > View this message in context: > http://matplotlib.1069221.n5.nabble.com/Embedding-Drawing-Curser-in-Tkinter-tp48038.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pmhobson at gmail.com Mon Aug 7 11:43:40 2017 From: pmhobson at gmail.com (Paul Hobson) Date: Mon, 7 Aug 2017 08:43:40 -0700 Subject: [Matplotlib-users] Contourplots In-Reply-To: <1498945480679-48076.post@n5.nabble.com> References: <1498945480679-48076.post@n5.nabble.com> Message-ID: Szymon, We have a section dedication to image, contour, and field plots: http://matplotlib.org/gallery.html#images_contours_and_fields Start there and let us know what specific issues you're having in a very minimal and easily copy-pastable dataset. On Sat, Jul 1, 2017 at 2:44 PM, szymonzaczek wrote: > Hey guys, > > I want to create a contour plot using Python and most likely matplot > library > that would somehow resemble this one made in Origin: > > pmf.tif > > basing on this excel sheet: > > pmf.xlsx . > > I am new to Python. I know some of the basics, I am capable of creating > histograms and scatterplots, though contourplots have utterly defeated me > so > far. Therefore, any kind of assistance would be much appreciated. How would > you, experienced users, address this issue? > > Kind regards, > Szymon Zaczek > > > > -- > View this message in context: http://matplotlib.1069221.n5. > nabble.com/Contourplots-tp48076.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pmhobson at gmail.com Mon Aug 7 11:49:57 2017 From: pmhobson at gmail.com (Paul Hobson) Date: Mon, 7 Aug 2017 08:49:57 -0700 Subject: [Matplotlib-users] Plotting dates on the y-axis of a contour map/ hovmoller In-Reply-To: <1499714810715-48081.post@n5.nabble.com> References: <1499714810715-48081.post@n5.nabble.com> Message-ID: The contour function can be called in many forms. Without your data, it's hard to see exactly what's going on, but it looks like you're using the contour(Z, V) form. I recommend using the contour(X, Y, Z) form. Passing Y as an array of datetime-like object should "just work". If it doesn't, boil this example down to something we can copy-paste into a terminal/notebook and mess around with. A 5 x 5 array for your Z values and some of the dates in the format you currently have them should suffice. -Paul On Mon, Jul 10, 2017 at 12:26 PM, vaultron94 wrote: > Hello all, > > So I ran into a snare when making a Hovmoller for a case study. I have > everything done and colors picked out. But for the life of me cannot find a > way to get the Y-axis to plot the dates provided in the data. Here is the > script I have. > > import numpy as np > import datetime > import matplotlib.pyplot as plt > import os > import pandas as pd > > def cmap(cmap): > cmap = plt.cm.get_cmap(cmap) > > data = pd.read_excel('/Users/operator/Documents/Hovmoller_dewpt.xlsx') > > a=np.array(data) > > time= (a[:,0]) > lat= (a[:,1]) > lon= (a[:,2]) > BATA= (a[:,3]) > BSPA= (a[:,4]) > BUFF= (a[:,5]) > CLIF= (a[:,6]) > FAYE= (a[:,7]) > HERK= (a[:,8]) > JOHN= (a[:,9]) > JORD= (a[:,10]) > OPPE= (a[:,11]) > WEST= (a[:,12]) > timeZ= (a[:,13]) > > > b=np.vstack((BUFF,BATA,CLIF,JORD,FAYE,WEST,HERK,OPPE,JOHN,BSPA)).T > > plt.contourf(b, np.arange(40,67), cmap=('jet')) > > > plt.xlabel('BUFF BATA CLIF JORD FAYE WEST HERK OPPE JOHN BSPA') > plt.ylabel('Time') > plt.grid('off') > plt.colorbar() > > plt.title('Dewpoint Hovmoller for Mesonet Sites') > plt.figure() > > #timeZ contains the dates I want, and instead of having the number of rows > as the y axis I want the dates there instead. Attached is the graphic I get > as of now. Any thoughts or advice is much appreciated! > > Thank you > > > > > > -- > View this message in context: http://matplotlib.1069221.n5. > nabble.com/Plotting-dates-on-the-y-axis-of-a-contour-map- > hovmoller-tp48081.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pmhobson at gmail.com Mon Aug 7 11:52:01 2017 From: pmhobson at gmail.com (Paul Hobson) Date: Mon, 7 Aug 2017 08:52:01 -0700 Subject: [Matplotlib-users] Plot of array of shape (N, N, N) in form of sphere In-Reply-To: <1501172147860-48103.post@n5.nabble.com> References: <1501172147860-48103.post@n5.nabble.com> Message-ID: This sounds like something you'd want to use yt or mayavi for. While MPL has basic 3D capabilities (e.g., scatter, line, and surface plots), taking cuts of volumes is definitely out of our scope unless you've pre-computed everything. -Paul On Thu, Jul 27, 2017 at 9:15 AM, cdpnepal wrote: > Dear All, > > I have an array of shape (N,N,N) of intensity values. How can I plot those > intensity values in form of sphere. > Can I show a cut of quadrant of that sphere, so that I can visualize > intensity not only on the surface but also inside the sphere. > > Thanks > > > > -- > View this message in context: http://matplotlib.1069221.n5. > nabble.com/Plot-of-array-of-shape-N-N-N-in-form-of-sphere-tp48103.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pmhobson at gmail.com Mon Aug 7 11:55:08 2017 From: pmhobson at gmail.com (Paul Hobson) Date: Mon, 7 Aug 2017 08:55:08 -0700 Subject: [Matplotlib-users] showcase example code: bachelors_degrees_by_gender.py Inbox x In-Reply-To: References: Message-ID: I haven't come across any such data. Randy Olson contributed that example: https://twitter.com/randal_olson -paul On Thu, Jul 13, 2017 at 5:47 AM, Chris Barnes < christopher.s.barnes at gmail.com> wrote: > Good morning- > > I came across you data > linked > on Reddit this morning, and found it fascinating. I'm a high school history > teacher, and "college" and "degrees" is very important and relevant to my > classroom studies. Any chance you have any data similar to the one > above...but only for men? Just thought I'd ask. > > Thanks! > > -Chris Barnes > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pmhobson at gmail.com Mon Aug 7 11:55:39 2017 From: pmhobson at gmail.com (Paul Hobson) Date: Mon, 7 Aug 2017 08:55:39 -0700 Subject: [Matplotlib-users] Building matplotlib on PyPy In-Reply-To: References: Message-ID: Mihnea, Thanks for this! This is wonderful news! -paul On Thu, Jul 13, 2017 at 3:15 AM, Mihnea Saracin wrote: > Hello everyone, > > > I have recently managed to make Matplotlib work with PyPy 5.8.0 through > CFFI bindings. I posted a step by step tutorial for this if anyone is > interested: https://pythonfiles.wordpress.com/2017/06/28/making- > matplotlib-work-with-pypy/ > > > Best regards, > > Mihnea > > > > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pmhobson at gmail.com Mon Aug 7 12:02:37 2017 From: pmhobson at gmail.com (Paul Hobson) Date: Mon, 7 Aug 2017 09:02:37 -0700 Subject: [Matplotlib-users] GEOS installation for Basemap package In-Reply-To: References: Message-ID: Ahlam, I'm by no means an expert on compiling this libraries on any OS. If you don't need the absolutely bleeding-edge versions, I would use conda to install them. For instance conda install geopandas --channel=conda-forge automatically grabs and installs a pre-compiled GEOS binary to support the geopandas library On Sun, Jul 16, 2017 at 11:30 PM, Ahlam Al Qasim wrote: > To whom it may concern, > > I hope this email finds you well. I am trying to get the Basemap package > on my mac, and have been following the instructions based on this webpage: > https://matplotlib.org/basemap/users/installing.html. I don't have GEOS > already installed so I tried following steps on the website to download it > with Basemap: > > cd geos-3.3.3 > export GEOS_DIR= > # A reasonable choice on a Unix-like system is /usr/local, or > # if you don't have permission to write there, your home directory. > ./configure --prefix=$GEOS_DIR > make; make install > > > However, I am getting errors at the third step (make; make install). > Attached is a copy of what I get on my python console, if it helps. I think > the error occurs when trying to create the /include directory, but I'm not > sure how to fix it. I'm still new to python so any help would be much > appreciated! > > Best regards, > Ahlam Al Qasim > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tcaswell at gmail.com Mon Aug 7 12:24:42 2017 From: tcaswell at gmail.com (Thomas Caswell) Date: Mon, 07 Aug 2017 16:24:42 +0000 Subject: [Matplotlib-users] Fwd: Embedding, Drawing, Curser in Tkinter In-Reply-To: References: <1494479878318-48038.post@n5.nabble.com> Message-ID: Forward of response. @Stefan Please respond to the mailing list (you will need to join to post un-moderated https://mail.python.org/mailman/listinfo/matplotlib-users ) Tom ---------- Forwarded message --------- From: Stefan Schubert Date: Mon, Aug 7, 2017 at 7:02 AM Subject: Re: [Matplotlib-users] Embedding, Drawing, Curser in Tkinter To: Thomas Caswell Hi Thomas, thank you for answerring. I have already developed further. Here is my current code. def PlotFrame(self): self.fig = Figure (figsize=(5,4), dpi=100) self.ax = self.fig.add_subplot(111) self.ax = self.fig.add_subplot(111) #fuer 2d-Plot self.ax.set_title('Definition der LRUGL') self.ax.set_xlabel('Fahrzeugbreite y [mm]') self.ax.set_ylabel('Fahrzeughoehe z [mm]') self.ax.axis([-2000,2000,0, 5000]) self.ax.grid(True) self.canvas = FigureCanvasTkAgg(self.fig,self) self.toolbar = NavigationToolbar2TkAgg(self.canvas,self) self.toolbar.update() self.plot_widget = self.canvas.get_tk_widget() self.plot_widget.pack(side=tk.TOP, fill=tk.BOTH, expand=1) self.toolbar.pack(side=tk.BOTTOM, fill=tk.BOTH, expand=1) self.ax.plot(np.zeros(100)) def onMouseMove(event): self.ax.lines = [self.ax.lines[0]] if event.xdata and event.ydata: # python3 often has None self.ax.axhline(y=event.ydata, color="k") #(y=event.ydata, color="k") self.ax.axvline(x=event.xdata, color="k") #(x=event.xdata, color="k") self.canvas.show() self.canvas.mpl_connect('motion_notify_event', onMouseMove) self.canvas.show() def fig_ax_request(): publish('FIG,AX',self.fig,self.ax) subscribe('REQUEST_FIG,AX',fig_ax_request) def DrawPlot(self): def test_plot(): self.ax.imshow(np.random.normal(0.,1.,size=[1000,1000]),cmap="hot",aspect="auto") self.fig.canvas.draw() self.buttonAAA['command'] = test_plot def get_fig_ax(fig,ax): self.fig = fig self.ax = ax subscribe('FIG,AX',get_fig_ax) publish('REQUEST_FIG,AX') Now i have a table for input and an embedded diagram in tkinter canvas. This code above is only for testing. I want the functionality that i can write values in the table and let it simultanously paint into matplot-Canvas. Hav eyou some suggestion or imrpovements to do that ? Best regards from Stefan On 6 August 2017 at 01:58, Thomas Caswell wrote: > Stefan, > > On a quick skim that does not look wrong. > > I would not use globals and have the callbacks be methods on > your BOStrab_Fahrzeugeinschraenkung class. > > Tom > > On Sat, Aug 5, 2017 at 12:35 PM stefanxfg via Matplotlib-users < > matplotlib-users at python.org> wrote: > >> Hello to everyone. >> >> I develop a GUI and i want to embedd Matplotlib in a Tkinter Canvas. >> Theres >> is no problem until here. But i want to draw the lines and have a curser >> line in the diagram. In the code below i embedd the canvas in the >> INIT-Function. >> >> >> >> class BOStrab_Fahrzeugeinschraenkung: >> def __init__(self, top=None): >> ...... >> self.ya = np.array(ddd) >> self.yb = np.array(ddd) >> self.z = np.array(ddd) >> >> self.canvasframe11 = Frame(self.TPanedwindow4_f2) >> self.canvasframe11.place(x=0, y=0, relwidth=1.0, >> relheight=0.95, >> bordermode=INSIDE) >> self.canvasframe12 = Frame(self.TPanedwindow4_f2) >> self.canvasframe12.place(x=0, rely=0.95, relwidth=1.0, >> bordermode=INSIDE) >> >> global ax1 >> self.fig1 = Figure (figsize=(5,4), dpi=100) >> >> self.ax1 = self.fig1.add_subplot(111) #f?r 2d-Plot >> self.ax1.set_title('Definition der LRUGL') >> self.ax1.set_xlabel('Breite y [mm]') >> self.ax1.set_ylabel('Hoehe z [mm]') >> >> self.ax1.axis([-2000,2000,0, 5000]) >> self.ax1.grid(True) >> self.ax1.plot(self.ya,self.z, color='red', >> linestyle='--', marker='') >> self.ax1.plot(self.yb,self.z, color='red', >> linestyle='--', marker='') >> >> self.canvas1 = >> FigureCanvasTkAgg(self.fig1,self.canvasframe11) >> toolbar1 = NavigationToolbar2TkAgg(self.canvas1, >> self.canvasframe12) >> >> self.canvas1.get_tk_widget().pack(fill=BOTH, expand=TRUE, >> pady=2, padx=2, >> anchor="n") >> >> >> >> In several examples i saw the drawing in def's and the input for the >> drawing >> from root. So the following code is function then. >> >> >> def onMouseMove(event): >> ax1.lines = [ax1.lines[0]] >> ax1.axhline(y=event.ydata, color="k") >> ax1.axvline(x=event.xdata, color="k") >> >> def updateData(): >> global level1, val1 >> clamp = lambda n, minn, maxn: max(min(maxn, n), minn) >> yield 1 # FuncAnimation expects an iterator >> >> def visualize(i): >> lineVal1.set_ydata(val1) >> return lineVal1 >> >> >> My question is. Is my way to embedd the code in Tkinter right? Or its >> better >> to declare the diagram functionalities outside the class and only draw >> into >> the class? >> >> Best regards from Stefan >> >> >> >> -- >> View this message in context: >> http://matplotlib.1069221.n5.nabble.com/Embedding-Drawing-Curser-in-Tkinter-tp48038.html >> Sent from the matplotlib - users mailing list archive at Nabble.com. >> _______________________________________________ >> Matplotlib-users mailing list >> Matplotlib-users at python.org >> https://mail.python.org/mailman/listinfo/matplotlib-users >> > -- Mit freundlichen Gr??en Schubert -------------- next part -------------- An HTML attachment was scrubbed... URL: From mail.python.org at gethmann.org Mon Aug 7 12:58:00 2017 From: mail.python.org at gethmann.org (Julian Gethmann) Date: Mon, 7 Aug 2017 18:58:00 +0200 Subject: [Matplotlib-users] GEOS installation for Basemap package In-Reply-To: References: Message-ID: <34f33e9b-44f1-131c-9524-d085abb75c55@gethmann.org> Hallo, You are not allowed to create the directory /include as a normal user, because it is under / which is owned by root. If you really want to install it to this location you need to become super user first. So the last `make install` should be an `sudo make install`. But I would also stick to Paul Hobson's solution of using conda [1] or in your case homebrew [2]. [1] https://www.continuum.io/downloads [2] https://brew.sh/ Best regards, Julian On 07/17/2017 08:30 AM, Ahlam Al Qasim wrote: > To whom it may concern, > > I hope this email finds you well. I am trying to get the Basemap package on > my mac, and have been following the instructions based on this webpage: > https://matplotlib.org/basemap/users/installing.html. I don't have GEOS > already installed so I tried following steps on the website to download it > with Basemap: > > cd geos-3.3.3 > export GEOS_DIR= > # A reasonable choice on a Unix-like system is /usr/local, or > # if you don't have permission to write there, your home directory. > ./configure --prefix=$GEOS_DIR > make; make install > > > However, I am getting errors at the third step (make; make install). > Attached is a copy of what I get on my python console, if it helps. I think > the error occurs when trying to create the /include directory, but I'm not > sure how to fix it. I'm still new to python so any help would be much > appreciated! > > Best regards, > Ahlam Al Qasim > > > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > From ben.v.root at gmail.com Mon Aug 7 13:03:48 2017 From: ben.v.root at gmail.com (Benjamin Root) Date: Mon, 7 Aug 2017 13:03:48 -0400 Subject: [Matplotlib-users] Single Colorbar for multiple subplots In-Reply-To: <66035CFC-12AD-4F06-9A2B-4581EC8533A2@uvic.ca> References: <1500474709725-48091.post@n5.nabble.com> <66035CFC-12AD-4F06-9A2B-4581EC8533A2@uvic.ca> Message-ID: Another approach that I like is to use: https://matplotlib.org/examples/axes_grid/demo_axes_grid.html On Sat, Aug 5, 2017 at 1:05 PM, Klymak Jody wrote: > I modified matplotlib to let you do this by passing an array of axes to > the ax argument of colorbar. It's in the git master branch but that has > other bugs so you may not want to use it yet. > > But the way to do this with older releases is to make the axis you want to > put the colorbar in manually (cbax=fig.add_axes) with the correct position > and then pass cbax to colorbar as the argument to the parameter cax. Of > course you may need to make the other subplots smaller prob using the > subplots_adjust method if the figure. > > Cheers. Jody > > > > Sent from my iPhone > > > On Jul 19, 2017, at 07:31, danjames95 wrote: > > > > Hi, > > > > I am trying to plot 4 subplots in a 2 by 2 grid for mean sea level > pressure > > data over the four seasons. > > > > I have managed to plot all four in the same figure with their own > individual > > colorbars, however, I would ideally like the figure to display one > colorbar > > at the bottom to represent all four figures and I have been unsuccessful > in > > doing this so far. There have been a few posts on this but as this is my > > first assignment (i'm a student at university) with python, I'm > struggling > > to understand the answers! > > > > The section of my code which involves the plotting of data is as follows: > > > > ... > > #Select Projection > > lon_0= 0 > > lat_0=lats.mean() > > > > m = Basemap(projection = 'cyl', lat_0=lat_0, lon_0=lon_0, resolution = > 'l') > > #Convert Lons and Lats > > x,y = np.meshgrid (lons_shifted,lats) > > xx,yy= m(x,y) > > > > v = np.linspace(980, 1030, 11, endpoint=True) > > > > fig = plt.figure() > > > > plt.subplot(2, 2, 1) > > set1 = m.contourf(xx,yy,MSLP_WINTER, v) > > m.drawmapboundary() > > m.drawcoastlines() > > plt.title('Winter') > > bar = plt.colorbar(orientation = 'horizontal', ticks = v, format = > '%.0f') > > plt.xlim(-80,20) > > plt.ylim (20,70) > > > > plt.subplot(2, 2, 2) > > set2 = m.contourf(xx,yy,MSLP_SPRING, v) > > m.drawmapboundary() > > m.drawcoastlines() > > plt.title('Spring') > > bar = plt.colorbar(orientation = 'horizontal', ticks = v) > > plt.xlim(-80,20) > > plt.ylim (20,70) > > > > plt.subplot(2, 2, 3) > > set3 = m.contourf(xx,yy,MSLP_SUMMER, v) > > m.drawmapboundary() > > m.drawcoastlines() > > plt.title('Summer') > > bar = plt.colorbar(orientation = 'horizontal', ticks = v) > > plt.xlim(-80,20) > > plt.ylim (20,70) > > > > plt.subplot(2, 2, 4) > > set4 = m.contourf(xx,yy,MSLP_AUTUMN, v) > > m.drawmapboundary() > > m.drawcoastlines() > > plt.title('Autumn') > > bar = plt.colorbar(orientation = 'horizontal', ticks = v) > > plt.xlim(-80,20) > > plt.ylim (20,70) > > > > plt.suptitle("Seasonally Averaged Mean Sea Level Pressure between 2006 to > > 2016") > > > > plt.show() > > > > This creates the following image: > > Seasonal_Averages.png> > > > > Any help would be very much appreciated. > > Also, if there any obvious bad habits within this code, please feel free > to > > point them out! > > > > Thanks, > > Dan > > > > > > > > -- > > View this message in context: http://matplotlib.1069221.n5. > nabble.com/Single-Colorbar-for-multiple-subplots-tp48091.html > > Sent from the matplotlib - users mailing list archive at Nabble.com. > > _______________________________________________ > > Matplotlib-users mailing list > > Matplotlib-users at python.org > > https://mail.python.org/mailman/listinfo/matplotlib-users > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben.v.root at gmail.com Mon Aug 7 13:16:37 2017 From: ben.v.root at gmail.com (Benjamin Root) Date: Mon, 7 Aug 2017 13:16:37 -0400 Subject: [Matplotlib-users] GEOS installation for Basemap package In-Reply-To: <34f33e9b-44f1-131c-9524-d085abb75c55@gethmann.org> References: <34f33e9b-44f1-131c-9524-d085abb75c55@gethmann.org> Message-ID: As a note: the `/include` came about due to a mistake with the environment variables. So, the fact that a `sudo make install` even works is just papering over the original mistake. Ben Root On Mon, Aug 7, 2017 at 12:58 PM, Julian Gethmann < mail.python.org at gethmann.org> wrote: > Hallo, > > You are not allowed to create the directory /include as a normal user, > because it is under / which is owned by root. If you really want to install > it to this location you need to become super user first. > So the last `make install` should be an `sudo make install`. > > But I would also stick to Paul Hobson's solution of using conda [1] or in > your case homebrew [2]. > > [1] https://www.continuum.io/downloads > [2] https://brew.sh/ > > Best regards, > Julian > > > On 07/17/2017 08:30 AM, Ahlam Al Qasim wrote: > >> To whom it may concern, >> >> I hope this email finds you well. I am trying to get the Basemap package >> on >> my mac, and have been following the instructions based on this webpage: >> https://matplotlib.org/basemap/users/installing.html. I don't have GEOS >> already installed so I tried following steps on the website to download it >> with Basemap: >> >> cd geos-3.3.3 >> export GEOS_DIR= >> # A reasonable choice on a Unix-like system is /usr/local, or >> # if you don't have permission to write there, your home directory. >> ./configure --prefix=$GEOS_DIR >> make; make install >> >> >> However, I am getting errors at the third step (make; make install). >> Attached is a copy of what I get on my python console, if it helps. I >> think >> the error occurs when trying to create the /include directory, but I'm not >> sure how to fix it. I'm still new to python so any help would be much >> appreciated! >> >> Best regards, >> Ahlam Al Qasim >> >> >> >> _______________________________________________ >> Matplotlib-users mailing list >> Matplotlib-users at python.org >> https://mail.python.org/mailman/listinfo/matplotlib-users >> >> > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben.v.root at gmail.com Mon Aug 7 13:22:29 2017 From: ben.v.root at gmail.com (Benjamin Root) Date: Mon, 7 Aug 2017 13:22:29 -0400 Subject: [Matplotlib-users] Plot of array of shape (N, N, N) in form of sphere In-Reply-To: References: <1501172147860-48103.post@n5.nabble.com> Message-ID: Another fantastic tool is glumpy: https://glumpy.github.io/ (but I am not familiar enough with the API to know how to do volumetric displays). vispy is another possibility, but I am unsure of its current status (it went silent about a year ago). Ben Root On Mon, Aug 7, 2017 at 11:52 AM, Paul Hobson wrote: > This sounds like something you'd want to use yt or mayavi for. While MPL > has basic 3D capabilities (e.g., scatter, line, and surface plots), taking > cuts of volumes is definitely out of our scope unless you've pre-computed > everything. > > -Paul > > On Thu, Jul 27, 2017 at 9:15 AM, cdpnepal wrote: > >> Dear All, >> >> I have an array of shape (N,N,N) of intensity values. How can I plot those >> intensity values in form of sphere. >> Can I show a cut of quadrant of that sphere, so that I can visualize >> intensity not only on the surface but also inside the sphere. >> >> Thanks >> >> >> >> -- >> View this message in context: http://matplotlib.1069221.n5.n >> abble.com/Plot-of-array-of-shape-N-N-N-in-form-of-sphere-tp48103.html >> Sent from the matplotlib - users mailing list archive at Nabble.com. >> _______________________________________________ >> Matplotlib-users mailing list >> Matplotlib-users at python.org >> https://mail.python.org/mailman/listinfo/matplotlib-users >> > > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben.v.root at gmail.com Mon Aug 7 13:27:37 2017 From: ben.v.root at gmail.com (Benjamin Root) Date: Mon, 7 Aug 2017 13:27:37 -0400 Subject: [Matplotlib-users] Problem of memory leak using FigureCanvasTkAgg In-Reply-To: References: <1494500114526.97210@etu.univ-lyon1.fr> Message-ID: The stackoverflow posting notes that mpl v1.1.1 was used, which is 5 years old. I am pretty sure we have made a lot of memory leak fixes since then. I noted as such on SO. Ben Root On Sat, Aug 5, 2017 at 7:48 PM, Thomas Caswell wrote: > It is likely there things are not being garbage collected due to either a > missed reference surviving or the circular references between the various > objects is delaying gc from collecting them (I do not recall the details > exactly off the top of my head, but running gc manually with more > generations may help). > > However, if you are embedding in a GUI you are probably better off just > doing the embedding directly (and skipping `pyplot` entirely, see > https://matplotlib.org/examples/user_interfaces/embedding_in_tk.html ). > Re-using the Figures / Axes / Artists to update the data (rather than > starting from scratch every time) may also prevent the memory leaks _and_ > give you a performance boost. > > Please subscribe to the list so that you can post without moderation. > > Tom > > On Sat, Aug 5, 2017 at 12:36 PM GARCIA PIERRE SIMON p0904379 < > pierre.garcia at etu.univ-lyon1.fr> wrote: > >> Hello, >> >> I'm PhD student in Bioinformatic and I'm working on a project using >> matplotlib and Tkinter but I've got a big problem of memory leak using >> these modules. I'll be very grateful if you could help me to solve this >> problem. Here is the link explaining what happends, with a reduced script: >> http://stackoverflow.com/questions/43097378/matplotlib- >> vs-tkinter-memory-leak-using-figurecanvastkagg >> >> Thank you in advance, >> >> >> Sincerly, >> >> >> >> >> Pierre Garcia, PhD Student >> --------- >> Bases Mol?culaires et Structurales des Syst?mes infectieux-UMR5086 >> Institut de Biologie et Chimie des Prot?ines >> 7 passage du Vercors >> 69 367 Lyon cedex 07 >> --------- >> Laboratoire de Biom?trie et Biologie Evolutive-UMR5558 >> UCBL Lyon 1 -B?t. Gr?gory Mendel >> 43 bd du 11 novembre 1918 >> 69622 VILLEURBANNE cedex >> >> >> _______________________________________________ >> 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 emilia.petrisor at gmail.com Mon Aug 7 14:10:24 2017 From: emilia.petrisor at gmail.com (empet) Date: Mon, 7 Aug 2017 11:10:24 -0700 (MST) Subject: [Matplotlib-users] Plot of array of shape (N, N, N) in form of sphere In-Reply-To: <1501172147860-48103.post@n5.nabble.com> References: <1501172147860-48103.post@n5.nabble.com> Message-ID: <1502129424254-48170.post@n5.nabble.com> Here is a notebook that illustrates how to work with volumetric data in Plotly: http://nbviewer.jupyter.org/github/empet/Plotly-plots/blob/master/Plotly-Slice-in-volumetric-data.ipynb Another possibility is to define a slice in a volume as a triangulated isosurface, via skimage.measure.marching_cubes. Em -- View this message in context: http://matplotlib.1069221.n5.nabble.com/Plot-of-array-of-shape-N-N-N-in-form-of-sphere-tp48103p48170.html Sent from the matplotlib - users mailing list archive at Nabble.com. From azarmi at gmail.com Mon Aug 7 14:01:52 2017 From: azarmi at gmail.com (Arash Azarmi) Date: Mon, 7 Aug 2017 11:01:52 -0700 Subject: [Matplotlib-users] animation in thread In-Reply-To: References: <1495666441748-48055.post@n5.nabble.com> <1495666809985-48056.post@n5.nabble.com> Message-ID: main thread is owning the GUI. My Python installation runs Tkinter version : 8.5 and this happens with Tkinter. I ran the same code on another machine which used another GUI framework(not sure what was it) and it went well. So I guess something is wrong with Tkinter. On Sat, Aug 5, 2017 at 4:31 PM, Thomas Caswell wrote: > GUI frameworks tend to require they be on the main thread. Which backend > / gui framework are you using here? > > In general you will have to arrange things so that the main thread owns > the GUI windows + plotting and the child threads own the computation. > > Tom > > On Sat, Aug 5, 2017 at 12:37 PM arash wrote: > >> (Resending to correct formatting) >> >> I am new to matplotlib and I am trying to get started with animation >> library. >> There is an example here for a simple strip chart: >> >> https://matplotlib.org/examples/animation/strip_chart_demo.html >> >> I tried to use this example in a thread. I created a simple >> *threading.Thread* class, and in it's *run()* method, called: >> >> *ani = animation.FuncAnimation(fig, scope.update, emitter, >> interval=10,True) >> plt.show()* >> >> here is class: >> >> * >> import matplotlib.pyplot as plt >> import matplotlib.animation as animation >> >> class graph(threading.Thread): >> >> def __init__(self, feeder): >> threading.Thread.__init__(self) >> self.fig, self.ax = plt.subplots() >> self.scope = Scope(self.ax) >> self.feeder=feeder >> self.running=True >> >> def run(self): >> while self.running: >> ani = animation.FuncAnimation(self.fig, self.scope.update, >> self.feeder.emit_ch1(), interval=1, blit=True) >> plt.show() >> * >> but when I start this thread, it never shows the windows. Isn't this right >> usage? >> >> >> >> -- >> View this message in context: http://matplotlib.1069221.n5. >> nabble.com/animation-in-thread-tp48055p48056.html >> Sent from the matplotlib - users mailing list archive at Nabble.com. >> _______________________________________________ >> Matplotlib-users mailing list >> Matplotlib-users at python.org >> https://mail.python.org/mailman/listinfo/matplotlib-users >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From stefanschubi at googlemail.com Tue Aug 8 00:47:52 2017 From: stefanschubi at googlemail.com (stefanxfg) Date: Mon, 7 Aug 2017 21:47:52 -0700 (MST) Subject: [Matplotlib-users] Fwd: Embedding, Drawing, Curser in Tkinter In-Reply-To: References: <1494479878318-48038.post@n5.nabble.com> Message-ID: <1502167672541-48173.post@n5.nabble.com> Hi Thomas, okay we can communicate here. -- View this message in context: http://matplotlib.1069221.n5.nabble.com/Embedding-Drawing-Curser-in-Tkinter-tp48038p48173.html Sent from the matplotlib - users mailing list archive at Nabble.com. From danjames95 at live.co.uk Tue Aug 8 11:10:03 2017 From: danjames95 at live.co.uk (danjames95) Date: Tue, 8 Aug 2017 08:10:03 -0700 (MST) Subject: [Matplotlib-users] Single Colorbar for multiple subplots In-Reply-To: References: <1500474709725-48091.post@n5.nabble.com> <66035CFC-12AD-4F06-9A2B-4581EC8533A2@uvic.ca> Message-ID: <1502205003426-48174.post@n5.nabble.com> I have managed to sort this using cbax=fig.add_axes. Thank you for your help! Thanks, Dan -- View this message in context: http://matplotlib.1069221.n5.nabble.com/Single-Colorbar-for-multiple-subplots-tp48091p48174.html Sent from the matplotlib - users mailing list archive at Nabble.com. From pilar.rey.del.castillo at gmail.com Wed Aug 9 05:15:36 2017 From: pilar.rey.del.castillo at gmail.com (Pilar Rey del Castillo) Date: Wed, 9 Aug 2017 11:15:36 +0200 Subject: [Matplotlib-users] Orientation of a stackplot Message-ID: Please, is it possible to change the X-Y axis in a stackplot, similarly to what is done using barh with a bar graph? Many thanks, -------------- next part -------------- An HTML attachment was scrubbed... URL: From mail.python.org at gethmann.org Wed Aug 9 07:54:54 2017 From: mail.python.org at gethmann.org (Julian Gethmann) Date: Wed, 9 Aug 2017 13:54:54 +0200 Subject: [Matplotlib-users] tuple-marker in style sheet Message-ID: <92b44729-f13e-d05b-80c2-db77d87f28ee@gethmann.org> Hallo, is it possible, and if so how, to define a marker with the tuple definition (numsides, style, angle) [1] inside a style sheet (or matplotlibrc)? For normal markers I use the axes.prop_cycle like ``` axes.prop_cycle: cycler("marker", ["x", "+", "1"]) ``` . If I now want to insert a tuple like marker, ``` axes.prop_cycle: cycler("marker", ["x", "+", (5, 2, 1)]) ``` then it is being transformed into a string `"(5, 2, 1)"`. If I don't use parenthesis like in other tuple values in the matplotlibrc (e. g. `#lines.dashed_pattern : 2.8, 1.`[2]) then it is interpreted as three different marker styles which do not exist [3]. [1] http://matplotlib.org/api/markers_api.html [2] http://matplotlib.org/_static/matplotlibrc [3] in my example: `ValueError: Unrecognized marker style 5` Many thanks, Julian From ben.v.root at gmail.com Wed Aug 9 10:17:25 2017 From: ben.v.root at gmail.com (Benjamin Root) Date: Wed, 9 Aug 2017 10:17:25 -0400 Subject: [Matplotlib-users] tuple-marker in style sheet In-Reply-To: <92b44729-f13e-d05b-80c2-db77d87f28ee@gethmann.org> References: <92b44729-f13e-d05b-80c2-db77d87f28ee@gethmann.org> Message-ID: This *might* be fixed in master. Which version of matplotlib are you using? On Wed, Aug 9, 2017 at 7:54 AM, Julian Gethmann < mail.python.org at gethmann.org> wrote: > Hallo, > > is it possible, and if so how, to define a marker with the tuple > definition (numsides, style, angle) [1] inside a style sheet (or > matplotlibrc)? > > For normal markers I use the axes.prop_cycle like > ``` > axes.prop_cycle: cycler("marker", ["x", "+", "1"]) > ``` > . If I now want to insert a tuple like marker, > ``` > axes.prop_cycle: cycler("marker", ["x", "+", (5, 2, 1)]) > ``` > then it is being transformed into a string `"(5, 2, 1)"`. > If I don't use parenthesis like in other tuple values in the matplotlibrc > (e. g. `#lines.dashed_pattern : 2.8, 1.`[2]) then it is interpreted as > three different marker styles which do not exist [3]. > > [1] http://matplotlib.org/api/markers_api.html > [2] http://matplotlib.org/_static/matplotlibrc > [3] in my example: `ValueError: Unrecognized marker style 5` > > > Many thanks, > > Julian > _______________________________________________ > 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 mail.python.org at gethmann.org Wed Aug 9 10:53:38 2017 From: mail.python.org at gethmann.org (Julian Gethmann) Date: Wed, 9 Aug 2017 16:53:38 +0200 Subject: [Matplotlib-users] tuple-marker in style sheet In-Reply-To: References: <92b44729-f13e-d05b-80c2-db77d87f28ee@gethmann.org> Message-ID: <6909b4cd-b3eb-1f2f-1ef6-e48a8c782cd9@gethmann.org> On 08/09/2017 04:17 PM, Benjamin Root wrote: > This *might* be fixed in master. Which version of matplotlib are you using? Ah, ok. I tested it with matplotlib 2.0.2 (anaconda Python 3.6.2 build) > > On Wed, Aug 9, 2017 at 7:54 AM, Julian Gethmann < > mail.python.org at gethmann.org> wrote: > >> Hallo, >> >> is it possible, and if so how, to define a marker with the tuple >> definition (numsides, style, angle) [1] inside a style sheet (or >> matplotlibrc)? >> >> For normal markers I use the axes.prop_cycle like >> ``` >> axes.prop_cycle: cycler("marker", ["x", "+", "1"]) >> ``` >> . If I now want to insert a tuple like marker, >> ``` >> axes.prop_cycle: cycler("marker", ["x", "+", (5, 2, 1)]) >> ``` >> then it is being transformed into a string `"(5, 2, 1)"`. >> If I don't use parenthesis like in other tuple values in the matplotlibrc >> (e. g. `#lines.dashed_pattern : 2.8, 1.`[2]) then it is interpreted as >> three different marker styles which do not exist [3]. >> >> [1] http://matplotlib.org/api/markers_api.html >> [2] http://matplotlib.org/_static/matplotlibrc >> [3] in my example: `ValueError: Unrecognized marker style 5` >> >> >> Many thanks, >> >> Julian >> _______________________________________________ >> Matplotlib-users mailing list >> Matplotlib-users at python.org >> https://mail.python.org/mailman/listinfo/matplotlib-users >> > From mail.python.org at gethmann.org Wed Aug 9 11:35:54 2017 From: mail.python.org at gethmann.org (Julian) Date: Wed, 9 Aug 2017 17:35:54 +0200 Subject: [Matplotlib-users] tuple-marker in style sheet In-Reply-To: <6909b4cd-b3eb-1f2f-1ef6-e48a8c782cd9@gethmann.org> References: <92b44729-f13e-d05b-80c2-db77d87f28ee@gethmann.org> <6909b4cd-b3eb-1f2f-1ef6-e48a8c782cd9@gethmann.org> Message-ID: On 08/09/2017 04:53 PM, Julian Gethmann wrote: > On 08/09/2017 04:17 PM, Benjamin Root wrote: >> This *might* be fixed in master. Which version of matplotlib are you >> using? > Ah, ok. I tested it with matplotlib 2.0.2 (anaconda Python 3.6.2 build) Now I also tested the current master branch from github, but I also get the same error message if I use parenthesis. Do you know of which issue you were thinking of? >> >> On Wed, Aug 9, 2017 at 7:54 AM, Julian Gethmann < >> mail.python.org at gethmann.org> wrote: >> >>> Hallo, >>> >>> is it possible, and if so how, to define a marker with the tuple >>> definition (numsides, style, angle) [1] inside a style sheet (or >>> matplotlibrc)? >>> >>> For normal markers I use the axes.prop_cycle like >>> ``` >>> axes.prop_cycle: cycler("marker", ["x", "+", "1"]) >>> ``` >>> . If I now want to insert a tuple like marker, >>> ``` >>> axes.prop_cycle: cycler("marker", ["x", "+", (5, 2, 1)]) >>> ``` >>> then it is being transformed into a string `"(5, 2, 1)"`. >>> If I don't use parenthesis like in other tuple values in the >>> matplotlibrc >>> (e. g. `#lines.dashed_pattern : 2.8, 1.`[2]) then it is interpreted as >>> three different marker styles which do not exist [3]. >>> >>> [1] http://matplotlib.org/api/markers_api.html >>> [2] http://matplotlib.org/_static/matplotlibrc >>> [3] in my example: `ValueError: Unrecognized marker style 5` >>> >>> >>> Many thanks, >>> >>> Julian >>> _______________________________________________ >>> 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 ben.v.root at gmail.com Wed Aug 9 11:50:23 2017 From: ben.v.root at gmail.com (Benjamin Root) Date: Wed, 9 Aug 2017 11:50:23 -0400 Subject: [Matplotlib-users] tuple-marker in style sheet In-Reply-To: References: <92b44729-f13e-d05b-80c2-db77d87f28ee@gethmann.org> <6909b4cd-b3eb-1f2f-1ef6-e48a8c782cd9@gethmann.org> Message-ID: Hmmm, might be an issue with respect to specifying custom dash styles. It had a similar problem to this. On Wed, Aug 9, 2017 at 11:35 AM, Julian wrote: > On 08/09/2017 04:53 PM, Julian Gethmann wrote: > >> On 08/09/2017 04:17 PM, Benjamin Root wrote: >> >>> This *might* be fixed in master. Which version of matplotlib are you >>> using? >>> >> Ah, ok. I tested it with matplotlib 2.0.2 (anaconda Python 3.6.2 build) >> > Now I also tested the current master branch from github, but I also get > the same error message if I use parenthesis. > Do you know of which issue you were thinking of? > > >>> On Wed, Aug 9, 2017 at 7:54 AM, Julian Gethmann < >>> mail.python.org at gethmann.org> wrote: >>> >>> Hallo, >>>> >>>> is it possible, and if so how, to define a marker with the tuple >>>> definition (numsides, style, angle) [1] inside a style sheet (or >>>> matplotlibrc)? >>>> >>>> For normal markers I use the axes.prop_cycle like >>>> ``` >>>> axes.prop_cycle: cycler("marker", ["x", "+", "1"]) >>>> ``` >>>> . If I now want to insert a tuple like marker, >>>> ``` >>>> axes.prop_cycle: cycler("marker", ["x", "+", (5, 2, 1)]) >>>> ``` >>>> then it is being transformed into a string `"(5, 2, 1)"`. >>>> If I don't use parenthesis like in other tuple values in the >>>> matplotlibrc >>>> (e. g. `#lines.dashed_pattern : 2.8, 1.`[2]) then it is interpreted as >>>> three different marker styles which do not exist [3]. >>>> >>>> [1] http://matplotlib.org/api/markers_api.html >>>> [2] http://matplotlib.org/_static/matplotlibrc >>>> [3] in my example: `ValueError: Unrecognized marker style 5` >>>> >>>> >>>> Many thanks, >>>> >>>> Julian >>>> _______________________________________________ >>>> Matplotlib-users mailing list >>>> Matplotlib-users at python.org >>>> https://mail.python.org/mailman/listinfo/matplotlib-users >>>> >>>> >>> >> _______________________________________________ >> Matplotlib-users mailing list >> Matplotlib-users at python.org >> https://mail.python.org/mailman/listinfo/matplotlib-users >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben.v.root at gmail.com Fri Aug 11 13:13:02 2017 From: ben.v.root at gmail.com (Benjamin Root) Date: Fri, 11 Aug 2017 13:13:02 -0400 Subject: [Matplotlib-users] Basemap / mplot3d mashup Message-ID: For the longest time, I have avoided trying to combine Basemap and mplot3d because I knew that they both predated the transforms system and that they wouldn't be able to properly work together. However, today, I looked at the problem differently for some reason and realized that it might actually be possible for them to work together in a hacky sort of way. ``` from mpl_toolkits.basemap import Basemap from mpl_toolkits.mplot3d import axes3d, art3d from matplotlib import pyplot as plt fig, ax = plt.subplots(subplot_kw=dict(projection='3d')) bm = Basemap(projection='merc', lat_0=57, lon_0=-135, resolution='l', llcrnrlon=-130, llcrnrlat=20, urcrnrlon=-65, urcrnrlat=55) map(art3d.patch_2d_to_3d, bm.fillcontinents(color='wheat', lake_color='aqua')) art3d.line_collection_2d_to_3d(art3d.bm.drawcoastlines()) art3d.line_collection_2d_to_3d(bm.drawstates()) art3d.line_collection_2d_to_3d(ret4 = bm.drawcountries()) plt.show() ``` Still a bit buggy. The lakes, states and countries aren't showing up, but it is a start! -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: basemap_mplot3d_mashup.png Type: image/png Size: 72568 bytes Desc: not available URL: From kgb2020 at protonmail.ch Fri Aug 11 14:25:58 2017 From: kgb2020 at protonmail.ch (kgb2020) Date: Fri, 11 Aug 2017 14:25:58 -0400 Subject: [Matplotlib-users] Trying to reproduce plot with a certain colormap Message-ID: Hello everybody, I have this figure done by a colleague quite a while ago in matplotlib: https://image.ibb.co/cxGKSF/tst0.png Unfortunately, I no longer have contact with my colleague to ask the particular colormap she used in matplotlib. I have looked through the gallery at https://matplotlib.org/examples/color/colormaps_reference.html but I am unable to find that colormap she used there. Can anybody recognize the colormap she used in that plot? Thank you! Best, Kris Sent with [ProtonMail](https://protonmail.com) Secure Email. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jklymak at uvic.ca Fri Aug 11 14:34:56 2017 From: jklymak at uvic.ca (Jody Klymak) Date: Fri, 11 Aug 2017 11:34:56 -0700 Subject: [Matplotlib-users] Trying to reproduce plot with a certain colormap In-Reply-To: References: Message-ID: <9FF1046A-116F-4E68-B1DC-AA2924018A48@uvic.ca> Hi Kris, That one is called ?jet?, though it looks like she applied a bit of a normalization to it to move the (green) center to lower values? https://matplotlib.org/users/colormapnorms.html (see the last subsection: ?Two linear ranges?) Cheers, Jody On 11 Aug 2017, at 11:25, kgb2020 via Matplotlib-users wrote: > Hello everybody, > > I have this figure done by a colleague quite a while ago in > matplotlib: > > https://image.ibb.co/cxGKSF/tst0.png > > Unfortunately, I no longer have contact with my colleague to ask the > particular colormap she used in matplotlib. I have looked through the > gallery at > https://matplotlib.org/examples/color/colormaps_reference.html but I > am unable to find that colormap she used there. > > Can anybody recognize the colormap she used in that plot? > > Thank you! > Best, Kris > > Sent with [ProtonMail](https://protonmail.com) Secure Email. > _______________________________________________ > 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 Aug 11 14:43:45 2017 From: ben.v.root at gmail.com (Benjamin Root) Date: Fri, 11 Aug 2017 14:43:45 -0400 Subject: [Matplotlib-users] Trying to reproduce plot with a certain colormap In-Reply-To: <9FF1046A-116F-4E68-B1DC-AA2924018A48@uvic.ca> References: <9FF1046A-116F-4E68-B1DC-AA2924018A48@uvic.ca> Message-ID: Not jet, it doesn't go through cyan. Looks more like coolwarm, to me, or maybe RdYlGn_r (but the yellow isn't right, either...). I am also not completely convinced it was made in matplotlib. The 3d plot's projection isn't the same as mplot3d's projection. On Fri, Aug 11, 2017 at 2:34 PM, Jody Klymak wrote: > Hi Kris, > > That one is called ?jet?, though it looks like she applied a bit of a > normalization to it to move the (green) center to lower values? > > https://matplotlib.org/users/colormapnorms.html (see the last subsection: > ?Two linear ranges?) > > Cheers, Jody > > On 11 Aug 2017, at 11:25, kgb2020 via Matplotlib-users wrote: > > Hello everybody, > > I have this figure done by a colleague quite a while ago in matplotlib: > > https://image.ibb.co/cxGKSF/tst0.png > > Unfortunately, I no longer have contact with my colleague to ask the > particular colormap she used in matplotlib. I have looked through the > gallery at https://matplotlib.org/examples/color/colormaps_reference.html but > I am unable to find that colormap she used there. > > Can anybody recognize the colormap she used in that plot? > > Thank you! > Best, Kris > > > Sent with ProtonMail Secure Email. > > _______________________________________________ > 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 vincent.adrien at gmail.com Fri Aug 11 14:51:23 2017 From: vincent.adrien at gmail.com (vincent.adrien at gmail.com) Date: Fri, 11 Aug 2017 11:51:23 -0700 Subject: [Matplotlib-users] Trying to reproduce plot with a certain colormap In-Reply-To: References: <9FF1046A-116F-4E68-B1DC-AA2924018A48@uvic.ca> Message-ID: <9769af54-a37e-fb21-33a4-eb80bd719494@gmail.com> Hi all, I agree with Ben that it does not look like jet to me: the bright light blue seems to be missing. FWIW, "Spectral" (with a capital S) might be the closest colormap among the built-in ones in Matplotlib, but it is still more ?pastel-ish? than Kris? example. Best, Adrien On 08/11/2017 11:43 AM, Benjamin Root wrote: > Not jet, it doesn't go through cyan. Looks more like coolwarm, to me, or > maybe RdYlGn_r (but the yellow isn't right, either...). > > I am also not completely convinced it was made in matplotlib. The 3d > plot's projection isn't the same as mplot3d's projection. > > On Fri, Aug 11, 2017 at 2:34 PM, Jody Klymak > wrote: > > __ > > Hi Kris, > > That one is called ?jet?, though it looks like she applied a bit of > a normalization to it to move the (green) center to lower values? > > https://matplotlib.org/users/colormapnorms.html > (see the last > subsection: ?Two linear ranges?) > > Cheers, Jody > > On 11 Aug 2017, at 11:25, kgb2020 via Matplotlib-users wrote: > > Hello everybody, > > I have this figure done by a colleague quite a while ago in > matplotlib: > > https://image.ibb.co/cxGKSF/tst0.png > > > Unfortunately, I no longer have contact with my colleague to ask > the particular colormap she used in matplotlib. I have looked > through the gallery at > https://matplotlib.org/examples/color/colormaps_reference.html > but > I am unable to find that colormap she used there. > > Can anybody recognize the colormap she used in that plot? > > Thank you! > Best, Kris > > > Sent with ProtonMail Secure Email. > > _______________________________________________ > 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 > > > > > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > From jklymak at uvic.ca Fri Aug 11 15:17:53 2017 From: jklymak at uvic.ca (Klymak Jody) Date: Fri, 11 Aug 2017 12:17:53 -0700 Subject: [Matplotlib-users] Trying to reproduce plot with a certain colormap In-Reply-To: <9769af54-a37e-fb21-33a4-eb80bd719494@gmail.com> References: <9FF1046A-116F-4E68-B1DC-AA2924018A48@uvic.ca> <9769af54-a37e-fb21-33a4-eb80bd719494@gmail.com> Message-ID: This image has pretty clearly been converted to CMYK hence the dullness. Pretty convinced that's what jet looks like after a CMYK conversion. Cheers. Jody Sent from my iPhone > On Aug 11, 2017, at 11:51, "vincent.adrien at gmail.com" wrote: > > Hi all, > > I agree with Ben that it does not look like jet to me: the bright light blue seems to be missing. FWIW, "Spectral" (with a capital S) might be the closest colormap among the built-in ones in Matplotlib, but it is still more ?pastel-ish? than Kris? example. > > Best, > Adrien > >> On 08/11/2017 11:43 AM, Benjamin Root wrote: >> Not jet, it doesn't go through cyan. Looks more like coolwarm, to me, or maybe RdYlGn_r (but the yellow isn't right, either...). >> I am also not completely convinced it was made in matplotlib. The 3d plot's projection isn't the same as mplot3d's projection. >> On Fri, Aug 11, 2017 at 2:34 PM, Jody Klymak > wrote: >> __ >> Hi Kris, >> That one is called ?jet?, though it looks like she applied a bit of >> a normalization to it to move the (green) center to lower values? >> https://matplotlib.org/users/colormapnorms.html >> (see the last >> subsection: ?Two linear ranges?) >> Cheers, Jody >> On 11 Aug 2017, at 11:25, kgb2020 via Matplotlib-users wrote: >> Hello everybody, >> I have this figure done by a colleague quite a while ago in >> matplotlib: >> https://image.ibb.co/cxGKSF/tst0.png >> >> Unfortunately, I no longer have contact with my colleague to ask >> the particular colormap she used in matplotlib. I have looked >> through the gallery at >> https://matplotlib.org/examples/color/colormaps_reference.html >> but >> I am unable to find that colormap she used there. >> Can anybody recognize the colormap she used in that plot? >> Thank you! >> Best, Kris >> Sent with ProtonMail Secure Email. >> _______________________________________________ >> 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 >> >> _______________________________________________ >> 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 jklymak at uvic.ca Fri Aug 11 15:53:13 2017 From: jklymak at uvic.ca (Jody Klymak) Date: Fri, 11 Aug 2017 12:53:13 -0700 Subject: [Matplotlib-users] Trying to reproduce plot with a certain colormap In-Reply-To: References: <9FF1046A-116F-4E68-B1DC-AA2924018A48@uvic.ca> <9769af54-a37e-fb21-33a4-eb80bd719494@gmail.com> Message-ID: <55BC54E7-4AB8-4E23-B295-6894C426F9F5@uvic.ca> On 11 Aug 2017, at 12:17, Klymak Jody wrote: > This image has pretty clearly been converted to CMYK hence the > dullness. Pretty convinced that's what jet looks like after a CMYK > conversion. See: https://gist.github.com/jklymak/744db8cc538e5757ecc4eb4977bff3a3 CMYK conversion was done in Illustrator. You could still argue that matplotlib?s ?jet? gets darker at the high reds and low blues, and maybe the cyan is more bright. But you have to be pretty careful w/ CMYK conversions because it depends on the profiles used etc etc. I?d buy the argument that this is a matlab jet versus a matplotlib jet, but I think most of the perceived difference is because a CMYK conversion happened somewhere along the way. Cheers, Jody PS, I note the image *says* that it is RGB, but then my converted image also says the same thing. > > Cheers. Jody > > Sent from my iPhone > >> On Aug 11, 2017, at 11:51, "vincent.adrien at gmail.com" >> wrote: >> >> Hi all, >> >> I agree with Ben that it does not look like jet to me: the bright >> light blue seems to be missing. FWIW, "Spectral" (with a capital S) >> might be the closest colormap among the built-in ones in Matplotlib, >> but it is still more ?pastel-ish? than Kris? example. >> >> Best, >> Adrien >> >>> On 08/11/2017 11:43 AM, Benjamin Root wrote: >>> Not jet, it doesn't go through cyan. Looks more like coolwarm, to >>> me, or maybe RdYlGn_r (but the yellow isn't right, either...). >>> I am also not completely convinced it was made in matplotlib. The 3d >>> plot's projection isn't the same as mplot3d's projection. >>> On Fri, Aug 11, 2017 at 2:34 PM, Jody Klymak >> > wrote: >>> __ >>> Hi Kris, >>> That one is called ?jet?, though it looks like she applied a >>> bit of >>> a normalization to it to move the (green) center to lower >>> values? >>> https://matplotlib.org/users/colormapnorms.html >>> (see the last >>> subsection: ?Two linear ranges?) >>> Cheers, Jody >>> On 11 Aug 2017, at 11:25, kgb2020 via Matplotlib-users wrote: >>> Hello everybody, >>> I have this figure done by a colleague quite a while ago in >>> matplotlib: >>> https://image.ibb.co/cxGKSF/tst0.png >>> >>> Unfortunately, I no longer have contact with my colleague to >>> ask >>> the particular colormap she used in matplotlib. I have looked >>> through the gallery at >>> https://matplotlib.org/examples/color/colormaps_reference.html >>> >>> but >>> I am unable to find that colormap she used there. >>> Can anybody recognize the colormap she used in that plot? >>> Thank you! >>> Best, Kris >>> Sent with ProtonMail Secure Email. >>> _______________________________________________ >>> 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 >>> >>> _______________________________________________ >>> 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 > > _______________________________________________ > 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 Aug 11 16:02:07 2017 From: ben.v.root at gmail.com (Benjamin Root) Date: Fri, 11 Aug 2017 16:02:07 -0400 Subject: [Matplotlib-users] Trying to reproduce plot with a certain colormap In-Reply-To: <55BC54E7-4AB8-4E23-B295-6894C426F9F5@uvic.ca> References: <9FF1046A-116F-4E68-B1DC-AA2924018A48@uvic.ca> <9769af54-a37e-fb21-33a4-eb80bd719494@gmail.com> <55BC54E7-4AB8-4E23-B295-6894C426F9F5@uvic.ca> Message-ID: The CMYK converted jet still has a bright yellow in there that is not in the one showed by Kris at all. On Fri, Aug 11, 2017 at 3:53 PM, Jody Klymak wrote: > On 11 Aug 2017, at 12:17, Klymak Jody wrote: > > This image has pretty clearly been converted to CMYK hence the dullness. > Pretty convinced that's what jet looks like after a CMYK conversion. > > See: > > https://gist.github.com/jklymak/744db8cc538e5757ecc4eb4977bff3a3 > > CMYK conversion was done in Illustrator. > > You could still argue that matplotlib?s ?jet? gets darker at the high reds > and low blues, and maybe the cyan is more bright. But you have to be pretty > careful w/ CMYK conversions because it depends on the profiles used etc > etc. I?d buy the argument that this is a matlab jet versus a matplotlib > jet, but I think most of the perceived difference is because a CMYK > conversion happened somewhere along the way. > > Cheers, Jody > > PS, I note the image *says* that it is RGB, but then my converted image > also says the same thing. > > Cheers. Jody > > Sent from my iPhone > > On Aug 11, 2017, at 11:51, "vincent.adrien at gmail.com" < > vincent.adrien at gmail.com> wrote: > > Hi all, > > I agree with Ben that it does not look like jet to me: the bright light > blue seems to be missing. FWIW, "Spectral" (with a capital S) might be the > closest colormap among the built-in ones in Matplotlib, but it is still > more ?pastel-ish? than Kris? example. > > Best, > Adrien > > On 08/11/2017 11:43 AM, Benjamin Root wrote: > Not jet, it doesn't go through cyan. Looks more like coolwarm, to me, or > maybe RdYlGn_r (but the yellow isn't right, either...). > I am also not completely convinced it was made in matplotlib. The 3d > plot's projection isn't the same as mplot3d's projection. > On Fri, Aug 11, 2017 at 2:34 PM, Jody Klymak mailto:jklymak at uvic.ca >> wrote: > __ > Hi Kris, > That one is called ?jet?, though it looks like she applied a bit of > a normalization to it to move the (green) center to lower values? > https://matplotlib.org/users/colormapnorms.html > (see the last > subsection: ?Two linear ranges?) > Cheers, Jody > On 11 Aug 2017, at 11:25, kgb2020 via Matplotlib-users wrote: > Hello everybody, > I have this figure done by a colleague quite a while ago in > matplotlib: > https://image.ibb.co/cxGKSF/tst0.png > > Unfortunately, I no longer have contact with my colleague to ask > the particular colormap she used in matplotlib. I have looked > through the gallery at > https://matplotlib.org/examples/color/colormaps_reference.html > but > I am unable to find that colormap she used there. > Can anybody recognize the colormap she used in that plot? > Thank you! > Best, Kris > Sent with ProtonMail Secure Email. > _______________________________________________ > 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 > > _______________________________________________ > 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 > > _______________________________________________ > 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 vincent.adrien at gmail.com Fri Aug 11 16:14:22 2017 From: vincent.adrien at gmail.com (vincent.adrien at gmail.com) Date: Fri, 11 Aug 2017 13:14:22 -0700 Subject: [Matplotlib-users] Trying to reproduce plot with a certain colormap In-Reply-To: References: <9FF1046A-116F-4E68-B1DC-AA2924018A48@uvic.ca> <9769af54-a37e-fb21-33a4-eb80bd719494@gmail.com> <55BC54E7-4AB8-4E23-B295-6894C426F9F5@uvic.ca> Message-ID: Thank you Jody, I did not know that CMYK conversion could alter colors that much; that is interesting. Ben, maybe my cheap screen is tricking me here, but I would have say that what is still missing in the CMYK conversion is the cyan/bright blue part, not the yellow one. Anyway, as Jody wrote, it might just be a matter of CMYK profile, doesn?t it? Best, Adrien On 08/11/2017 01:02 PM, Benjamin Root wrote: > The CMYK converted jet still has a bright yellow in there that is not in > the one showed by Kris at all. > > On Fri, Aug 11, 2017 at 3:53 PM, Jody Klymak > wrote: > > __ > > On 11 Aug 2017, at 12:17, Klymak Jody wrote: > > This image has pretty clearly been converted to CMYK hence the > dullness. Pretty convinced that's what jet looks like after a > CMYK conversion. > > See: > > https://gist.github.com/jklymak/744db8cc538e5757ecc4eb4977bff3a3 > > > CMYK conversion was done in Illustrator. > > You could still argue that matplotlib?s ?jet? gets darker at the > high reds and low blues, and maybe the cyan is more bright. But you > have to be pretty careful w/ CMYK conversions because it depends on > the profiles used etc etc. I?d buy the argument that this is a > matlab jet versus a matplotlib jet, but I think most of the > perceived difference is because a CMYK conversion happened somewhere > along the way. > > Cheers, Jody > > PS, I note the image /says/ that it is RGB, but then my converted > image also says the same thing. > > Cheers. Jody > > Sent from my iPhone > > On Aug 11, 2017, at 11:51, "vincent.adrien at gmail.com > " > wrote: > > Hi all, > > I agree with Ben that it does not look like jet to me: the > bright light blue seems to be missing. FWIW, "Spectral" > (with a capital S) might be the closest colormap among the > built-in ones in Matplotlib, but it is still more > ?pastel-ish? than Kris? example. > > Best, > Adrien > > On 08/11/2017 11:43 AM, Benjamin Root wrote: > Not jet, it doesn't go through cyan. Looks more like > coolwarm, to me, or maybe RdYlGn_r (but the yellow isn't > right, either...). > I am also not completely convinced it was made in > matplotlib. The 3d plot's projection isn't the same as > mplot3d's projection. > On Fri, Aug 11, 2017 at 2:34 PM, Jody Klymak > > > wrote: > __ > Hi Kris, > That one is called ?jet?, though it looks like she > applied a bit of > a normalization to it to move the (green) center to > lower values? > https://matplotlib.org/users/colormapnorms.html > > > (see > the last > subsection: ?Two linear ranges?) > Cheers, Jody > On 11 Aug 2017, at 11:25, kgb2020 via Matplotlib-users > wrote: > Hello everybody, > I have this figure done by a colleague quite a while ago in > matplotlib: > https://image.ibb.co/cxGKSF/tst0.png > > > > Unfortunately, I no longer have contact with my > colleague to ask > the particular colormap she used in matplotlib. I have > looked > through the gallery at > https://matplotlib.org/examples/color/colormaps_reference.html > > > > but > I am unable to find that colormap she used there. > Can anybody recognize the colormap she used in that plot? > Thank you! > Best, Kris > Sent with ProtonMail Secure Email. > _______________________________________________ > 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 > > > _______________________________________________ > 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 > > > _______________________________________________ > 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 > > > > > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > From ben.v.root at gmail.com Fri Aug 11 16:50:12 2017 From: ben.v.root at gmail.com (Benjamin Root) Date: Fri, 11 Aug 2017 16:50:12 -0400 Subject: [Matplotlib-users] Trying to reproduce plot with a certain colormap In-Reply-To: References: <9FF1046A-116F-4E68-B1DC-AA2924018A48@uvic.ca> <9769af54-a37e-fb21-33a4-eb80bd719494@gmail.com> <55BC54E7-4AB8-4E23-B295-6894C426F9F5@uvic.ca> Message-ID: Yes, there is also still the cyan. I am doubtful that just having a different profile would be enough to change this. I think either RdYlGn_r or coolwarm is a lot closer than jet put through a cmyk conversion. I am going with the philosophy of the simplest model that explains the most amount of the data observed. A cmyk conversion isn't out of the question because many publications do that conversion. But if that was the case, then putting RdYlGn_r or coolwarm through CMYK conversion might actually bring it closer to your example than CMYK converted jet is. Also, keep in mind, I am still not convinced that this is even matplotlib in origin due to certain features of the 3d plot (I am the maintainer of mplot3d). I don't know if it looks like matlab's version, though, as I don't have experience with it. Ben On Fri, Aug 11, 2017 at 4:14 PM, vincent.adrien at gmail.com < vincent.adrien at gmail.com> wrote: > Thank you Jody, I did not know that CMYK conversion could alter colors > that much; that is interesting. > > Ben, maybe my cheap screen is tricking me here, but I would have say that > what is still missing in the CMYK conversion is the cyan/bright blue part, > not the yellow one. Anyway, as Jody wrote, it might just be a matter of > CMYK profile, doesn?t it? > > Best, > Adrien > > On 08/11/2017 01:02 PM, Benjamin Root wrote: > >> The CMYK converted jet still has a bright yellow in there that is not in >> the one showed by Kris at all. >> >> On Fri, Aug 11, 2017 at 3:53 PM, Jody Klymak > jklymak at uvic.ca>> wrote: >> >> __ >> >> On 11 Aug 2017, at 12:17, Klymak Jody wrote: >> >> This image has pretty clearly been converted to CMYK hence the >> dullness. Pretty convinced that's what jet looks like after a >> CMYK conversion. >> >> See: >> >> https://gist.github.com/jklymak/744db8cc538e5757ecc4eb4977bff3a3 >> >> >> CMYK conversion was done in Illustrator. >> >> You could still argue that matplotlib?s ?jet? gets darker at the >> high reds and low blues, and maybe the cyan is more bright. But you >> have to be pretty careful w/ CMYK conversions because it depends on >> the profiles used etc etc. I?d buy the argument that this is a >> matlab jet versus a matplotlib jet, but I think most of the >> perceived difference is because a CMYK conversion happened somewhere >> along the way. >> >> Cheers, Jody >> >> PS, I note the image /says/ that it is RGB, but then my converted >> image also says the same thing. >> >> Cheers. Jody >> >> Sent from my iPhone >> >> On Aug 11, 2017, at 11:51, "vincent.adrien at gmail.com >> " > >> > wrote: >> >> Hi all, >> >> I agree with Ben that it does not look like jet to me: the >> bright light blue seems to be missing. FWIW, "Spectral" >> (with a capital S) might be the closest colormap among the >> built-in ones in Matplotlib, but it is still more >> ?pastel-ish? than Kris? example. >> >> Best, >> Adrien >> >> On 08/11/2017 11:43 AM, Benjamin Root wrote: >> Not jet, it doesn't go through cyan. Looks more like >> coolwarm, to me, or maybe RdYlGn_r (but the yellow isn't >> right, either...). >> I am also not completely convinced it was made in >> matplotlib. The 3d plot's projection isn't the same as >> mplot3d's projection. >> On Fri, Aug 11, 2017 at 2:34 PM, Jody Klymak >> >> > wrote: >> __ >> Hi Kris, >> That one is called ?jet?, though it looks like she >> applied a bit of >> a normalization to it to move the (green) center to >> lower values? >> https://matplotlib.org/users/colormapnorms.html >> >> > > (see >> the last >> subsection: ?Two linear ranges?) >> Cheers, Jody >> On 11 Aug 2017, at 11:25, kgb2020 via Matplotlib-users >> wrote: >> Hello everybody, >> I have this figure done by a colleague quite a while ago >> in >> matplotlib: >> https://image.ibb.co/cxGKSF/tst0.png >> >> > > >> Unfortunately, I no longer have contact with my >> colleague to ask >> the particular colormap she used in matplotlib. I have >> looked >> through the gallery at >> https://matplotlib.org/example >> s/color/colormaps_reference.html >> > es/color/colormaps_reference.html> >> > es/color/colormaps_reference.html >> > es/color/colormaps_reference.html>> >> but >> I am unable to find that colormap she used there. >> Can anybody recognize the colormap she used in that plot? >> Thank you! >> Best, Kris >> Sent with ProtonMail Secure >> Email. >> _______________________________________________ >> Matplotlib-users mailing list >> Matplotlib-users at python.org >> >> > > >> https://mail.python.org/mailman/listinfo/matplotlib-users >> >> > an/listinfo/matplotlib-users >> > an/listinfo/matplotlib-users>> >> _______________________________________________ >> Matplotlib-users mailing list >> Matplotlib-users at python.org >> >> > >> > >> https://mail.python.org/mailman/listinfo/matplotlib-users >> >> > an/listinfo/matplotlib-users >> > an/listinfo/matplotlib-users>> >> _______________________________________________ >> 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 > n.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 >> >> >> >> _______________________________________________ >> 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 >> >> > _______________________________________________ > 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 kgb2020 at protonmail.ch Fri Aug 11 18:06:51 2017 From: kgb2020 at protonmail.ch (kgb2020) Date: Fri, 11 Aug 2017 18:06:51 -0400 Subject: [Matplotlib-users] Trying to reproduce plot with a certain colormap In-Reply-To: References: <9FF1046A-116F-4E68-B1DC-AA2924018A48@uvic.ca> <9769af54-a37e-fb21-33a4-eb80bd719494@gmail.com> <55BC54E7-4AB8-4E23-B295-6894C426F9F5@uvic.ca> Message-ID: <9O9t9MgcE2stMzOG07c0AlV4x0-zSkMjtvDI1Gcwefc7IMAVbv4PkMeLvEh1onF8qZBj7ggQyDk_XUEY-o8t0ZCV408-Ji128JcNJ_J8gVc=@protonmail.ch> Hi, Thanks for the replies. I use MATLAB so I am familiar with jet; but the colors in my colleague's plot looked too "pastelized" that I had my doubts, and finally decided to ask. Best, Kris Sent with [ProtonMail](https://protonmail.com) Secure Email. > -------- Original Message -------- > Subject: Re: [Matplotlib-users] Trying to reproduce plot with a certain colormap > Local Time: August 12, 2017 4:02 AM > UTC Time: August 11, 2017 8:02 PM > From: ben.v.root at gmail.com > To: Jody Klymak > Matplotlib-users , kgb2020 > > The CMYK converted jet still has a bright yellow in there that is not in the one showed by Kris at all. > > On Fri, Aug 11, 2017 at 3:53 PM, Jody Klymak wrote: > >> On 11 Aug 2017, at 12:17, Klymak Jody wrote: >> >>> This image has pretty clearly been converted to CMYK hence the dullness. Pretty convinced that's what jet looks like after a CMYK conversion. >> >> See: >> >> https://gist.github.com/jklymak/744db8cc538e5757ecc4eb4977bff3a3 >> >> CMYK conversion was done in Illustrator. >> >> You could still argue that matplotlib?s ?jet? gets darker at the high reds and low blues, and maybe the cyan is more bright. But you have to be pretty careful w/ CMYK conversions because it depends on the profiles used etc etc. I?d buy the argument that this is a matlab jet versus a matplotlib jet, but I think most of the perceived difference is because a CMYK conversion happened somewhere along the way. >> >> Cheers, Jody >> >> PS, I note the image says that it is RGB, but then my converted image also says the same thing. >> >>> Cheers. Jody >>> >>> Sent from my iPhone >>> >>>> On Aug 11, 2017, at 11:51, "vincent.adrien at gmail.com" wrote: >>>> >>>> Hi all, >>>> >>>> I agree with Ben that it does not look like jet to me: the bright light blue seems to be missing. FWIW, "Spectral" (with a capital S) might be the closest colormap among the built-in ones in Matplotlib, but it is still more ?pastel-ish? than Kris? example. >>>> >>>> Best, >>>> Adrien >>>> >>>>> On 08/11/2017 11:43 AM, Benjamin Root wrote: >>>>> Not jet, it doesn't go through cyan. Looks more like coolwarm, to me, or maybe RdYlGn_r (but the yellow isn't right, either...). >>>>> I am also not completely convinced it was made in matplotlib. The 3d plot's projection isn't the same as mplot3d's projection. >>>>> On Fri, Aug 11, 2017 at 2:34 PM, Jody Klymak > wrote: >>>>> __ >>>>> Hi Kris, >>>>> That one is called ?jet?, though it looks like she applied a bit of >>>>> a normalization to it to move the (green) center to lower values? >>>>> https://matplotlib.org/users/colormapnorms.html >>>>> (see the last >>>>> subsection: ?Two linear ranges?) >>>>> Cheers, Jody >>>>> On 11 Aug 2017, at 11:25, kgb2020 via Matplotlib-users wrote: >>>>> Hello everybody, >>>>> I have this figure done by a colleague quite a while ago in >>>>> matplotlib: >>>>> https://image.ibb.co/cxGKSF/tst0.png >>>>> >>>>> Unfortunately, I no longer have contact with my colleague to ask >>>>> the particular colormap she used in matplotlib. I have looked >>>>> through the gallery at >>>>> https://matplotlib.org/examples/color/colormaps_reference.html >>>>> but >>>>> I am unable to find that colormap she used there. >>>>> Can anybody recognize the colormap she used in that plot? >>>>> Thank you! >>>>> Best, Kris >>>>> Sent with ProtonMail Secure Email. >>>>> _______________________________________________ >>>>> 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 >>>>> >>>>> _______________________________________________ >>>>> 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 >>> >>> _______________________________________________ >>> 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 davidshen84 at gmail.com Wed Aug 16 08:33:55 2017 From: davidshen84 at gmail.com (Xi Shen) Date: Wed, 16 Aug 2017 12:33:55 +0000 Subject: [Matplotlib-users] Why the V parameter in matplotlib.axes.Axes.contour must be increasing? Message-ID: Hi, https://matplotlib.org/api/_as_gen/matplotlib.axes.Axes.contour.html says the contour function accept a vector parameter V which must be in increasing value. But the contour function in MATLAB does not have this restriction. I understand the underlining implementation of these two functions could be very different. I want to understand what is the purpose of this restriction, and if it possible to create a contour image the same as MATLAB does by using contour with V = [0 0]? Regards, David -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben.v.root at gmail.com Wed Aug 16 09:49:46 2017 From: ben.v.root at gmail.com (Benjamin Root) Date: Wed, 16 Aug 2017 09:49:46 -0400 Subject: [Matplotlib-users] Why the V parameter in matplotlib.axes.Axes.contour must be increasing? In-Reply-To: References: Message-ID: Probably because nobody noticed that discrepancy before. I'd imagine it would be fairly simple to apply a sort to the list of values within the function itself. The underlying contouring implementation assumes a monotonically increasing set of contour levels, and I would imagine that MATLAB's version does too -- just that they sort the contour levels for you. At the moment, I don't see any reason why we couldn't do that, too. Cheers! Ben Root On Wed, Aug 16, 2017 at 8:33 AM, Xi Shen wrote: > Hi, > > https://matplotlib.org/api/_as_gen/matplotlib.axes.Axes.contour.html says > the contour function accept a vector parameter V which must be in > increasing value. But the contour function in MATLAB does not have this > restriction. > > I understand the underlining implementation of these two functions could > be very different. I want to understand what is the purpose of this > restriction, and if it possible to create a contour image the same as > MATLAB does by using contour with V = [0 0]? > > > Regards, > David > > > _______________________________________________ > 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 pauldurack at llnl.gov Wed Aug 16 12:31:57 2017 From: pauldurack at llnl.gov (pauljdurack) Date: Wed, 16 Aug 2017 09:31:57 -0700 (MST) Subject: [Matplotlib-users] Setting rcParams ps.fonttype = 42 yields unreadable eps Message-ID: <1502901117295-48197.post@n5.nabble.com> I created a bug report at https://github.com/matplotlib/matplotlib/issues/9044, but in the mean time I am keen to get some help from this user group. I'm trying to create an eps output from matplotlib 2.0.2 with editable text (truetype). I've used the settings: import matplotlib matplotlib.rcParams['ps.fonttype'] = 42 Which yields a file size increase from 19Kb to 1.2Mb, but no software (MacOS Preview, or Adobe Photoshop 2017) can read the file. For those interested I have attached both `*.eps` output files in the zip archive at the link at the top of the page. The truetype (ps.fonttype = 42) file contains the following, and `DejaVu Sans` doesn't appear to be installed (checking the MacOS Font Book application): ... %!PS-TrueTypeFont-1.0-2.22937 %%Title: DejaVu Sans %%Copyright: Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Copyright (c) 2006 by Tavmjong Bah. All Rights Reserved. DejaVu changes are in public domain %%Creator: Converted from TrueType to type 42 by PPR ... A demo script to reproduce the problem is: import matplotlib from matplotlib import pyplot as plt fig = plt.figure(dpi=100, facecolor='w', edgecolor='w') ax1 = plt.subplot2grid((2,2), (0, 0), rowspan=2, facecolor='w') ax2 = plt.subplot2grid((2,2), (0, 1), facecolor='w') ax3 = plt.subplot2grid((2,2), (1, 1), facecolor='w') matplotlib.rcParams['ps.fonttype'] = 3 fig.savefig('demo-type3.eps') <- Opens fine matplotlib.rcParams['ps.fonttype'] = 42 fig.savefig('demo-type42.eps') <- Errors on all applications I have tried System config: * Operating System: MacOS 10.11.6 * Matplotlib Version: 2.0.2-py27_1 (conda-forge) * Python Version: 2.7.13-1 (conda-forge) * Jupyter Version (if applicable): NA (1.0.0-py27_0 conda-forge) * Other Libraries: NA (can provide if required) * Installation path: conda (conda-forge channel) Happy to hear any tips as to how to get around this issue. Cheers, P -- View this message in context: http://matplotlib.1069221.n5.nabble.com/Setting-rcParams-ps-fonttype-42-yields-unreadable-eps-tp48197.html Sent from the matplotlib - users mailing list archive at Nabble.com. From jklymak at uvic.ca Wed Aug 16 12:48:37 2017 From: jklymak at uvic.ca (Jody Klymak) Date: Wed, 16 Aug 2017 09:48:37 -0700 Subject: [Matplotlib-users] Why the V parameter in matplotlib.axes.Axes.contour must be increasing? In-Reply-To: References: Message-ID: <46DCB6E9-E3D4-48DE-AB23-D895438C9E94@uvic.ca> Hi David, I?ve definitely run into this, to my annoyance. Do you think you can open an issue on [GitHub](https://github.com/matplotlib/matplotlib/issues)? If you don?t want to, I?m happy to do it. With respect to one contour at zero, its easier than Matlab: ax.contour(X, np.array([0.])) works for me? Cheers, On 16 Aug 2017, at 5:33, Xi Shen wrote: > Hi, > > https://matplotlib.org/api/_as_gen/matplotlib.axes.Axes.contour.html > says > the contour function accept a vector parameter V which must be in > increasing value. But the contour function in MATLAB does not have > this > restriction. > > I understand the underlining implementation of these two functions > could be > very different. I want to understand what is the purpose of this > restriction, and if it possible to create a contour image the same as > MATLAB does by using contour with V = [0 0]? > > > Regards, > David > _______________________________________________ > 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 davidshen84 at gmail.com Wed Aug 16 22:06:16 2017 From: davidshen84 at gmail.com (Xi Shen) Date: Thu, 17 Aug 2017 02:06:16 +0000 Subject: [Matplotlib-users] Why the V parameter in matplotlib.axes.Axes.contour must be increasing? In-Reply-To: <46DCB6E9-E3D4-48DE-AB23-D895438C9E94@uvic.ca> References: <46DCB6E9-E3D4-48DE-AB23-D895438C9E94@uvic.ca> Message-ID: Hi Jody, I confirm that giving V = [0] to contour function in matplotlib gives me the same image as using V = [0 0] in MATLAB. Do you think it is a bug in matplotlib, or it is just a conscious design decision? I do not have much knowledge of math behind this, so for me it is just a restriction on parameter values. Thanks, David On Thu, Aug 17, 2017 at 12:48 AM Jody Klymak wrote: > Hi David, > > I?ve definitely run into this, to my annoyance. > > Do you think you can open an issue on GitHub > ? If you don?t want to, > I?m happy to do it. > > With respect to one contour at zero, its easier than Matlab: > > ax.contour(X, np.array([0.])) > > works for me? > > Cheers, > > On 16 Aug 2017, at 5:33, Xi Shen wrote: > > Hi, > > https://matplotlib.org/api/_as_gen/matplotlib.axes.Axes.contour.html says > the contour function accept a vector parameter V which must be in > increasing value. But the contour function in MATLAB does not have this > restriction. > > I understand the underlining implementation of these two functions could > be very different. I want to understand what is the purpose of this > restriction, and if it possible to create a contour image the same as > MATLAB does by using contour with V = [0 0]? > > > Regards, > David > > _______________________________________________ > 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 jklymak at uvic.ca Wed Aug 16 22:36:52 2017 From: jklymak at uvic.ca (Jody Klymak) Date: Wed, 16 Aug 2017 19:36:52 -0700 Subject: [Matplotlib-users] Why the V parameter in matplotlib.axes.Axes.contour must be increasing? In-Reply-To: References: <46DCB6E9-E3D4-48DE-AB23-D895438C9E94@uvic.ca> Message-ID: <3B01529E-A73E-492D-9B49-FBEA4E520A4F@uvic.ca> I opened a pull request to change it, but we need to test a couple of things? https://github.com/matplotlib/matplotlib/pull/9047 Cheers, Jody On 16 Aug 2017, at 19:06, Xi Shen wrote: > Hi Jody, > > I confirm that giving V = [0] to contour function in matplotlib gives > me > the same image as using V = [0 0] in MATLAB. > > Do you think it is a bug in matplotlib, or it is just a conscious > design > decision? I do not have much knowledge of math behind this, so for me > it is > just a restriction on parameter values. > > > Thanks, > David > > > On Thu, Aug 17, 2017 at 12:48 AM Jody Klymak wrote: > >> Hi David, >> >> I?ve definitely run into this, to my annoyance. >> >> Do you think you can open an issue on GitHub >> ? If you don?t >> want to, >> I?m happy to do it. >> >> With respect to one contour at zero, its easier than Matlab: >> >> ax.contour(X, np.array([0.])) >> >> works for me? >> >> Cheers, >> >> On 16 Aug 2017, at 5:33, Xi Shen wrote: >> >> Hi, >> >> https://matplotlib.org/api/_as_gen/matplotlib.axes.Axes.contour.html >> says >> the contour function accept a vector parameter V which must be in >> increasing value. But the contour function in MATLAB does not have >> this >> restriction. >> >> I understand the underlining implementation of these two functions >> could >> be very different. I want to understand what is the purpose of this >> restriction, and if it possible to create a contour image the same as >> MATLAB does by using contour with V = [0 0]? >> >> >> Regards, >> David >> >> _______________________________________________ >> 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 pauldurack at llnl.gov Wed Aug 16 12:23:36 2017 From: pauldurack at llnl.gov (pauljdurack) Date: Wed, 16 Aug 2017 09:23:36 -0700 (MST) Subject: [Matplotlib-users] Setting rcParams ps.fonttype = 42 yields unreadable eps Message-ID: <1502900616633-48196.post@n5.nabble.com> I created a bug report at https://github.com/matplotlib/matplotlib/issues/9044, but in the mean time I am keen to get some help from this user group. I'm trying to create an eps output from matplotlib 2.0.2 with editable text (truetype). I've used the settings: import matplotlib matplotlib.rcParams['ps.fonttype'] = 42 Which yields a file size increase from 19Kb to 1.2Mb, but no software (MacOS Preview, or Adobe Photoshop 2017) can read the file. For those interested I have attached both `*.eps` output files in the zip archive at the link at the top of the page. The truetype (ps.fonttype = 42) file contains the following, and `DejaVu Sans` doesn't appear to be installed (checking the MacOS Font Book application): ... %!PS-TrueTypeFont-1.0-2.22937 %%Title: DejaVu Sans %%Copyright: Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Copyright (c) 2006 by Tavmjong Bah. All Rights Reserved. DejaVu changes are in public domain %%Creator: Converted from TrueType to type 42 by PPR ... A demo script to reproduce the problem is: import matplotlib from matplotlib import pyplot as plt fig = plt.figure(dpi=100, facecolor='w', edgecolor='w') ax1 = plt.subplot2grid((2,2), (0, 0), rowspan=2, facecolor='w') ax2 = plt.subplot2grid((2,2), (0, 1), facecolor='w') ax3 = plt.subplot2grid((2,2), (1, 1), facecolor='w') matplotlib.rcParams['ps.fonttype'] = 3 fig.savefig('demo-type3.eps') <- Opens fine matplotlib.rcParams['ps.fonttype'] = 42 fig.savefig('demo-type42.eps') <- Errors on all applications I have tried System config: * Operating System: MacOS 10.11.6 * Matplotlib Version: 2.0.2-py27_1 (conda-forge) * Python Version: 2.7.13-1 (conda-forge) * Jupyter Version (if applicable): NA (1.0.0-py27_0 conda-forge) * Other Libraries: NA (can provide if required) * Installation path: conda (conda-forge channel) Happy to hear any tips as to how to get around this issue. Cheers, P -- View this message in context: http://matplotlib.1069221.n5.nabble.com/Setting-rcParams-ps-fonttype-42-yields-unreadable-eps-tp48196.html Sent from the matplotlib - users mailing list archive at Nabble.com. From tomdean at speakeasy.org Thu Aug 17 23:49:24 2017 From: tomdean at speakeasy.org (tomdean) Date: Thu, 17 Aug 2017 20:49:24 -0700 (MST) Subject: [Matplotlib-users] Horizontal Waterfall time vs amplitude Message-ID: <1503028164406-48234.post@n5.nabble.com> I am attempting to plot a data stream in a waterfall which moves horizontally. My datastream has one point every 2 seconds. I want to have datetime stamps in the display. Like Figure 5-1 in https://www.britastro.org/radio/downloads/Further_Developments_SDR_Telescope.pdf Is this possible? Tom Dean -- View this message in context: http://matplotlib.1069221.n5.nabble.com/Horizontal-Waterfall-time-vs-amplitude-tp48234.html Sent from the matplotlib - users mailing list archive at Nabble.com. From tomdean at speakeasy.org Thu Aug 17 23:55:27 2017 From: tomdean at speakeasy.org (Thomas D. Dean) Date: Thu, 17 Aug 2017 20:55:27 -0700 Subject: [Matplotlib-users] Horizontal Waterfall Message-ID: I am attempting to plot a data stream in a waterfall which moves horizontally. My datastream has one point every 2 seconds. I want to have datetime stamps in the display. Like Figure 5-1 in https://www.britastro.org/radio/downloads /Further_Developments_SDR_Telescope.pdf Is this possible? Tom Dean From stefanschubi at googlemail.com Fri Aug 18 04:02:28 2017 From: stefanschubi at googlemail.com (stefanxfg) Date: Fri, 18 Aug 2017 01:02:28 -0700 (MST) Subject: [Matplotlib-users] multiple lines in 1 graph Message-ID: <1503043348317-48236.post@n5.nabble.com> Hi, i have a matplotlib graph and i want to insert several lines or linesets to the graph. Until here no problem. I also want to see curser lines by adding onMouseMove-Event through 'motion_modify_event'-declaration. My problem is, that only the first drawn line is visible after mmoving the mouse on the graph. When the graph is only loaded, everything is visible, but by moving the mouse the second plot will be invisible.I dont know, whats the problem. THis is my code.def PlotInput(self): self.fig = Figure (figsize=(5,4), dpi=100) self.canvas = FigureCanvasTkAgg(self.fig,self) self.ax = self.fig.add_subplot(111) self.ax = self.fig.add_subplot(111) #fuer 2d-Plot self.ax.set_title('Definition der LRUGL') self.ax.set_xlabel('Breite y [mm]') self.ax.set_ylabel('H?he z [mm]') self.ax.axis([-2000,2000,0, 5000]) self.ax.grid(True) self.toolbar = NavigationToolbar2TkAgg(self.canvas,self) self.toolbar.update() self.plot_widget = self.canvas.get_tk_widget() self.plot_widget.pack(side=tk.TOP, fill=tk.BOTH, expand=1) self.toolbar.pack(side=tk.BOTTOM, fill=tk.BOTH, expand=1) self.ax.plot(np.zeros(100)) def onMouseMove(event): self.ax.lines = [self.ax.lines[0]] if event.xdata and event.ydata: # python3 often has None self.ax.axhline(y=event.ydata, color="k") self.ax.axvline(x=event.xdata, color="k") self.fig.canvas.show() self.canvas.mpl_connect('motion_notify_event', onMouseMove) self.canvas.show() def fig_ax_request(x, y, x2): self.ax.clear() ya = np.array(x) za = np.array(y) yb = np.array(x2) self.ax.plot(yb,za, color='red', linestyle='--', marker='') self.fig.canvas.draw() self.ax.plot(ya,za, color='red', linestyle='--', marker='') self.fig.canvas.draw() subscribe('UPDATE_LRUGL_GRAPH', 'DRAW_INFO') subscribe('DRAW_INFO', fig_ax_request) subscribe('LRUGL_FIRST_DRAW', 'DRAW_FIRST') subscribe('DRAW_FIRST', fig_ax_request)The subscribes get lists to fill the graph. The first expression updates the graph when data already exists in a gui table. The second expression fills the graph by loading a file. So the parameters "x","y","x2" are lists. -- View this message in context: http://matplotlib.1069221.n5.nabble.com/multiple-lines-in-1-graph-tp48236.html Sent from the matplotlib - users mailing list archive at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From strozzi2 at llnl.gov Sat Aug 19 12:40:53 2017 From: strozzi2 at llnl.gov (Strozzi, David J.) Date: Sat, 19 Aug 2017 16:40:53 +0000 Subject: [Matplotlib-users] Windows7: figure window "not responding" In-Reply-To: References: Message-ID: Thanks for the respone. Sadly, I can?t get anything useful out of the doc. And %matplotlib doesn?t help, same effect. This is very frustrating. I don?t know how to debug this. It?s just a ?black box?, I do what I?m ?supposed to?, doesn?t work. Help appreciated! Dave From: Thomas Caswell [mailto:tcaswell at gmail.com] Sent: Saturday, August 05, 2017 10:36 AM To: Strozzi, David J. ; matplotlib-users at python.org Subject: Re: [Matplotlib-users] Windows7: figure window "not responding" I do exactly this as well (but on linux)! The symptoms your are describing sounds like the GUI event loop is not being spun behind the scenes (see https://github.com/matplotlib/matplotlib/pull/4779 for some draft text at explaining how all of that works). Have you tried doing `%matplotlib` is IPython? Tom On Sat, Aug 5, 2017 at 12:39 PM Strozzi, David J. > wrote: This problem has been driving me nuts, posted it elsewhere, so far no one's been able to help. I am running Python 3.6.1 from Anaconda (all packages updated to latest and greatest) on Windows 7. ipython and mpl figure windows work fine from a console, or spyder. The problem is when I try running ipython within emacs using elpy. To back up, the workflow I'm shooting for is using emacs as my IDE, and running python within emacs. I've done this for many years with the Yorick interpreter, and it's quite addictive. I get the same problem whether I use the GNU windows build of emacs, or emacs -nw (terminal, no X) from cygwin (ver 25.2 both cases). elpy seems to be a good Python package for emacs, and nominally supports using ipython. OK, so - I can use ipython + emacs + elpy. The only problem is matplotlib figures. When I do figure(), a figure window appears, but is not fully rendered (e.g. no buttons), and the window title says "Not responding". If I do a plot(), nothing is plotted. Playing with ion() and show() doesn't help. I've posted this on the elpy github, various stackexchange forums, no one has had any ideas yet. Any help is greatly appreciated! Dave _______________________________________________ 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 Aug 19 13:54:14 2017 From: tcaswell at gmail.com (Thomas Caswell) Date: Sat, 19 Aug 2017 17:54:14 +0000 Subject: [Matplotlib-users] Windows7: figure window "not responding" In-Reply-To: References: Message-ID: David, Please subscribe to the mailing list so you can post un-moderated. Which backend are you using? If you get a window up and then do `fig.canvas.flush_events()` will it update? If you do `plt.ioff()` and then `plt.show()` does it work? Tom On Sat, Aug 19, 2017 at 12:40 PM Strozzi, David J. wrote: > Thanks for the respone. Sadly, I can?t get anything useful out of the > doc. And %matplotlib doesn?t help, same effect. > > > > This is very frustrating. I don?t know how to debug this. It?s just a > ?black box?, I do what I?m ?supposed to?, doesn?t work. > > > > Help appreciated! > > Dave > > > > *From:* Thomas Caswell [mailto:tcaswell at gmail.com] > *Sent:* Saturday, August 05, 2017 10:36 AM > *To:* Strozzi, David J. ; matplotlib-users at python.org > *Subject:* Re: [Matplotlib-users] Windows7: figure window "not responding" > > > > I do exactly this as well (but on linux)! > > > > The symptoms your are describing sounds like the GUI event loop is not > being spun behind the scenes (see > https://github.com/matplotlib/matplotlib/pull/4779 for some draft text at > explaining how all of that works). Have you tried doing `%matplotlib` is > IPython? > > > > Tom > > > > On Sat, Aug 5, 2017 at 12:39 PM Strozzi, David J. > wrote: > > This problem has been driving me nuts, posted it elsewhere, so far no > one's been able to help. I am running Python 3.6.1 from Anaconda (all > packages updated to latest and greatest) on Windows 7. ipython and mpl > figure windows work fine from a console, or spyder. The problem is when I > try running ipython within emacs using elpy. > > > > To back up, the workflow I'm shooting for is using emacs as my IDE, and > running python within emacs. I've done this for many years with the Yorick > interpreter, and it's quite addictive. I get the same problem whether I > use the GNU windows build of emacs, or emacs -nw (terminal, no X) from > cygwin (ver 25.2 both cases). elpy seems to be a good Python package for > emacs, and nominally supports using ipython. > > > > OK, so - I can use ipython + emacs + elpy. The only problem is matplotlib > figures. When I do figure(), a figure window appears, but is not fully > rendered (e.g. no buttons), and the window title says "Not responding". If > I do a plot(), nothing is plotted. Playing with ion() and show() doesn't > help. > > > > I've posted this on the elpy github, various stackexchange forums, no one > has had any ideas yet. > > > > Any help is greatly appreciated! > > Dave > > _______________________________________________ > 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 strozzi2 at llnl.gov Sat Aug 19 15:28:04 2017 From: strozzi2 at llnl.gov (Strozzi, David J.) Date: Sat, 19 Aug 2017 19:28:04 +0000 Subject: [Matplotlib-users] Windows7: figure window "not responding" In-Reply-To: References: Message-ID: Hi, * Just subscribed to list. * Backend: mpl.get_backend() = ?Qt5Agg?. I am not committed to this if another one will work. * ?If you get up a window:? I start ipython within emacs (the GNU win32 build, not cygwin), and do figure(1), a figure window appears, but nothing renders, and window title bar says ?Not responding.? If I plot something, it doesn?t appear. fig is not defined, by default. I can do fig=gcf(). Then fig.canvas.flush_events() has an interesting effect ? the plot appears, but then window title still says ?not responding? and when I hover the mouse over the figure window it becomes Windows? spinning blue circle (the busy symbol, like Mac?s spinning beachball). ?control? is returned to ipython. I can continue to execute commands there. * At this point, plt.ioff() doesn?t seem to do anything. plt.show() does ? ?not responding? disappears, the figure window works like normal. Buttons on it work. But the ipython window is ?frozen? no In[] prompt. OK so this seems like a lot of information. Maybe we can make progress? Dave From: Thomas Caswell [mailto:tcaswell at gmail.com] Sent: Saturday, August 19, 2017 10:54 AM To: Strozzi, David J. ; matplotlib-users at python.org Subject: Re: [Matplotlib-users] Windows7: figure window "not responding" David, Please subscribe to the mailing list so you can post un-moderated. Which backend are you using? If you get a window up and then do `fig.canvas.flush_events()` will it update? If you do `plt.ioff()` and then `plt.show()` does it work? Tom On Sat, Aug 19, 2017 at 12:40 PM Strozzi, David J. > wrote: Thanks for the respone. Sadly, I can?t get anything useful out of the doc. And %matplotlib doesn?t help, same effect. This is very frustrating. I don?t know how to debug this. It?s just a ?black box?, I do what I?m ?supposed to?, doesn?t work. Help appreciated! Dave From: Thomas Caswell [mailto:tcaswell at gmail.com] Sent: Saturday, August 05, 2017 10:36 AM To: Strozzi, David J. >; matplotlib-users at python.org Subject: Re: [Matplotlib-users] Windows7: figure window "not responding" I do exactly this as well (but on linux)! The symptoms your are describing sounds like the GUI event loop is not being spun behind the scenes (see https://github.com/matplotlib/matplotlib/pull/4779 for some draft text at explaining how all of that works). Have you tried doing `%matplotlib` is IPython? Tom On Sat, Aug 5, 2017 at 12:39 PM Strozzi, David J. > wrote: This problem has been driving me nuts, posted it elsewhere, so far no one's been able to help. I am running Python 3.6.1 from Anaconda (all packages updated to latest and greatest) on Windows 7. ipython and mpl figure windows work fine from a console, or spyder. The problem is when I try running ipython within emacs using elpy. To back up, the workflow I'm shooting for is using emacs as my IDE, and running python within emacs. I've done this for many years with the Yorick interpreter, and it's quite addictive. I get the same problem whether I use the GNU windows build of emacs, or emacs -nw (terminal, no X) from cygwin (ver 25.2 both cases). elpy seems to be a good Python package for emacs, and nominally supports using ipython. OK, so - I can use ipython + emacs + elpy. The only problem is matplotlib figures. When I do figure(), a figure window appears, but is not fully rendered (e.g. no buttons), and the window title says "Not responding". If I do a plot(), nothing is plotted. Playing with ion() and show() doesn't help. I've posted this on the elpy github, various stackexchange forums, no one has had any ideas yet. Any help is greatly appreciated! Dave _______________________________________________ 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 Aug 19 17:31:49 2017 From: tcaswell at gmail.com (Thomas Caswell) Date: Sat, 19 Aug 2017 21:31:49 +0000 Subject: [Matplotlib-users] Windows7: figure window "not responding" In-Reply-To: References: Message-ID: That is at least all consistent! The issue as that for what ever reason the input hook is not being set up correctly (which is what lets the GUI event loop spin and process events while the terminal waits for you to type). With `plt.ion()` the terminal is blocking the process waiting for you to type (which is why the window is not responding), with `plt.ioff()` when you do `plt.show()` the GUI event loop is blocking the process (which is why it works, but you don't get the next prompt back until you close the plot window). Again, see https://github.com/matplotlib/matplotlib/pull/4779 for a longer pass at explaining how this all works (and I would appreciate feed back about where it does not make sense!). Try using `tkagg` as the backend, the integration between python and tk in a bit tighter (because it is done in the cpython source). Which version of IPython and matplotlib are you using (and are you sure that elpy is using the versions you think it is?)? are you using `(elpy-use-ipython)` or just hacking the python executable path? You are siting at a very interesting intersection of technology here (emacs + python + GUI + windows). It might make sense to ask either on the elpy mailing list or the ipython mailing list. Tom On Sat, Aug 19, 2017 at 3:28 PM Strozzi, David J. wrote: > Hi, > > > > * Just subscribed to list. > > > > * Backend: mpl.get_backend() = ?Qt5Agg?. I am not committed to this if > another one will work. > > > > * ?If you get up a window:? I start ipython within emacs (the GNU win32 > build, not cygwin), and do figure(1), a figure window appears, but nothing > renders, and window title bar says ?Not responding.? If I plot something, > it doesn?t appear. > > > > fig is not defined, by default. I can do fig=gcf(). Then > fig.canvas.flush_events() has an interesting effect ? the plot appears, but > then window title still says ?not responding? and when I hover the mouse > over the figure window it becomes Windows? spinning blue circle (the busy > symbol, like Mac?s spinning beachball). > > > > ?control? is returned to ipython. I can continue to execute commands > there. > > > > * At this point, plt.ioff() doesn?t seem to do anything. plt.show() does > ? ?not responding? disappears, the figure window works like normal. > Buttons on it work. But the ipython window is ?frozen? no In[] prompt. > > > > OK so this seems like a lot of information. Maybe we can make progress? > > > > Dave > > > > > > *From:* Thomas Caswell [mailto:tcaswell at gmail.com] > > *Sent:* Saturday, August 19, 2017 10:54 AM > > > *To:* Strozzi, David J. ; matplotlib-users at python.org > *Subject:* Re: [Matplotlib-users] Windows7: figure window "not responding" > > > > David, > > > > Please subscribe to the mailing list so you can post un-moderated. > > > > Which backend are you using? > > > > If you get a window up and then do `fig.canvas.flush_events()` will it > update? > > > > If you do `plt.ioff()` and then `plt.show()` does it work? > > > > Tom > > > > > > On Sat, Aug 19, 2017 at 12:40 PM Strozzi, David J. > wrote: > > Thanks for the respone. Sadly, I can?t get anything useful out of the > doc. And %matplotlib doesn?t help, same effect. > > > > This is very frustrating. I don?t know how to debug this. It?s just a > ?black box?, I do what I?m ?supposed to?, doesn?t work. > > > > Help appreciated! > > Dave > > > > *From:* Thomas Caswell [mailto:tcaswell at gmail.com] > *Sent:* Saturday, August 05, 2017 10:36 AM > *To:* Strozzi, David J. ; matplotlib-users at python.org > *Subject:* Re: [Matplotlib-users] Windows7: figure window "not responding" > > > > I do exactly this as well (but on linux)! > > > > The symptoms your are describing sounds like the GUI event loop is not > being spun behind the scenes (see > https://github.com/matplotlib/matplotlib/pull/4779 for some draft text at > explaining how all of that works). Have you tried doing `%matplotlib` is > IPython? > > > > Tom > > > > On Sat, Aug 5, 2017 at 12:39 PM Strozzi, David J. > wrote: > > This problem has been driving me nuts, posted it elsewhere, so far no > one's been able to help. I am running Python 3.6.1 from Anaconda (all > packages updated to latest and greatest) on Windows 7. ipython and mpl > figure windows work fine from a console, or spyder. The problem is when I > try running ipython within emacs using elpy. > > > > To back up, the workflow I'm shooting for is using emacs as my IDE, and > running python within emacs. I've done this for many years with the Yorick > interpreter, and it's quite addictive. I get the same problem whether I > use the GNU windows build of emacs, or emacs -nw (terminal, no X) from > cygwin (ver 25.2 both cases). elpy seems to be a good Python package for > emacs, and nominally supports using ipython. > > > > OK, so - I can use ipython + emacs + elpy. The only problem is matplotlib > figures. When I do figure(), a figure window appears, but is not fully > rendered (e.g. no buttons), and the window title says "Not responding". If > I do a plot(), nothing is plotted. Playing with ion() and show() doesn't > help. > > > > I've posted this on the elpy github, various stackexchange forums, no one > has had any ideas yet. > > > > Any help is greatly appreciated! > > Dave > > _______________________________________________ > 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 thibault.marin.us at ieee.org Sun Aug 20 12:14:44 2017 From: thibault.marin.us at ieee.org (Thibault Marin) Date: Sun, 20 Aug 2017 11:14:44 -0500 Subject: [Matplotlib-users] Windows7: figure window "not responding" Message-ID: <87r2w6jjwr.fsf@dell-desktop.WORKGROUP> Hi, Sorry for breaking the thread, I have just subscribed to the list and I don't know how to respond to a message that predates my subscription. I hope this messages makes its way. I believe I have a similar setup (Windows + emacs + Qt5Agg, python 3.5 and matplotlib 2+). I also see freezes when starting ipython from within emacs. The way I work around that is by using org-mode and ob-ipython (https://github.com/gregsexton/ob-ipython). To work with matplotlib, I do the following: 1 - Open my org file, which starts with something like: ,---- | #+PROPERTY: header-args :eval no-export :session Python | | #+NAME: py-startup-0 | #+BEGIN_SRC ipython :results silent :exports none | # %% Standard imports | # General | import os | import sys | import re | import matplotlib as mpl | mpl.use('Qt5Agg') | #+END_SRC `---- 2 - Execute the source block (move point at the beginning of the "BEGIN_SRC line" and C-c C-c) I then get a warning about the interpreter which I ignore. Note that it sometimes hangs at that point, in which case I use C-g. 3 - The *Python* buffer then contains the ipython session, in which I can use matplotlib: I get not freezes and calls do not block the ipython instance. Note that I have to run `plt.ion()` once to get matplotlib figures to show up. 4 - I usually write most of my code in org-mode anyway, but after running the source block I can open any .py file and work with it ignoring the org-mode part. For completeness, my emacs init file contains the following: ,---- | (when (eq system-type 'windows-nt) | (progn | (setq python-shell-interpreter-args "--simple-prompt -i") | (setq ob-ipython-command "ipython"))) `---- I hope this helps. thibault On Sat, Aug 5, 2017 at 12:39 PM Strozzi, David J. wrote: > This problem has been driving me nuts, posted it elsewhere, so far no one's been able to help. I am running Python 3.6.1 from Anaconda (all packages updated to latest and greatest) on > Windows 7. ipython and mpl figure windows work fine from a console, or spyder. The problem is when I try running ipython within emacs using elpy. > > To back up, the workflow I'm shooting for is using emacs as my IDE, and running python within emacs. I've done this for many years with the Yorick interpreter, and it's quite addictive. I get > the same problem whether I use the GNU windows build of emacs, or emacs -nw (terminal, no X) from cygwin (ver 25.2 both cases). elpy seems to be a good Python package for emacs, and > nominally supports using ipython. > > OK, so - I can use ipython + emacs + elpy. The only problem is matplotlib figures. When I do figure(), a figure window appears, but is not fully rendered (e.g. no buttons), and the window title > says "Not responding". If I do a plot(), nothing is plotted. Playing with ion() and show() doesn't help. > > I've posted this on the elpy github, various stackexchange forums, no one has had any ideas yet. > > Any help is greatly appreciated! > > Dave > From raju.ankleshwaria at gmail.com Thu Aug 24 12:21:41 2017 From: raju.ankleshwaria at gmail.com (Raju Ankleshwaria) Date: Thu, 24 Aug 2017 09:21:41 -0700 Subject: [Matplotlib-users] Matplotlib quiver Message-ID: Dear Matplotlib help, I have successfully created plots with quiver. The script is working. However, I want to create multiple plots (quiver) with different datasets. Due to the differences in datasets the length of the quiver is changing in each plot. How can I keep the quiver length same in each plots? Note, I do want variations in quiver length in the plot. I don't want the length of each quiver equal in same plot. I am using below in my script. Q=ax.quiver(x, y, u, v, pivot-'tip') qk = ax.quiverkey(Q, 0.78, 0.78, 5, '5 mph', labelpos='E', coordinates=figure') 1. scale function will not work. 2. Normalizing the data will also not work Please suggest/help. RA -------------- next part -------------- An HTML attachment was scrubbed... URL: From efiring at hawaii.edu Thu Aug 24 12:54:11 2017 From: efiring at hawaii.edu (Eric Firing) Date: Thu, 24 Aug 2017 06:54:11 -1000 Subject: [Matplotlib-users] Matplotlib quiver In-Reply-To: References: Message-ID: <117e5f24-38c7-bd55-6d37-e5bb78836ce5@hawaii.edu> On 2017/08/24 6:21 AM, Raju Ankleshwaria wrote: > Dear Matplotlib help, > > I have successfully created plots with quiver. The script is working. > However, I want to create multiple plots (quiver) with different > datasets. Due to the differences in datasets the length of the quiver is > changing in each plot. How can I keep the quiver length same in each > plots? Note, I do want variations in quiver length in the plot. I don't > want the length of each quiver equal in same plot. > > I am using below in my script. > Q=ax.quiver(x, y, u, v, pivot-'tip') > qk = ax.quiverkey(Q, 0.78, 0.78, 5, '5 mph', labelpos='E', > coordinates=figure') > > 1. scale function will not work. Why do you say this? If I understand your question correctly, setting the scale and scale_units keyword arguments to the same value in each plot should do what you need. e.g. Q=ax.quiver(x, y, u, v, pivot-'tip', scale=10, scale_units='inches') Eric > 2. Normalizing the data will also not work > > Please suggest/help. > RA > > > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > From raju.ankleshwaria at gmail.com Thu Aug 24 12:58:35 2017 From: raju.ankleshwaria at gmail.com (Raju Ankleshwaria) Date: Thu, 24 Aug 2017 16:58:35 +0000 Subject: [Matplotlib-users] Matplotlib quiver In-Reply-To: <117e5f24-38c7-bd55-6d37-e5bb78836ce5@hawaii.edu> References: <117e5f24-38c7-bd55-6d37-e5bb78836ce5@hawaii.edu> Message-ID: Bingo, it worked. I was using scale alone so it was not working. But worked with scale_units. Thank you Eric. On Thu, Aug 24, 2017 at 9:54 AM Eric Firing wrote: > On 2017/08/24 6:21 AM, Raju Ankleshwaria wrote: > > Dear Matplotlib help, > > > > I have successfully created plots with quiver. The script is working. > > However, I want to create multiple plots (quiver) with different > > datasets. Due to the differences in datasets the length of the quiver is > > changing in each plot. How can I keep the quiver length same in each > > plots? Note, I do want variations in quiver length in the plot. I don't > > want the length of each quiver equal in same plot. > > > > I am using below in my script. > > Q=ax.quiver(x, y, u, v, pivot-'tip') > > qk = ax.quiverkey(Q, 0.78, 0.78, 5, '5 mph', labelpos='E', > > coordinates=figure') > > > > 1. scale function will not work. > > Why do you say this? If I understand your question correctly, setting > the scale and scale_units keyword arguments to the same value in each > plot should do what you need. > > e.g. > > Q=ax.quiver(x, y, u, v, pivot-'tip', scale=10, scale_units='inches') > > Eric > > > 2. Normalizing the data will also not work > > > > Please suggest/help. > > RA > > > > > > > > _______________________________________________ > > 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 strozzi2 at llnl.gov Mon Aug 28 16:47:42 2017 From: strozzi2 at llnl.gov (Strozzi, David J.) Date: Mon, 28 Aug 2017 20:47:42 +0000 Subject: [Matplotlib-users] Windows7: figure window "not responding" In-Reply-To: References: Message-ID: Sorry for the delay. Life, work, etc. intervene. I tried tk backend, failed but in a different way. Seems to get ?farther? in that I can get a plot to render. * Versions (all very recent from Anaconda): Python: 3.6.2 ipython: 6.1.0 matplotlib: 2.0.2 * My emacs startup has (elpy-use-ipython). * With backend ?TkAgg?: plt.ion() figure(1) --> window appears, with buttons on bottom (doesn?t happen with ?Qt5Agg? backend. ipyton prompt works. But, if I try interacting with the figure window, I get ?not responding? in title, and windows? spinning shell. If I close the figure window by clicking on the X in upper right, windows says ?app not responding.? Dialog box w/ End Process or Cancel. End process kills figure and ipython session. plt.ioff() instead: figure(1) plot(1,1) show() I get a figure window with a plot, but if I interact with it I get ?not responding.? ipython prompt seems fine. I can close window from prompt close(1) and ipython fine. Help appreciated! I hopefully won?t wait so long to respond. Thanks, Dave From: Thomas Caswell [mailto:tcaswell at gmail.com] Sent: Saturday, August 19, 2017 2:32 PM To: Strozzi, David J. ; matplotlib-users at python.org Subject: Re: [Matplotlib-users] Windows7: figure window "not responding" That is at least all consistent! The issue as that for what ever reason the input hook is not being set up correctly (which is what lets the GUI event loop spin and process events while the terminal waits for you to type). With `plt.ion()` the terminal is blocking the process waiting for you to type (which is why the window is not responding), with `plt.ioff()` when you do `plt.show()` the GUI event loop is blocking the process (which is why it works, but you don't get the next prompt back until you close the plot window). Again, see https://github.com/matplotlib/matplotlib/pull/4779 for a longer pass at explaining how this all works (and I would appreciate feed back about where it does not make sense!). Try using `tkagg` as the backend, the integration between python and tk in a bit tighter (because it is done in the cpython source). Which version of IPython and matplotlib are you using (and are you sure that elpy is using the versions you think it is?)? are you using `(elpy-use-ipython)` or just hacking the python executable path? You are siting at a very interesting intersection of technology here (emacs + python + GUI + windows). It might make sense to ask either on the elpy mailing list or the ipython mailing list. Tom On Sat, Aug 19, 2017 at 3:28 PM Strozzi, David J. > wrote: Hi, * Just subscribed to list. * Backend: mpl.get_backend() = ?Qt5Agg?. I am not committed to this if another one will work. * ?If you get up a window:? I start ipython within emacs (the GNU win32 build, not cygwin), and do figure(1), a figure window appears, but nothing renders, and window title bar says ?Not responding.? If I plot something, it doesn?t appear. fig is not defined, by default. I can do fig=gcf(). Then fig.canvas.flush_events() has an interesting effect ? the plot appears, but then window title still says ?not responding? and when I hover the mouse over the figure window it becomes Windows? spinning blue circle (the busy symbol, like Mac?s spinning beachball). ?control? is returned to ipython. I can continue to execute commands there. * At this point, plt.ioff() doesn?t seem to do anything. plt.show() does ? ?not responding? disappears, the figure window works like normal. Buttons on it work. But the ipython window is ?frozen? no In[] prompt. OK so this seems like a lot of information. Maybe we can make progress? Dave From: Thomas Caswell [mailto:tcaswell at gmail.com] Sent: Saturday, August 19, 2017 10:54 AM To: Strozzi, David J. >; matplotlib-users at python.org Subject: Re: [Matplotlib-users] Windows7: figure window "not responding" David, Please subscribe to the mailing list so you can post un-moderated. Which backend are you using? If you get a window up and then do `fig.canvas.flush_events()` will it update? If you do `plt.ioff()` and then `plt.show()` does it work? Tom On Sat, Aug 19, 2017 at 12:40 PM Strozzi, David J. > wrote: Thanks for the respone. Sadly, I can?t get anything useful out of the doc. And %matplotlib doesn?t help, same effect. This is very frustrating. I don?t know how to debug this. It?s just a ?black box?, I do what I?m ?supposed to?, doesn?t work. Help appreciated! Dave From: Thomas Caswell [mailto:tcaswell at gmail.com] Sent: Saturday, August 05, 2017 10:36 AM To: Strozzi, David J. >; matplotlib-users at python.org Subject: Re: [Matplotlib-users] Windows7: figure window "not responding" I do exactly this as well (but on linux)! The symptoms your are describing sounds like the GUI event loop is not being spun behind the scenes (see https://github.com/matplotlib/matplotlib/pull/4779 for some draft text at explaining how all of that works). Have you tried doing `%matplotlib` is IPython? Tom On Sat, Aug 5, 2017 at 12:39 PM Strozzi, David J. > wrote: This problem has been driving me nuts, posted it elsewhere, so far no one's been able to help. I am running Python 3.6.1 from Anaconda (all packages updated to latest and greatest) on Windows 7. ipython and mpl figure windows work fine from a console, or spyder. The problem is when I try running ipython within emacs using elpy. To back up, the workflow I'm shooting for is using emacs as my IDE, and running python within emacs. I've done this for many years with the Yorick interpreter, and it's quite addictive. I get the same problem whether I use the GNU windows build of emacs, or emacs -nw (terminal, no X) from cygwin (ver 25.2 both cases). elpy seems to be a good Python package for emacs, and nominally supports using ipython. OK, so - I can use ipython + emacs + elpy. The only problem is matplotlib figures. When I do figure(), a figure window appears, but is not fully rendered (e.g. no buttons), and the window title says "Not responding". If I do a plot(), nothing is plotted. Playing with ion() and show() doesn't help. I've posted this on the elpy github, various stackexchange forums, no one has had any ideas yet. Any help is greatly appreciated! Dave _______________________________________________ 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 jean-philippe.grivet at wanadoo.fr Tue Aug 29 10:21:29 2017 From: jean-philippe.grivet at wanadoo.fr (Jean-Philippe Grivet) Date: Tue, 29 Aug 2017 16:21:29 +0200 Subject: [Matplotlib-users] selecting points inside plot Message-ID: <59A57869.3010807@wanadoo.fr> Hello, I use Win7 and the Anaconde suite of Python programs. I am trying to write a piece of software to demonstrate the computation of electric potentials. The software should ; - allow a user to select (with a mouse click) a point inside a blank rectangle, - record the x and y coordinates of that point - draw a dot at that location - ask the user for the value of the charge located there and record that - repeat a few times - compute the electric potential and draw a contour plot of that function. There are several pieces of code available showing how to print the x,y coor- dinates of a mouse click but I can't devise a way to retrieve thes values for turther computations nor can I dra a dot at the corresponding location or insert a dialog to get the charge values. I would be grateful for any suggestion. JP Grivet --- L'absence de virus dans ce courrier ?lectronique a ?t? v?rifi?e par le logiciel antivirus Avast. https://www.avast.com/antivirus From tcaswell at gmail.com Tue Aug 29 22:13:59 2017 From: tcaswell at gmail.com (Thomas Caswell) Date: Wed, 30 Aug 2017 02:13:59 +0000 Subject: [Matplotlib-users] selecting points inside plot In-Reply-To: <59A57869.3010807@wanadoo.fr> References: <59A57869.3010807@wanadoo.fr> Message-ID: Jean, What you want to do is totally possible! I suggest having a look at the examples in https://matplotlib.org/examples/widgets/index.html the `ginput` method, https://github.com/tacaswell/interactive_mpl_tutorial and Ben Root's book https://www.amazon.com/Interactive-Applications-using-Matplotlib-Benjamin/dp/1783988843 Tom On Tue, Aug 29, 2017 at 10:29 AM Jean-Philippe Grivet < jean-philippe.grivet at wanadoo.fr> wrote: > Hello, > I use Win7 and the Anaconde suite of Python programs. > I am trying to write a piece of software to demonstrate the computation > of electric potentials. The software should ; > > - allow a user to select (with a mouse click) a point inside a > blank rectangle, > - record the x and y coordinates of that point > - draw a dot at that location > - ask the user for the value of the charge located there and record > that > - repeat a few times > - compute the electric potential and draw a contour plot of that > function. > > There are several pieces of code available showing how to print the x,y > coor- > dinates of a mouse click but I can't devise a way to retrieve thes > values for > turther computations nor can I dra a dot at the corresponding location > or insert a dialog to get the charge values. > > I would be grateful for any suggestion. > JP Grivet > > > --- > L'absence de virus dans ce courrier ?lectronique a ?t? v?rifi?e par le > logiciel antivirus Avast. > https://www.avast.com/antivirus > > _______________________________________________ > 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: