You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(3) |
Jun
|
Jul
|
Aug
(12) |
Sep
(12) |
Oct
(56) |
Nov
(65) |
Dec
(37) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(59) |
Feb
(78) |
Mar
(153) |
Apr
(205) |
May
(184) |
Jun
(123) |
Jul
(171) |
Aug
(156) |
Sep
(190) |
Oct
(120) |
Nov
(154) |
Dec
(223) |
2005 |
Jan
(184) |
Feb
(267) |
Mar
(214) |
Apr
(286) |
May
(320) |
Jun
(299) |
Jul
(348) |
Aug
(283) |
Sep
(355) |
Oct
(293) |
Nov
(232) |
Dec
(203) |
2006 |
Jan
(352) |
Feb
(358) |
Mar
(403) |
Apr
(313) |
May
(165) |
Jun
(281) |
Jul
(316) |
Aug
(228) |
Sep
(279) |
Oct
(243) |
Nov
(315) |
Dec
(345) |
2007 |
Jan
(260) |
Feb
(323) |
Mar
(340) |
Apr
(319) |
May
(290) |
Jun
(296) |
Jul
(221) |
Aug
(292) |
Sep
(242) |
Oct
(248) |
Nov
(242) |
Dec
(332) |
2008 |
Jan
(312) |
Feb
(359) |
Mar
(454) |
Apr
(287) |
May
(340) |
Jun
(450) |
Jul
(403) |
Aug
(324) |
Sep
(349) |
Oct
(385) |
Nov
(363) |
Dec
(437) |
2009 |
Jan
(500) |
Feb
(301) |
Mar
(409) |
Apr
(486) |
May
(545) |
Jun
(391) |
Jul
(518) |
Aug
(497) |
Sep
(492) |
Oct
(429) |
Nov
(357) |
Dec
(310) |
2010 |
Jan
(371) |
Feb
(657) |
Mar
(519) |
Apr
(432) |
May
(312) |
Jun
(416) |
Jul
(477) |
Aug
(386) |
Sep
(419) |
Oct
(435) |
Nov
(320) |
Dec
(202) |
2011 |
Jan
(321) |
Feb
(413) |
Mar
(299) |
Apr
(215) |
May
(284) |
Jun
(203) |
Jul
(207) |
Aug
(314) |
Sep
(321) |
Oct
(259) |
Nov
(347) |
Dec
(209) |
2012 |
Jan
(322) |
Feb
(414) |
Mar
(377) |
Apr
(179) |
May
(173) |
Jun
(234) |
Jul
(295) |
Aug
(239) |
Sep
(276) |
Oct
(355) |
Nov
(144) |
Dec
(108) |
2013 |
Jan
(170) |
Feb
(89) |
Mar
(204) |
Apr
(133) |
May
(142) |
Jun
(89) |
Jul
(160) |
Aug
(180) |
Sep
(69) |
Oct
(136) |
Nov
(83) |
Dec
(32) |
2014 |
Jan
(71) |
Feb
(90) |
Mar
(161) |
Apr
(117) |
May
(78) |
Jun
(94) |
Jul
(60) |
Aug
(83) |
Sep
(102) |
Oct
(132) |
Nov
(154) |
Dec
(96) |
2015 |
Jan
(45) |
Feb
(138) |
Mar
(176) |
Apr
(132) |
May
(119) |
Jun
(124) |
Jul
(77) |
Aug
(31) |
Sep
(34) |
Oct
(22) |
Nov
(23) |
Dec
(9) |
2016 |
Jan
(26) |
Feb
(17) |
Mar
(10) |
Apr
(8) |
May
(4) |
Jun
(8) |
Jul
(6) |
Aug
(5) |
Sep
(9) |
Oct
(4) |
Nov
|
Dec
|
2017 |
Jan
(5) |
Feb
(7) |
Mar
(1) |
Apr
(5) |
May
|
Jun
(3) |
Jul
(6) |
Aug
(1) |
Sep
|
Oct
(2) |
Nov
(1) |
Dec
|
2018 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2025 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
|
|
|
|
|
1
(2) |
2
(1) |
3
(17) |
4
(9) |
5
(2) |
6
(5) |
7
(8) |
8
(11) |
9
(6) |
10
(6) |
11
(21) |
12
(21) |
13
(17) |
14
(25) |
15
(15) |
16
(2) |
17
|
18
(9) |
19
(22) |
20
(25) |
21
(31) |
22
(19) |
23
(2) |
24
(5) |
25
(19) |
26
(10) |
27
(13) |
28
(14) |
29
(20) |
30
(5) |
31
(9) |
|
|
|
|
|
|
On 20.01.2010 14:55, Scott Sinclair wrote: >> 2010年1月20日 Mario Mech<me...@me...>: >> cb = pyplot.colorbar(format=r"%2.1f") >> for j in cb.ax.get_yticklabels(): >> j.set_text('bla') >> pyplot.show() >> >> Doesn't do anything. > > It looks like cb.ax.get_yticklabels() returns a list of copies of the > Text objects. Since you are only changing the copies it has no effect > on your figure. > You'll need to use cb.ax.set_yticklabels() and pass a list of strings > to use as tick labels. See > http://matplotlib.sourceforge.net/examples/pylab_examples/colorbar_tick_labelling_demo.html > for an example. > > Cheers, > Scott Ok, something like cl = cb.ax.get_yticklabels() cl[0].set_text('bla') cb.ax.set_yticklabels([elem.get_text() for elem in cl]) would work for the horizontal colorbars and y replaced by x. But cl = cb.ax.get_yticklabels() results in a list of Text objects like Text(0,0,''). So my problem is more to get the TickLabels for vertical colorbars. Cheers Mario -- Dr. Mario Mech Institute for Geophysics and Meteorology University of Cologne Zuelpicher Str. 49a 50674 Cologne Germany t: +49 (0)221 - 470 - 1776 f: +49 (0)221 - 470 - 5198 e: me...@me... w: http://www.meteo.uni-koeln.de/~mmech/
>2010年1月20日 Mario Mech <me...@me...>: > cb = pyplot.colorbar(format=r"%2.1f") > for j in cb.ax.get_yticklabels(): > j.set_text('bla') > pyplot.show() > > Doesn't do anything. It looks like cb.ax.get_yticklabels() returns a list of copies of the Text objects. Since you are only changing the copies it has no effect on your figure. You'll need to use cb.ax.set_yticklabels() and pass a list of strings to use as tick labels. See http://matplotlib.sourceforge.net/examples/pylab_examples/colorbar_tick_labelling_demo.html for an example. Cheers, Scott
Hi, it's probably a rather simple problem. Unfortunately I'm unable to solve it. The following code example describes my problem: import numpy as np from matplotlib import pyplot,mpl x = np.arange(10) y = np.arange(25) z = np.floor(10*np.random.random((25,10))) pyplot.contourf(x,y,z) cb = pyplot.colorbar(format=r"%2.1f") for j in cb.ax.get_yticklabels(): j.set_text('bla') pyplot.show() Now I'd like to change the smallest label of the colorbar to 0.0 (without the minus sign). But any attemps to change the ticklabels of the colorbar fail: cb = pyplot.colorbar(format=r"%2.1f") for j in cb.ax.get_yticklabels(): j.set_text('bla') pyplot.show() Doesn't do anything. Evenmore I don't understand why for j in cb.ax.get_yticklabels(): print str(j) results in Text(0,0,'') Text(0,0,'') Text(0,0,'') Text(0,0,'') Text(0,0,'') Text(0,0,'') Text(0,0,'') Thanks in advance Mario Mech
Using the patheffect in the svn, shadows can be easily supported in all the patch-like classes, including the patch of the texts. (For example, see the last example in patheffect_demo.py). So, it should be straight forward and I don't see any harm in doing that. However, I personally prefer to have shadow patches as a separate artists, so that the zorder of the shadows can be respected. For example, in the attached example, I want the shadow of "Text 1" does not block the text "Test 2". But doing this is not straight forward and the code of Text class need to be further modified. I'll take a look later. Regards, -JJ On Tue, Jan 19, 2010 at 9:47 PM, John Hunter <jd...@gm...> wrote: > On Tue, Jan 19, 2010 at 4:34 PM, Jae-Joon Lee <lee...@gm...> wrote: >> This is generally a very difficult thing to do, as the position and >> the extent of the text is determined when the figure is drawn. >> >> The best way, I guess, is to create a customized Text class, but I do >> not recommend this unless you're familiar with matplotlib internals. > > JJ -- what do you think about adding a "shadow" kwarg to the bbox > props -- an extra kwarg much like "pad"? Shouldn't be too hard to > implement in the text class. Or are there some dangerous curves I'm > overlooking? > > JDH >
Michael Mason wrote: > Hello, > > I have a set of NetCDF files that are in Lambert Conformal projection, > and I want to convert them to rectilinear, lat/lon projection. I'm > able to do this and plot the data and print the data out to a png > file. However, I want to get access to the underlying data as it > appears after the projection. I want to take this data and write it > out to another file using an in-house file format. > > I've been trying to probe the objects that are involved in creating > the images using 'dir' to see if there is a way that I can get access > to the underlying data, but I've come up short so far. > > Here is a skeleton of the code that I'm working with: > > # create Basemap using this info > map = Basemap(projection='merc', > lat_0 = map_center_lat, lon_0 = -map_center_lon, > llcrnrlat = min_lat, urcrnrlat = max_lat, > llcrnrlon = min_lon, urcrnrlon = max_lon, > rsphere = 6371200.0, resolution = 'f', > area_thresh = 10000) > > # this part is what takes the most amount of time > # x, y = map(lons.data, lats.data) # compute map projection coordinates. > x, y = map(lons[0], lats[0]) > > # the first slot in the shape array denotes the number of hours > num_hours = data.shape[0] > > # frame counter for the output filenames > frame_num = 0 > > # step through all of the hours > for hr in range (num_hours): > > # get all of the data (2D data) for the current hr > data_hr = data[hr, :, :] > > # create a figure > fig = plt.figure(figsize=(10,8)) > plt.subplot(111) > ax = plt.gca() > dlon = 1.0 > > for xlabel_i in ax.get_xticklabels(): > xlabel_i.set_fontsize(4) > > for ylabel_i in ax.get_yticklabels(): > ylabel_i.set_fontsize(4) > > draw_map (map, ax, dlon) > > v = <compute_contour_levels> > > p = map.contourf (x, y, data_hr, v) > > Any suggestions? Thanks! > > Michael: contourf is not doing performing any transformations or interpolations on the input data - it's just plotting data on the grid defined by the x and y coordinates of the Lambert conformal grid that you give it. You can use the interpolation function "interp" to interpolate from one rectilinear grid to another, but contourf is not doing that under the hood. -Jeff
On Tue, Jan 19, 2010 at 4:34 PM, Jae-Joon Lee <lee...@gm...> wrote: > This is generally a very difficult thing to do, as the position and > the extent of the text is determined when the figure is drawn. > > The best way, I guess, is to create a customized Text class, but I do > not recommend this unless you're familiar with matplotlib internals. JJ -- what do you think about adding a "shadow" kwarg to the bbox props -- an extra kwarg much like "pad"? Shouldn't be too hard to implement in the text class. Or are there some dangerous curves I'm overlooking? JDH
Apparently it wasn't recent enough - I updated to the latest svn and now they are sizing properly - thanks! Another oddity I've noticed, though - if I do ax.scatter3D(x,y,z,s=30*rand(20),c=rand(20)) I would expect to see the points colored based on a color map for the supplied scalar values. Instead, they all appear white. If I do rand(20,3) , it gives random colors, but that's specifying r,g,b values instead of scalar mapping. Is there a way to do the color mapping directly as in the 2D scatter? (If not, it's of course possible to manually apply the mapping - just less convinient) On Mon, Jan 18, 2010 at 11:49 PM, Matthias Michler <Mat...@gm...> wrote: > Hi Erik, > > with current svn I see markers of different size. What version of matplotlib > you are using? > > Kind regards, > Matthias > > On Monday 18 January 2010 21:38:25 Erik Tollerud wrote: >> Is there a way to change the sizes of scatter plot markers for >> mplot3d.Axes3D.scatter3d ? I do >> >> from mpl_toolkits.mplot3d import Axes3D >> ax = Axes3D(gcf()) >> >> x,y,z = randn(3,20) >> ax.scatter(x,y,z,s=30*rand(20)) >> >> and I expect to see 20 points of a range of sizes from 1 to 30... but >> instead I see them all the same size. How can I set the size of the >> markers? > > > ------------------------------------------------------------------------------ > Throughout its 18-year history, RSA Conference consistently attracts the > world's best and brightest in the field, creating opportunities for Conference > attendees to learn about information security's most important issues through > interactions with peers, luminaries and emerging and established companies. > http://p.sf.net/sfu/rsaconf-dev2dev > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users >
This is generally a very difficult thing to do, as the position and the extent of the text is determined when the figure is drawn. The best way, I guess, is to create a customized Text class, but I do not recommend this unless you're familiar with matplotlib internals. If you're using svn version, you can use patheffect. Otherwise, the easiest workaround is calling "draw" twice (or "savefig" twice). But, getting this right is a bit tricky. For your example, adding another "p.draw()" right after "p.text" will work. Also note that your current code has some issues with zorder, facecolor of the shadow and too small shadow offsets. -JJ On Tue, Jan 19, 2010 at 7:11 AM, Jens_M <jen...@gm...> wrote: > > I'm trying to make a shadow effect behind text boxes in a plot (similarly to > what can be done with legends). > > After a fair bit of searching around I found the matplotlib.patches.Shadow > class which seems to be good for this. But I cannot get it to work properly. > I suspect it has something to do with different transforms being used for > the text itself and the actual bbox that surrounds it. This is what I have > tried: > > import numpy as n > import pylab as p > import matplotlib.patches as pt > > p.figure() > p.plot([0,1],[0,1]) > ax=p.gca() > tb=p.text(0.9,0.2,'test',horizontalalignment='center',verticalalignment='center',fontsize='small', > > color='green',weight='bold',bbox=dict(boxstyle="round,pad=0.5",ec='black',fill=False)) > bb=tb.get_bbox_patch() > sh=pt.Shadow(bb,0.1,0.1) > ax.add_patch(sh) > p.draw() > p.show() > > This seems to produce nothing at all (or maybe something that is far outside > the axis limits). > Am I missing something obvious here? Is there some other method that will do > this in an easier way? > > Would appreciate any help, cheers > -- > View this message in context: http://old.nabble.com/text-box-shadow-tp27224851p27224851.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------------ > Throughout its 18-year history, RSA Conference consistently attracts the > world's best and brightest in the field, creating opportunities for Conference > attendees to learn about information security's most important issues through > interactions with peers, luminaries and emerging and established companies. > http://p.sf.net/sfu/rsaconf-dev2dev > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users >
While I don't known much about how table class in matplotlib works internally, I think it would not be easy (because the legend is quite a unique object whose position is determined at drawing time). The current legend implementation is based on the offsetbox module. While it does not have a table-like class, you can emulate something similar. The link below show my attempt to do this, but it turned out that the code is rather complicated. Take a look and see if you can adopt it for your needs. I may try to implement some table-like class with offsetbox in the future, to make things more easy. http://abitofpythonabitofastronomy.blogspot.com/2010/01/customized-legend.html Regards, -JJ On Mon, Jan 18, 2010 at 4:46 PM, ashleyd <ash...@gm...> wrote: > > I'm trying to figure out if it's possible to use a table as a legend of > sorts, as I have a very busy graph I'm trying to describe. > > Basically: > - I'm visualizing data from a series of similar but not-quite-identical > simulations > - I'd like to have the simulation parameters displayed in a table format, > with an example line from the graph next to each row > > So, I might have rows that look like: > "Line", "Alpha", "Beta"... > "-----" , "0.125", "2.0".... > "- - -", "0.120", "2.0".... > > The problem is I can't figure out how to include a line "sample" like what's > included with the legend in a table, and I can't figure out how to make > legend entries that don't have any lines. I suspect that I could make a > dummy white plot, and use that for my data entries in a legend and make a > legend-table hybrid that way. However, I think using a table would be > cleaner and look nicer. > > Does anyone have any ideas as to how to get this working? > > While I'm posting, another quick question -- my text output looks really > shoddy, even at high DPIs. It looks like somebody took a screenshot of a > tiny font and scaled it up with a linear filter. I have freetype installed, > and the matplotlib build script outputs the following, if it's helpful: > > BUILDING MATPLOTLIB > matplotlib: 0.99.1.1 > python: 2.5.4 (r254:67916, Apr 4 2009, 17:56:17) [GCC > 4.3.3] > platform: linux2 > > REQUIRED DEPENDENCIES > numpy: 1.2.1 > freetype2: 9.20.3 > > OPTIONAL BACKEND DEPENDENCIES > libpng: 1.2.27 > Tkinter: Tkinter: 67737, Tk: 8.5, Tcl: 8.5 > wxPython: 2.8.9.1 > * WxAgg extension not required for wxPython >= 2.8 > Gtk+: gtk+: 2.16.1, glib: 2.20.1, pygtk: 2.14.1, > pygobject: 2.16.1 > Mac OS X native: no > Qt: no > Qt4: no > Cairo: 1.4.12 > > OPTIONAL DATE/TIMEZONE DEPENDENCIES > datetime: present, version unknown > dateutil: 1.4.1 > pytz: 2008h > > OPTIONAL USETEX DEPENDENCIES > dvipng: 1.11 > ghostscript: 8.64 > latex: 3.141592 > pdftops: 0.10.5 > > Thank you in advance for any advice! > > -Ashley > -- > View this message in context: http://old.nabble.com/Using-a-table-as-a-legend%2C-ugly-text-output--tp27206248p27206248.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------------ > Throughout its 18-year history, RSA Conference consistently attracts the > world's best and brightest in the field, creating opportunities for Conference > attendees to learn about information security's most important issues through > interactions with peers, luminaries and emerging and established companies. > http://p.sf.net/sfu/rsaconf-dev2dev > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users >
Hello, I have a set of NetCDF files that are in Lambert Conformal projection, and I want to convert them to rectilinear, lat/lon projection. I'm able to do this and plot the data and print the data out to a png file. However, I want to get access to the underlying data as it appears after the projection. I want to take this data and write it out to another file using an in-house file format. I've been trying to probe the objects that are involved in creating the images using 'dir' to see if there is a way that I can get access to the underlying data, but I've come up short so far. Here is a skeleton of the code that I'm working with: # create Basemap using this info map = Basemap(projection='merc', lat_0 = map_center_lat, lon_0 = -map_center_lon, llcrnrlat = min_lat, urcrnrlat = max_lat, llcrnrlon = min_lon, urcrnrlon = max_lon, rsphere = 6371200.0, resolution = 'f', area_thresh = 10000) # this part is what takes the most amount of time # x, y = map(lons.data, lats.data) # compute map projection coordinates. x, y = map(lons[0], lats[0]) # the first slot in the shape array denotes the number of hours num_hours = data.shape[0] # frame counter for the output filenames frame_num = 0 # step through all of the hours for hr in range (num_hours): # get all of the data (2D data) for the current hr data_hr = data[hr, :, :] # create a figure fig = plt.figure(figsize=(10,8)) plt.subplot(111) ax = plt.gca() dlon = 1.0 for xlabel_i in ax.get_xticklabels(): xlabel_i.set_fontsize(4) for ylabel_i in ax.get_yticklabels(): ylabel_i.set_fontsize(4) draw_map (map, ax, dlon) v = <compute_contour_levels> p = map.contourf (x, y, data_hr, v) Any suggestions? Thanks!
JJ, Indeed it is a typo in the email and not in the script. I have used "annotation_clip" with no result. Additional information that I forgot to supply was that on python 2.5/windows/matplotlib 0.98.xxx (my work machine, not accessible at the moment for the subversion number) this worked fine and there may have been a regression from this to the current 0.99.0 (in the ubuntu repository). I tried to build and install the 0.99.1 but need to profess my noobness as I an unsure as to how to get the build, which built without errors, to be installed on ubuntu as I performed the prescribed "python setup.py build" then "sudo python setup.py install" without error. However, when python is loaded/run/booted it still is looking at 0.99.0. The thing I noticed was that instead on installing in site-packages it installed in dist-package (or something like) location and I guess there is something in the python path that needs redirecting. I usually use .deb and dpkg to work out the "appropriate" place for such things (former windows user). I am not familiar with the flags to pass to the python setup script to get it to install all the build files/folders to an alternate location (presumably the correct location). If I could get some basic pointers without having to read the full details then I would be happy to try an install on one of my ubuntu machines. Additional note is that I have installed the windows binary (0.99.1) on a python2.6 install and the same clipping behaviour occurs (no arrows to be seen) the same script run on the my work machine (2.5 and 0.98.xxx) works fine (arrows to be seen in all their glory). Tomorrow I will send through the outputs from the various machines I have to see if I can find when the world changed for these arrows. Finally, can you reproduce the phenomenon that I see on your install of matplotlib? Thank you very much for the guidance, Kurt > From: lee...@gm... > Date: 2010年1月19日 08:52:24 -0500 > Subject: Re: [Matplotlib-users] Annotate Behaviour - Arrows Missing > To: kur...@ho... > CC: mat...@li... > > On Tue, Jan 19, 2010 at 2:48 AM, Kurt Forrester > <kur...@ho...> wrote: > > I modified the script for the hax. annotate(...) to include the > > annotate_clip=False, however there is no change in the behaviour of the > > arrows. > > It should be "annotation_clip" not "annotate_clip", but it may be just a typo. > > Anyhow, as far as I know (as I wrote the related code), there is no > other setting. And your script work fine for me when "annotation_clip" > parameter is added. While I'm testing this with the current svn > version of matplolib, I don't think I see any bug fix related with > this after 0.99.0 release. > > Anyhow, It would be great if you can install the newest version of > matplotlib (0.99.1 or even svn) and see if arrows are still missing. > > Regards, > > -JJ _________________________________________________________________ Time for a new car? Sell your old one fast! http://clk.atdmt.com/NMN/go/157637060/direct/01/
On Tue, Jan 19, 2010 at 11:44 AM, Ian Rose <ia...@ee...> wrote: > Hello - > > How can I download an old version of matplotlib from sourceforge > (specifically, version 0.91.2)? This version is already installed on > some other machines and I need to mirror the installation, but the OSes > are different so I can't just copy the files over or something like that. Take a look at the maintenance releases: http://sourceforge.net/projects/matplotlib/files/matplotlib-maintenance/ JDH
Hi, I am using a date plot with the toolbar to allow panning/zooming of the plot. If the user (mischievously) zooms in or out an extreme amount, there are some weird artifacts that I'd rather prevent so as to keep the display looking right and prevent possible crashes and lock-ups. For zooming out, I can get the display to lock up after zooming out something like more than 100 years (and the x axis is nearly solid with scrunched-up dates). For zooming in, I get this strange thing where the date axes will either just say "Date" and have no markers or then after a few more zooms in it will start giving a different year than I was on. Neither of these are real use cases--at all--but I thought it might be nice to limit just how much one can zoom in or out. Any suggestions for a good way to think about this are welcome. Thanks, Che
Hello - How can I download an old version of matplotlib from sourceforge (specifically, version 0.91.2)? This version is already installed on some other machines and I need to mirror the installation, but the OSes are different so I can't just copy the files over or something like that. As far as I can find, the sourceforge page only offers 0.99.1.2 for download: http://sourceforge.net/projects/matplotlib/ many thanks, Ian Rose
Does anyone know how to fix the tkagg interactive plotting in matplotlib? I have a Mac Book Pro, Mac OS X 10.4. I installed SAGE (a symbolic math package with Python2.6), but got the following error when trying to import pylab: /Applications/sage/local/lib/python2.6/site-packages/matplotlib/backends/backend_tkagg.py in <module>() 6 7 import Tkinter as Tk, FileDialog ----> 8 import tkagg # Paint image to Tk photo blitter extension 9 from backend_agg import FigureCanvasAgg 10 /Applications/sage/local/lib/python2.6/site-packages/matplotlib/backends/tkagg.py in <module>() 2 import Tkinter as Tk 3 4 def blit(photoimage, aggimage, bbox=None, colormode=1): 5 tk = photoimage.tk 6 ImportError: No module named _tkagg It appears this is matplotlib problem. Some googling turned up a web discussion where it was suggested that this is a matplotlib problem, not a SAGE one. The recent thread "[Matplotlib-users] problem with import pylab" suggests that, too. I've found a few comments online, but the "fixes" are all for Linux platforms. Does anyone know how to get TKagg interactive working on Mac OS X? It appears to revolve around getting the importable library _tkagg in place. Maybe other things, too. Thanks for any help or pointers. -- Lou Pecora
> Wayne Watson wrote: >> I've used MPL a bit, and am wondering if there's a facility for sending >> graphic images to a printer, or putting them in some format like png? you've already gotten an answer to the png part, but as for printing directly: I suspect you could make a pdf and send that to the printer with a system call, though it would be different on each system, and I don't know how any of those work any more (you used to be able to do "print filename" on Windows (or DOS, anyway!), and, of course, on *nix systems, "lpr filename" used to work. Another option is to use a GUI back end, but never bring up a window. You can use wxPython this way -- you need to create a wx.App(), and you may need to create a wx.Frame to put the MPL plot in (or you may not), but you don't have to Show() it. You an then call the wx printing code to print. I imagine it's similar for QT and GTK and TK. Note that for wx at least, you do need access to a Windowing system, even if you aren't displaying anything. HTH, -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chr...@no...
Thanks. I'll keep this in mind when I get to the point when I'm ready to consider it as part of a program I'm writing. Someone in Image-SIG sent me a module he wrote that might be helpful too. Michael Droettboom wrote: > Wayne Watson wrote: >> I've used MPL a bit, and am wondering if there's a facility for >> sending graphic images to a printer, or putting them in some format >> like png? I don't necessarily want the graphics to appear in a >> window, but would like to print them directly once they are ready. >> Can one put in a page feed, so that images don't all fall on the same >> page or cut across pages? >> > You can use one of the non-GUI backends to generate plots in a number > of formats, including PNG, PDF, PS and SVG. See this: > > http://matplotlib.sourceforge.net/faq/installing_faq.html#backends > > The PDF backend is the only one I'm aware of that supports multiple > pages. This is the docstring for PdfPages: > > A multi-page PDF file. > > Use like this:: > > # Initialize: > pp = PdfPages('foo.pdf') > > # As many times as you like, create a figure fig, then either: > fig.savefig(pp, format='pdf') # note the format argument! > # or: > pp.savefig(fig) > > # Once you are done, remember to close the object: > pp.close() > > (In reality PdfPages is a thin wrapper around PdfFile, in order to > avoid confusion when using savefig and forgetting the format > argument.) > >> Is there any image processing operation available to do simple >> operations like dark subtract or stack different images on one other >> to produce composites of several images? Maybe Python has such a >> facility that's already available as a library? >> >> > Matplotlib doesn't have a very strong set of these things built-in > (though some things are possible with the image support in the image > module). You can also get an rgb buffer of the figure (when using the > Agg backend), eg. (where 'fig' is the figure object): > > fig.canvas.get_renderer().tostring_rgb() > > This is a string of 24-bit rgb triples, which can be converted to the > Numpy array for arithmetical processing, or converted to a Python > Imaging Library Image object. > > Mike > -- Wayne Watson (Watson Adventures, Prop., Nevada City, CA) (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time) Obz Site: 39° 15' 7" N, 121° 2' 32" W, 2700 feet "I was thinking about how people seem to read the Bible a whole lot more as they get older; then it dawned on me . . they're cramming for their final exam." -- George Carlin Web Page: <www.speckledwithstars.net/>
----- Original Message ---- From: Christoph Gohlke <cg...@uc...> To: H L <hu...@ya...> Cc: mat...@li... Sent: Mon, January 18, 2010 5:04:22 PM Subject: Re: [Matplotlib-users] problem with import pylab The extension _TKAGG.PYD depends on TK84.DLL, TCL84.DLL, MSVCP71.DLL, and MSVCR71.DLL. Make sure all these files are located in the Windows search path, e.g. in one of the directories listed in the PATH environment variable. Christoph ------------------------------------------------------------------------------------------------- This is not just a problem on Windows. I have exactly the same problem when trying to use pylab with the SAGE package on my Mac OS X 10.4. I have put up questions on the SAGE support group, but have not gotten any replies. I did some googling and recall that someone on a group a while back said this was a basic problem with matplotlib. I cannot find that message, but the idea was that matplotlib was building only for file saving of graphics, not for interactive. I built my SAGE package from source so that might be right. I have a separate python framework that I use regularly and that has no problems. It's been a long time since I installed it from a binary that I don't remember if I had a problem with it, too. Unfortunately the version is different from SAGE's and I cannot just use the _tkagg module. My error message: /Applications/sage/local/lib/python2.6/site-packages/matplotlib/ backends/tkagg.py in <module>() 2 import Tkinter as Tk 3 4 def blit(photoimage, aggimage, bbox=None, colormode=1): 5 tk = photoimage.tk 6 ImportError: No module named _tkagg Anyone have any ideas or pointers? -- Lou Pecora, my views are my own.
Wayne Watson wrote: > I've used MPL a bit, and am wondering if there's a facility for sending > graphic images to a printer, or putting them in some format like png? > I don't necessarily want the graphics to appear in a window, but would > like to print them directly once they are ready. Can one put in a page > feed, so that images don't all fall on the same page or cut across pages? > You can use one of the non-GUI backends to generate plots in a number of formats, including PNG, PDF, PS and SVG. See this: http://matplotlib.sourceforge.net/faq/installing_faq.html#backends The PDF backend is the only one I'm aware of that supports multiple pages. This is the docstring for PdfPages: A multi-page PDF file. Use like this:: # Initialize: pp = PdfPages('foo.pdf') # As many times as you like, create a figure fig, then either: fig.savefig(pp, format='pdf') # note the format argument! # or: pp.savefig(fig) # Once you are done, remember to close the object: pp.close() (In reality PdfPages is a thin wrapper around PdfFile, in order to avoid confusion when using savefig and forgetting the format argument.) > Is there any image processing operation available to do simple > operations like dark subtract or stack different images on one other to > produce composites of several images? Maybe Python has such a facility > that's already available as a library? > > Matplotlib doesn't have a very strong set of these things built-in (though some things are possible with the image support in the image module). You can also get an rgb buffer of the figure (when using the Agg backend), eg. (where 'fig' is the figure object): fig.canvas.get_renderer().tostring_rgb() This is a string of 24-bit rgb triples, which can be converted to the Numpy array for arithmetical processing, or converted to a Python Imaging Library Image object. Mike -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA
On Mon, Jan 18, 2010 at 5:16 PM, Damon McDougall <D.M...@wa...> wrote: > The figure is actually cropped. Correct. > Is there another way around this that will get rid of the whitespace and have the physical figure be 483.69687pt wide? Do not use bbox_inches="tight". Instead adjust the position of the axes. You may use http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.subplots_adjust There is some way to automate this. http://matplotlib.sourceforge.net/faq/howto_faq.html#automatically-make-room-for-tick-labels Regards, -JJ
ashleyd wrote: > While I'm posting, another quick question -- my text output looks really > shoddy, even at high DPIs. It looks like somebody took a screenshot of a > tiny font and scaled it up with a linear filter. I have freetype installed, > and the matplotlib build script outputs the following, if it's helpful: > > BUILDING MATPLOTLIB > matplotlib: 0.99.1.1 > python: 2.5.4 (r254:67916, Apr 4 2009, 17:56:17) [GCC > 4.3.3] > platform: linux2 > > REQUIRED DEPENDENCIES > numpy: 1.2.1 > freetype2: 9.20.3 > > OPTIONAL BACKEND DEPENDENCIES > libpng: 1.2.27 > Tkinter: Tkinter: 67737, Tk: 8.5, Tcl: 8.5 > wxPython: 2.8.9.1 > * WxAgg extension not required for wxPython >= 2.8 > Gtk+: gtk+: 2.16.1, glib: 2.20.1, pygtk: 2.14.1, > pygobject: 2.16.1 > Mac OS X native: no > Qt: no > Qt4: no > Cairo: 1.4.12 > > OPTIONAL DATE/TIMEZONE DEPENDENCIES > datetime: present, version unknown > dateutil: 1.4.1 > pytz: 2008h > > OPTIONAL USETEX DEPENDENCIES > dvipng: 1.11 > ghostscript: 8.64 > latex: 3.141592 > pdftops: 0.10.5 > I'll let someone with more table and/or legend experience answer your first question. As for this part, this all looks fine. What backend are you using? Can you send a screenshot? Mike -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA
On Tue, Jan 19, 2010 at 2:48 AM, Kurt Forrester <kur...@ho...> wrote: > I modified the script for the hax. annotate(...) to include the > annotate_clip=False, however there is no change in the behaviour of the > arrows. It should be "annotation_clip" not "annotate_clip", but it may be just a typo. Anyhow, as far as I know (as I wrote the related code), there is no other setting. And your script work fine for me when "annotation_clip" parameter is added. While I'm testing this with the current svn version of matplolib, I don't think I see any bug fix related with this after 0.99.0 release. Anyhow, It would be great if you can install the newest version of matplotlib (0.99.1 or even svn) and see if arrows are still missing. Regards, -JJ
I'm trying to make a shadow effect behind text boxes in a plot (similarly to what can be done with legends). After a fair bit of searching around I found the matplotlib.patches.Shadow class which seems to be good for this. But I cannot get it to work properly. I suspect it has something to do with different transforms being used for the text itself and the actual bbox that surrounds it. This is what I have tried: import numpy as n import pylab as p import matplotlib.patches as pt p.figure() p.plot([0,1],[0,1]) ax=p.gca() tb=p.text(0.9,0.2,'test',horizontalalignment='center',verticalalignment='center',fontsize='small', color='green',weight='bold',bbox=dict(boxstyle="round,pad=0.5",ec='black',fill=False)) bb=tb.get_bbox_patch() sh=pt.Shadow(bb,0.1,0.1) ax.add_patch(sh) p.draw() p.show() This seems to produce nothing at all (or maybe something that is far outside the axis limits). Am I missing something obvious here? Is there some other method that will do this in an easier way? Would appreciate any help, cheers -- View this message in context: http://old.nabble.com/text-box-shadow-tp27224851p27224851.html Sent from the matplotlib - users mailing list archive at Nabble.com.
Hi, I wrote a gui with matplotlib embedded in gtk. However, using the zoom button from the navigation toolbar blacks out or randomises the graph until the zoom selection is finished, after which it is redrawn correctly. The same behaviour occurs with the example script: http://matplotlib.sourceforge.net/examples/user_interfaces/embedding_in_gtk2.html Did I miss something or is this a bug. Does anyone know how to fix this? I'm using version 0.99.1.1, but it was also present in 0.98.? Many thanks, Lucas -- View this message in context: http://old.nabble.com/zoom-problem-with-app-embedded-in-gtk-tp27224618p27224618.html Sent from the matplotlib - users mailing list archive at Nabble.com.
This is the BUG: https://sourceforge.net/tracker/?func=detail&aid=2927619&group_id=80706&atid=560720 If you close the window clicking on the right cross to close the window the window closes properly. If you then try to create a new widow (with the same index) you hit a RunTimeError. Expect: The window should be created normally. It seems that the pyQt4 backend doesn't delete the window in the python world but it does delete it in the C++. Any ideas hot to fix it?