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
(12) |
2
(15) |
3
(4) |
4
|
5
(1) |
6
(13) |
7
(8) |
8
(16) |
9
(10) |
10
(6) |
11
(11) |
12
(20) |
13
(8) |
14
(12) |
15
(10) |
16
(12) |
17
(6) |
18
(7) |
19
(18) |
20
(5) |
21
(9) |
22
|
23
(6) |
24
(3) |
25
|
26
(2) |
27
(26) |
28
(11) |
29
(9) |
30
(21) |
|
On 6/13/06, Norman Guinasso <no...@ge...> wrote: > I can't get import pylab to work. My matplotlabrc file and some ipython > output is attached. The font manager seems to fail. Any suggestions? > C:\Python24\lib\ntpath.py in splitdrive(p) > 117 """Split a pathname into drive and path specifiers. Returns > a 2-tupl > e > 118 "(drive,path)"; either part may be empty""" > --> 119 if p[1:2] == ':': > 120 return p[0:2], p[2:] > 121 return '', p > > TypeError: unsubscriptable object As a general suggestion in your case, and for other mpl/ipython users reporting problems: always set xmode verbose before sending your traceback. This will generate an extremely detailed traceback, which may contain valuable info for the developers, thus making it more likely that they can help you. Given how often the devs will not be able to directly reproduce the problem (lacking your exact hardware/software/configuration combination), such a traceback may be the only way for them to guess what's going on. As for your specific problem, I don't know :) Cheers, f
I can't get import pylab to work. My matplotlabrc file and some ipython output is attached. The font manager seems to fail. Any suggestions? ### MATPLOTLIBRC FORMAT # This is a sample matplotlib configuration file. It should be placed # in HOME/.matplotlib/matplotlibrc (unix/linux like systems) and # C:\Documents and Settings\yourname\.matplotlib (win32 systems) # # By default, the installer will overwrite the existing file in the # install path, so if you want to preserve your's, please move it to # your HOME dir and set the environment variable if necessary. # # This file is best viewed in a editor which supports python mode # syntax highlighting # # Blank lines, or lines starting with a comment symbol, are ignored, # as are trailing comments. Other lines must have the format # # key : val # optional comment # # Colors: for the color values below, you can either use # - a matplotlib color string, such as r, k, or b # - an rgb tuple, such as (1.0, 0.5, 0.0) # - a hex string, such as ff00ff (no '#' symbol) # - a scalar grayscale intensity such as 0.75 # - a legal html color name, eg red, blue, darkslategray #### CONFIGURATION BEGINS HERE # the default backend; one of GTK GTKAgg GTKCairo FltkAgg QtAgg TkAgg # Agg Cairo GD GDK Paint PS SVG Template backend : GTKAgg numerix : numpy # numpy, Numeric or numarray interactive : False # see http://matplotlib.sourceforge.net/interactive.html toolbar : toolbar2 # None | classic | toolbar2 timezone : UTC # a pytz timezone string, eg US/Central or Europe/Paris # Where your matplotlib data lives if you installed to a non-default # location. This is where the matplotlib fonts, bitmaps, etc reside datapath: C:\Python24\Lib\site-packages\matplotlib\mpl-data ### LINES # See http://matplotlib.sourceforge.net/matplotlib.lines.html for more # information on line properties. lines.linewidth : 1.0 # line width in points lines.linestyle : - # solid line lines.color : blue lines.marker : None # the default marker lines.markerfacecolor : blue lines.markeredgecolor : black lines.markeredgewidth : 0.5 # the line width around the marker symbol lines.markersize : 6 # markersize, in points lines.dash_joinstyle : miter # miter|round|bevel lines.dash_capstyle : butt # butt|round|projecting lines.solid_joinstyle : miter # miter|round|bevel lines.solid_capstyle : projecting # butt|round|projecting lines.antialiased : True # render lines in antialised (no jaggies) ### PATCHES # Patches are graphical objects that fill 2D space, like polygons or # circles. See # http://matplotlib.sourceforge.net/matplotlib.patches.html for more # information on patch properties patch.linewidth : 1.0 # edge width in points patch.facecolor : blue patch.edgecolor : black patch.antialiased : True # render patches in antialised (no jaggies) ### FONT # # font properties used by text.Text. See # http://matplotlib.sourceforge.net/matplotlib.font_manager.html for more # information on font properties. The 6 font properties used for font # matching are given below with their default values. # # The font.family property has five values: 'serif' (e.g. Times), # 'sans-serif' (e.g. Helvetica), 'cursive' (e.g. Zapf-Chancery), # 'fantasy' (e.g. Western), and 'monospace' (e.g. Courier). Each of # these font families has a default list of font names in decreasing # order of priority associated with them. # # The font.style property has three values: normal (or roman), italic # or oblique. The oblique style will be used for italic, if it is not # present. # # The font.variant property has two values: normal or small-caps. For # TrueType fonts, which are scalable fonts, small-caps is equivalent # to using a font size of 'smaller', or about 83% of the current font # size. # # The font.weight property has effectively 13 values: normal, bold, # bolder, lighter, 100, 200, 300, ..., 900. Normal is the same as # 400, and bold is 700. bolder and lighter are relative values with # respect to the current weight. # # The font.stretch property has 11 values: ultra-condensed, # extra-condensed, condensed, semi-condensed, normal, semi-expanded, # expanded, extra-expanded, ultra-expanded, wider, and narrower. This # property is not currently implemented. # # The font.size property is the default font size for text, given in pts. # 12pt is the standard value. # font.family : sans-serif font.style : normal font.variant : normal font.weight : medium font.stretch : normal # note that font.size controls default text sizes. To configure # special text sizes tick labels, axes, labels, title, etc, see the rc # settings for axes and ticks. Special text sizes can be defined # relative to font.size, using the following values: xx-small, x-small, # small, medium, large, x-large, xx-large, larger, or smaller font.size : 12.0 font.serif : New Century Schoolbook, Century Schoolbook L, Utopia, ITC Bookman, Bookman, Bitstream Vera Serif, Nimbus Roman No9 L, Times New Roman, Times, Palatino, Charter, serif font.sans-serif : Lucida Grande, Verdana, Geneva, Lucida, Bitstream Vera Sans, Arial, Helvetica, Avant Garde, sans-serif font.cursive : Apple Chancery, Textile, Zapf Chancery, Sand, cursive font.fantasy : Comic Sans MS, Chicago, Charcoal, Impact, Western, fantasy font.monospace : Andale Mono, Bitstream Vera Sans Mono, Nimbus Mono L, Courier New, Courier, Fixed, Terminal, monospace ### TEXT # text properties used by text.Text. See # http://matplotlib.sourceforge.net/matplotlib.text.html for more # information on text properties text.color : black text.usetex : False # use latex for all text handling. For more information, see # http://www.scipy.org/Wiki/Cookbook/Matplotlib/UsingTex text.dvipnghack : False # some versions of dvipng don't handle # alpha channel properly. Use True to correct and flush # ~/.matplotlib/tex.cache before testing ### AXES # default face and edge color, default tick sizes, # default fontsizes for ticklabels, and so on. See # http://matplotlib.sourceforge.net/matplotlib.axes.html#Axes axes.hold : True # whether to clear the axes by default on axes.facecolor : white # axes background color axes.edgecolor : black # axes edge color axes.linewidth : 1.0 # edge linewidth axes.grid : False # display grid or not axes.titlesize : 14 # fontsize of the axes title axes.labelsize : 12 # fontsize of the x any y labels axes.labelcolor : black polaraxes.grid : True # display grid on polar axes ### TICKS # see http://matplotlib.sourceforge.net/matplotlib.axis.html#Ticks xtick.major.size : 4 # major tick size in points xtick.minor.size : 2 # minor tick size in points xtick.major.pad : 4 # distance to major tick label in points xtick.minor.pad : 4 # distance to the minor tick label in points xtick.color : k # color of the tick labels xtick.labelsize : 12 # fontsize of the tick labels xtick.direction : in # direction: in or out ytick.major.size : 4 # major tick size in points ytick.minor.size : 2 # minor tick size in points ytick.major.pad : 4 # distance to major tick label in points ytick.minor.pad : 4 # distance to the minor tick label in points ytick.color : k # color of the tick labels ytick.labelsize : 12 # fontsize of the tick labels ytick.direction : in # direction: in or out ### GRIDS grid.color : black # grid color grid.linestyle : : # dotted grid.linewidth : 0.5 # in points ### Legend legend.isaxes : True legend.numpoints : 4 # the number of points in the legend line legend.fontsize : 14 legend.pad : 0.2 # the fractional whitespace inside the legend border legend.markerscale : 1.0 # the relative size of legend markers vs. original # the following dimensions are in axes coords legend.labelsep : 0.010 # the vertical space between the legend entries legend.handlelen : 0.05 # the length of the legend lines legend.handletextsep : 0.02 # the space between the legend line and legend text legend.axespad : 0.02 # the border between the axes and legend edge legend.shadow : False ### FIGURE # See http://matplotlib.sourceforge.net/matplotlib.figure.html#Figure figure.figsize : 8, 6 # figure size in inches figure.dpi : 80 # figure dots per inch figure.facecolor : 0.75 # figure facecolor; 0.75 is scalar gray figure.edgecolor : white # figure edgecolor # The figure subplot parameters. All dimensions are fraction of the # figure width or height figure.subplot.left : 0.125 # the left side of the subplots of the figure figure.subplot.right : 0.9 # the right side of the subplots of the figure figure.subplot.bottom : 0.1 # the bottom of the subplots of the figure figure.subplot.top : 0.9 # the top of the subplots of the figure figure.subplot.wspace : 0.2 # the amount of width reserved for blank space between subplots figure.subplot.hspace : 0.2 # the amount of height reserved for white space between subplots ### IMAGES image.aspect : free # free | preserve image.interpolation : bilinear # see help(imshow) for options image.cmap : jet # gray | jet image.lut : 256 # the size of the colormap lookup table image.origin : upper # lower | upper ### SAVING FIGURES # the default savefig params can be different for the GUI backends. # Eg, you may want a higher resolution, or to make the figure # background white savefig.dpi : 100 # figure dots per inch savefig.facecolor : white # figure facecolor when saving savefig.edgecolor : white # figure edgecolor when saving # tk backend params tk.window_focus : False # Maintain shell focus for TkAgg tk.pythoninspect : False # tk sets PYTHONINSEPCT # ps backend params ps.papersize : letter # executive, letter, legal, ledger, A0-A10, B0-B6, C0-C6 ps.useafm : False # use of afm fonts, results in small files ps.usedistiller : False # can be: None, ghostscript or xpdf # Experimental: may produce smaller files. # xpdf intended for production of publication quality files, # but requires ghostscript, xpdf and ps2eps ps.distiller.res : 6000 # dpi # Set the verbose flags. This controls how much information # matplotlib gives you at runtime and where it goes. Ther verbosity # levels are: silent, helpful, debug, debug-annoying. Any level is # inclusive of all the levels below it. If you setting is debug, # you'll get all the debug and helpful messages. When submitting # problems to the mailing-list, please set verbose to helpful or debug # and paste the output into your report. # # The fileo gives the destination for any calls to verbose.report. # These objects can a filename, or a filehandle like sys.stdout. # # You can override the rc default verbosity from the command line by # giving the flags --verbose-LEVEL where LEVEL is one of the legal # levels, eg --verbose-helpful. # # You can access the verbose instance in your code # from matplotlib import verbose. verbose.level : helpful # one of silent, helpful, debug, debug-annoying verbose.fileo : sys.stdout # a log filename, sys.stdout or sys.stderr Using the new pyreadline (thanks for participating in the testing!) Python 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v.1310 32 bit (Intel)] Type "copyright", "credits" or "license" for more information. ========================================================================== IPython 0.7.2.rc1 -- An enhanced Interactive Python. ? -> Introduction to IPython's features. %magic -> Information about IPython's 'magic' % functions. help -> Python's own help system. object? -> Details about 'object'. ?object also works, ?? prints more. In [1]: from pylab import * C:\Python24\lib\site-packages\matplotlib\__init__.py:947: UserWarning: Bad val " free" on line #199 "image.aspect : free # free | preserve" in file "C:\Documents and Settings\norman\.matplotlib\matplotlibrc" not a valid aspect specification warnings.warn('Bad val "%s" on line #%d\n\t"%s"\n\tin file "%s"\n\t%s' % ( loaded rc file C:\Documents and Settings\norman\.matplotlib\matplotlibrc matplotlib version 0.87.3 verbose.level debug interactive is False platform is win32 loaded modules: ['IPython.Prompts', 'IPython.pickleshare', '_bisect', 'distutils ', 'IPython.iplib', 'IPython.signal', 'random', 'IPython.FakeModule', 'ctypes.os ', 'gc', 'matplotlib.tempfile', 'IPython.bdb', 'distutils.sysconfig', 'ctypes._e ndian', 'pytz.datetime', 'IPython.time', 'msvcrt', 'IPython.ipy_system_conf', 's truct', 're', 'tempfile', 'pyreadline._ctypes', 'pprint', 'IPython.copy_reg', 'i mp', 'IPython.OInspect', 'collections', 'IPython.pydoc', 'pylab', 'IPython.cStri ngIO', 'IPython.rlineimpl', 'zipimport', 'string', 'pyreadline.traceback', 'IPyt hon.winconsole', 'repr', 'matplotlib.__future__', 'IPython.cmd', 'datetime', 'IP ython.Itpl', 'IPython.Debugger', 'distutils.re', 'IPython.excolors', 'IPython.Qu eue', 'IPython.os', 'pyreadline.rlmain', 'bisect', 'pyreadline.re', 'signal', 'c md', 'IPython.atexit', 'pydoc', 'pyreadline.console', 'token', 'IPython.ctypes', 'shlex', 'IPython.glob', 'IPython.shlex', 'IPython.site', 'IPython.exceptions', 'IPython.new', 'IPython.struct', 'dis', 'cStringIO', 'IPython.wildcard', 'local e', 'IPython.path', 'Queue', 'pyreadline.string', 'ipy_user_conf', 'IPython.type s', 'operator', 'IPython.commands', 'encodings', 'IPython.platutils_win32', 'pyr eadline.os', 'IPython.threading', 'bdb', 'IPython.ConfigLoader', 'pyreadline.glo b', 'IPython.CrashHandler', 'pyreadline.ctypes', 'matplotlib.sys', 'encodings.ty pes', 'ntpath', 'threading', 'new', 'pyreadline.exceptions', 'math', 'IPython.pl atutils_dummy', 'IPython.profile', 'IPython.ColorANSI', 'dateutil', 'optparse', 'UserDict', 'inspect', 'distutils.os', '_ctypes', 'IPython.hooks', 'exceptions', 'ctypes', 'pyreadline', 'ctypes.struct', 'codecs', 'path', 'pickleshare', 'pytz .bisect', 'md5', 'pyreadline.winconstants', 'commands', 'socket', 'thread', 'sre ', 'IPython.StringIO', 'traceback', 'IPython.pstats', 'itertools', 'opcode', 'IP ython.msvcrt', 'pstats', 'IPython.tokenize', 'distutils.sys', 'os', 'pdb', 'ext_ rescapture', 'ipy_system_conf', 'IPython.traceback', '__future__', '_sre', 'IPyt hon.Shell', 'IPython.ipmaker', '__builtin__', 'pyreadline.operator', 'matplotlib .re', 'pyreadline.math', 'IPython', 'distutils.string', 'ctypes._ctypes', 'ctype s.sys', 'matplotlib.datetime', 'IPython.codeop', 'errno', '_socket', 'binascii', 'IPython.sys', 'IPython.re', 'sre_constants', 'pyreadline.init_rl', 'IPython.pl atutils_posix', 'pyreadline.clipboard', 'matplotlib.md5', 'types', 'IPython.genu tils', 'tokenize', 'IPython.pdb', 'matplotlib.warnings', 'pyreadline.logger', 'm atplotlib.dateutil', 'cPickle', 'pytz.sys', 'IPython.platutils', 'IPython.macro' , '_codecs', 'IPython.token', '_locale', 'encodings.cp1252', 'IPython.IPython', 'IPython.string', 'pytz', 'IPython.__builtin__', 'clearcmd', 'copy', 'ext_rehash dir', 'matplotlib.os', 'IPython.socket', 'pyreadline.keysyms', 'keyword', 'atexi t', 'pyreadline.sys', 'StringIO', 'IPython.linecache', 'IPython.ipstruct', 'IPyt hon.__main__', 'encodings.aliases', 'fnmatch', 'sre_parse', 'IPython.ultraTB', ' pickle', 'IPython.tempfile', 'IPython.Release', 'IPython.OutputTrap', 'copy_reg' , 'sre_compile', '_random', 'IPython.ipy_user_conf', 'site', 'IPython.getopt', ' ctypes.itertools', 'IPython.inspect', '__main__', 'shutil', 'IPython.Magic', 'IP ython.pprint', 'strop', 'IPython.bisect', 'IPython.PyColorize', 'IPython.textwra p', 'IPython.shutil', 'encodings.codecs', 'gettext', 'IPython.pyreadline', 'pspe rsistence', 'IPython.Logger', 'getopt', 'encodings.exceptions', 'nt', 'pytz.sets ', 'profile', 'IPython.readline', 'stat', '_ssl', 'warnings', 'IPython.deep_relo ad', 'IPython.imp', 'glob', 'sets', 'textwrap', 'sys', 'ctypes.ctypes', 'codeop' , 'readline', 'IPython.keyword', 'os.path', 'matplotlib', 'IPython.background_jo bs', 'IPython.DPyGetOpt', 'IPython.cPickle', 'IPython.usage', 'matplotlib.distut ils', 'pytz.tzinfo', 'distutils.errors', 'marshal', 'IPython.__future__', 'linec ache', 'matplotlib.shutil', 'IPython.completer', 'time', 'matplotlib.pytz', 'pyr eadline.release', 'IPython.ipapi'] numerix numpy 0.9.8 font search path ['C:\\Python24\\Lib\\site-packages\\matplotlib\\mpl-data'] --------------------------------------------------------------------------- exceptions.TypeError Traceback (most recent call last) C:\Documents and Settings\norman\<ipython console> C:\Python24\Lib\site-packages\pylab.py ----> 1 from matplotlib.pylab import * C:\Python24\Lib\site-packages\matplotlib\pylab.py 198 import mlab #so I can override hist, psd, etc... 199 --> 200 from axes import Axes, PolarAxes 201 import backends 202 from cbook import flatten, is_string_like, exception_to_str, popd, \ C:\Python24\Lib\site-packages\matplotlib\axes.py 13 import matplotlib.mlab 14 from artist import Artist, setp ---> 15 from axis import XAxis, YAxis 16 from cbook import iterable, is_string_like, flatten, enumerate, \ 17 allequal, dict_delall, popd, popall, silent_list C:\Python24\Lib\site-packages\matplotlib\axis.py 23 from transforms import Value, blend_xy_sep_transform,\ 24 translation_transform, bbox_all, identity_transform ---> 25 from font_manager import FontProperties 26 from text import Text, TextWithDash, _process_text_args 27 from patches import bbox_artist C:\Python24\Lib\site-packages\matplotlib\font_manager.py 987 warnings.warn('Could not match %s, %s, %s. Returning %s' % (nam e, style, variant, self.defaultFont)) 988 989 return self.defaultFont 990 --> 991 fontManager = FontManager() C:\Python24\Lib\site-packages\matplotlib\font_manager.py in __init__(self, size, weight) 795 # Load TrueType fonts and create font dictionary. 796 --> 797 self.ttffiles = findSystemFonts(paths) + findSystemFonts() 798 799 for fname in self.ttffiles: C:\Python24\Lib\site-packages\matplotlib\font_manager.py in findSystemFonts(font paths, fontext) 194 fontpaths = [fontdir] 195 # now get all installed fonts directly... --> 196 for f in win32InstalledFonts(fontdir): 197 base, ext = os.path.splitext(f) 198 if len(ext)>1 and ext[1:].lower()==fontext: C:\Python24\Lib\site-packages\matplotlib\font_manager.py in win32InstalledFonts( directory, fontext) 120 try: 121 key, direc, any = _winreg.EnumValue( local, j) --> 122 if not os.path.dirname(direc): 123 direc = os.path.join(directory, direc) 124 direc = os.path.abspath(direc).lower() C:\Python24\lib\ntpath.py in dirname(p) 205 def dirname(p): 206 """Returns the directory component of a pathname""" --> 207 return split(p)[0] 208 209 C:\Python24\lib\ntpath.py in split(p) 162 Either part may be empty.""" 163 --> 164 d, p = splitdrive(p) 165 # set i to index beyond p's last slash 166 i = len(p) C:\Python24\lib\ntpath.py in splitdrive(p) 117 """Split a pathname into drive and path specifiers. Returns a 2-tupl e 118 "(drive,path)"; either part may be empty""" --> 119 if p[1:2] == ':': 120 return p[0:2], p[2:] 121 return '', p TypeError: unsubscriptable object In [2]: -- --
On 6/13/06, massimo sandal <mas...@un...> wrote: > 5-minute googling lets me wonder if it's a problem with os.utime() not > always playing nice with fat32 partitions... odd because on my previous > debian sarge with the same configuration, it didn't complain. Could be, but I'm not really sure. It would certainly be nice if the python docs listed this as a limitation of shutil (if it is one). Sorry but I won't be able to spend any further time on this one, I'm afraid. I don't know of what reasonable workaround mpl could use instead of shutil, which is supposed to be precisely a portability layer against this kind of problem. Cheers, f
>>>>> "John" == John Pye <joh...@st...> writes: John> Hi John, The image is correct when plotted using John> i=imread('plot.png') then imshow(i), but I want to add John> axes. I generated the image directly using GTK commands, John> then saved the pixbuf as png. The pixels in the image John> correspond to sample points in both x- and y-directions John> generated using exp(linspace(log(low),log(high),num). Why is John> there no logspace in matplotlib, btw? I'll be happy to add it -- how about sending a version? John> All I basically need is a way to say what the range and John> distribution of the pixels is: I don't want the axes to John> default to integer-numbered linear-spaced values as they John> currently do. John> I tried to see if I could use the set_xscale command but it John> seems to be internal and/or only applicable to polar plots? setting the xscale and yscale to 'log' should work fine, as long as you make sure the xaxis and yaxis do not contain nonpositive limits. For an MxN image, the default limits are 0..N-1 and 0..M-1 and the 0 will break the log transform. You can work around this by setting the image "extent" from pylab import figure, show, nx fig = figure() ax = fig.add_subplot(111) im = nx.mlab.rand(500,500) ax.imshow(im, extent=(1,501,1,501)) ax.set_xscale('log') ax.set_yscale('log') show() Hope this helps, JDH
Fernando Perez ha scritto: > This shows the benefits of 'xmode verbose' :) There's enough info in > that traceback to understand the problem: > This is the call that fails. To confirm this is the problem, try: > > shutil.move('/tmp/foo','/fat32partition/foo') > With any valid /tmp/foo file and your actual path to your fat32 > partition. Yes, it fails in the same way: In [5]: xmode verbose Exception reporting mode: Verbose In [6]: shutil.move('/tmp/tmp_Tzxny','/users/Massimo/') --------------------------------------------------------------------------- exceptions.OSError Traceback (most recent call last) /home/massimo/<ipython console> /usr/lib/python2.4/shutil.py in move(src='/tmp/tmp_Tzxny', dst='/users/Massimo/') 191 rmtree(src) 192 else: --> 193 copy2(src,dst) global copy2 = <function copy2 at 0xb7d8bb1c> src = '/tmp/tmp_Tzxny' dst = '/users/Massimo/' 194 os.unlink(src) 195 /usr/lib/python2.4/shutil.py in copy2(src='/tmp/tmp_Tzxny', dst='/users/Massimo/tmp_Tzxny') 91 dst = os.path.join(dst, os.path.basename(src)) 92 copyfile(src, dst) ---> 93 copystat(src, dst) global copystat = <function copystat at 0xb7d8baac> src = '/tmp/tmp_Tzxny' dst = '/users/Massimo/tmp_Tzxny' 94 95 /usr/lib/python2.4/shutil.py in copystat(src='/tmp/tmp_Tzxny', dst='/users/Massimo/tmp_Tzxny') 66 mode = stat.S_IMODE(st.st_mode) 67 if hasattr(os, 'utime'): ---> 68 os.utime(dst, (st.st_atime, st.st_mtime)) global os.utime = <built-in function utime> dst = '/users/Massimo/tmp_Tzxny' st.st_atime = 1150188691 st.st_mtime = 1149762561 69 if hasattr(os, 'chmod'): 70 os.chmod(dst, mode) OSError: [Errno 1] Operation not permitted: '/users/Massimo/tmp_Tzxny' > which in turn tries to call utime(): > >> /usr/lib/python2.4/shutil.py in >> copystat(src='/tmp/caba709a5ee736ae3148af077a1a9a38', dst='prova.eps') >> 66 mode = stat.S_IMODE(st.st_mode) >> 67 if hasattr(os, 'utime'): >> ---> 68 os.utime(dst, (st.st_atime, st.st_mtime)) >> global os.utime = <built-in function utime> >> dst = 'prova.eps' >> st.st_atime = 1150101622 >> st.st_mtime = 1150101622 >> 69 if hasattr(os, 'chmod'): >> 70 os.chmod(dst, mode) >> >> OSError: [Errno 1] Operation not permitted: 'prova.eps' > > is somehow not OK for fat32 partitions, or because you don't have the > right permissions on your system. > You need to be sure that you have your fat32 partition mounted with > the right user permissions, otherwise things like these can fail. My /etc/mtab line for the partition is as follows: /dev/hda7 /users vfat rw,utf8,umask=000,gid=46 0 0 this should mean everyone has full permissions on the partition, isn't it? > At this point, it's not yet clear if this is a problem with backend_ps > in mpl or your permissions configuration. 5-minute googling lets me wonder if it's a problem with os.utime() not always playing nice with fat32 partitions... odd because on my previous debian sarge with the same configuration, it didn't complain. m. -- Massimo Sandal University of Bologna Department of Biochemistry "G.Moruzzi" snail mail: Via Irnerio 48, 40126 Bologna, Italy email: mas...@un... tel: +39-051-2094388 fax: +39-051-2094387
Hi John, The image is correct when plotted using i=imread('plot.png') then imshow(i), but I want to add axes. I generated the image directly using GTK commands, then saved the pixbuf as png. The pixels in the image correspond to sample points in both x- and y-directions generated using exp(linspace(log(low),log(high),num). Why is there no logspace in matplotlib, btw? All I basically need is a way to say what the range and distribution of the pixels is: I don't want the axes to default to integer-numbered linear-spaced values as they currently do. I tried to see if I could use the set_xscale command but it seems to be internal and/or only applicable to polar plots? There's an ASCII mockup of what I'm wanting below. As I said, the image doesn't need to be stretched, just stuck straight on the right axes. Cheers JP 10 +-----|-----|-----+ | | | | 1 + + + + | | | my image here | 0.1+ + + + | | | | e-3+-----+-----+-----+ 0.1 1 10 100 John Hunter wrote: >>>>>> "John" == John Pye <joh...@st...> writes: >>>>>> > > John> Hi all, I have a PNG image that I would like to mount on > John> log-log axes. The points in the image correspond to computed > John> values on a log-log scale, so no scaling of the image is > John> required: I just want to stick it on top of suitably-marked > John> axes. It would be great if I could then overlay some dot > John> points as well. > > John> Is this possible with matplotlib? Can anyone give me some > John> pointers on how to do it? Or a better tool for this? > > I'm not sure from your post if the log scale applies to the implicit > xy coords of the pixels, or to the intensity of the pixels. I'm > assuming the former below (if it's the latter you probably want custom > normalize and colormap objects). > > logarithmic xy pixel locations may be possible with a NonuniformImage. > Take a look at the following for example code > > http://article.gmane.org/gmane.comp.python.matplotlib.general/4050 > > I'm not sure that this will work since I haven't tried it, but it's > the best bet as far as I can see. > > See how far you can get with it and if you get stuck, post a code > example and CC Nicholas and we'll see if we can progress. > > JDH > > > -- John Pye School of Mechanical and Manufacturing Engineering The University of New South Wales Sydney NSW 2052 Australia t +61 2 9385 5127 f +61 2 9663 1222 mailto:john.pye_AT_student_DOT_unsw.edu.au http://pye.dyndns.org/
>>>>> "John" == John Pye <joh...@st...> writes: John> Hi all, I have a PNG image that I would like to mount on John> log-log axes. The points in the image correspond to computed John> values on a log-log scale, so no scaling of the image is John> required: I just want to stick it on top of suitably-marked John> axes. It would be great if I could then overlay some dot John> points as well. John> Is this possible with matplotlib? Can anyone give me some John> pointers on how to do it? Or a better tool for this? I'm not sure from your post if the log scale applies to the implicit xy coords of the pixels, or to the intensity of the pixels. I'm assuming the former below (if it's the latter you probably want custom normalize and colormap objects). logarithmic xy pixel locations may be possible with a NonuniformImage. Take a look at the following for example code http://article.gmane.org/gmane.comp.python.matplotlib.general/4050 I'm not sure that this will work since I haven't tried it, but it's the best bet as far as I can see. See how far you can get with it and if you get stuck, post a code example and CC Nicholas and we'll see if we can progress. JDH
Hi all, I have a PNG image that I would like to mount on log-log axes. The points in the image correspond to computed values on a log-log scale, so no scaling of the image is required: I just want to stick it on top of suitably-marked axes. It would be great if I could then overlay some dot points as well. Is this possible with matplotlib? Can anyone give me some pointers on how to do it? Or a better tool for this? Cheers JP -- John Pye School of Mechanical and Manufacturing Engineering The University of New South Wales Sydney NSW 2052 Australia t +61 2 9385 5127 f +61 2 9663 1222 mailto:john.pye_AT_student_DOT_unsw.edu.au http://pye.dyndns.org/