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
(3) |
2
(1) |
3
(3) |
4
(8) |
5
(5) |
6
(1) |
7
(16) |
8
(7) |
9
(29) |
10
(16) |
11
(8) |
12
(8) |
13
(1) |
14
(17) |
15
(15) |
16
(23) |
17
(20) |
18
(25) |
19
(2) |
20
(3) |
21
(12) |
22
(6) |
23
(11) |
24
(6) |
25
(3) |
26
|
27
(2) |
28
(4) |
29
(19) |
30
(5) |
31
(33) |
|
|
Carol Leger wrote: > Hi folks, > > Is there a way to get the colors assigned with set_under and set over > besides looking at _rgba_set_under and _rgba_set_over? > > Sample code fragment: > from pylab import * > cmap = cm.get_cmap('jet') > cmap.set_over('wheat') > > # Make some kind of polygon to fill > x = ... > y = ... > # Use the over-the-top color to fill the polygon > clrstr = rgb2hex(cmap._rgba_over[:3]) > fill(x,y,clrstr) > There is no better way at present. I could add getters for these properties if there is sufficient need; it never occurred to me that anyone would need getters for them, and I did not want to clutter the API. Did you resolve the problem you were having earlier with the colorbar diplay of the "under" value? Eric
Rob Hetland wrote: > I really like Arev Sans, but others like the new STIX fonts. This > setup is for Arev Sans. The important stuff is what begins with > mathtext. If you want serif fonts, this should be enough to get you > started on customizing. Just make sure whatever fontset you pick has > all of the math symbols built in, or change fallback_to_cm to True. When I converted my matplotlibrc to the settings you listed, the result was pages and pages of exception tracebacks ending in: C:\Python25\Lib\site-packages\matplotlib\mathtext.py in _get_font(self, font) 590 cached_font = self._fonts.get(basename) 591 if cached_font is None: --> 592 font = FT2Font(basename) 593 cached_font = self.CachedFont(font) 594 self._fonts[basename] = cached_font If I remove all the LaTeX from my expressions, this error goes away. Jordan TypeError: cannot return std::string from Unicode object
I also have another gui script where you move a slider around and it changes the colormap, using axes.images[0].set_cmap() figure.canvas.Refresh() in real time. It works wonderfully most of the time but occasionally goes crazy, spouting a loop like this: Traceback (most recent call last): File "C:\Python25\Lib\site-packages\matplotlib\backends\backend_wx.py", line 1352, in _onClose File "C:\Python25\Lib\site-packages\matplotlib\_pylab_helpers.py", line 28, in destroy File "C:\Python25\Lib\site-packages\matplotlib\backends\backend_wx.py", line 1406, in destroy File "C:\Python25\Lib\site-packages\matplotlib\backends\backend_wx.py", line 1365, in Destroy File "C:\Python25\Lib\site-packages\wx-2.8-msw-unicode\wx\_core.py", line 7198, in Yield wx._core.PyAssertionError: C++ assertion "wxAssertFailure" failed at ..\..\src\msw\app.cpp(680) in wxApp::Yield(): wxYield called recursively Traceback (most recent call last): File "C:\Python25\Lib\site-packages\matplotlib\backends\backend_wx.py", line 1111, in _onSize File "C:\Python25\Lib\site-packages\matplotlib\backends\backend_wxagg.py", line 61, in draw File "C:\Python25\Lib\site-packages\matplotlib\backends\backend_agg.py", line 380, in draw File "C:\Python25\Lib\site-packages\matplotlib\figure.py", line 612, in draw File "C:\Python25\lib\site-packages\matplotlib\axes.py", line 1344, in draw File "C:\Python25\Lib\site-packages\matplotlib\axis.py", line 596, in draw File "C:\Python25\Lib\site-packages\matplotlib\axis.py", line 170, in draw File "C:\Python25\Lib\site-packages\matplotlib\text.py", line 775, in draw File "C:\Python25\Lib\site-packages\matplotlib\text.py", line 317, in draw File "C:\Python25\Lib\site-packages\matplotlib\text.py", line 195, in _get_layout File "C:\Python25\Lib\site-packages\matplotlib\backends\backend_agg.py", line 234, in get_text_width_height_descent File "C:\Python25\Lib\site-packages\matplotlib\backends\backend_agg.py", line 301, in _get_agg_font RuntimeError: Could not open facefile c:\windows\fonts\vera.ttf; Cannot_Open_Resource I'm pretty lost about it :) Thanks, Jack On Jan 17, 2008 6:03 PM, Jack Sankey <jac...@gm...> wrote: > Hello, > > I wrote a script that loops over some files, plotting them > individually with imshow(). In between each file, the program waits > for user input and then clears/closes the current figure before making > a new one. > > Roughly 5-10 files into the loop, the script dies, outputting a loop > of stuff like this until I close the figure: > > File "C:\Python25\Lib\site-packages\matplotlib\pyplot.py", line 201, in gcf > File "C:\Python25\Lib\site-packages\matplotlib\pyplot.py", line 187, in figure > File "C:\Python25\Lib\site-packages\matplotlib\backends\backend_wxagg.py", > line 120, in new_figure_manager > File "C:\Python25\Lib\site-packages\matplotlib\backends\backend_wx.py", > line 1302, in __init__ > File "C:\Python25\Lib\site-packages\matplotlib\backends\backend_wxagg.py", > line 39, in _get_toolbar > File "C:\Python25\Lib\site-packages\matplotlib\backends\backend_wx.py", > line 1593, in __init__ > File "C:\Python25\Lib\site-packages\matplotlib\backend_bases.py", > line 1391, in __init__ > File "C:\Python25\Lib\site-packages\matplotlib\backends\backend_wx.py", > line 1615, in _init_toolbar > File "C:\Python25\Lib\site-packages\matplotlib\backends\backend_wx.py", > line 1452, in _load_bitmap > File "C:\Python25\Lib\site-packages\wx-2.8-msw-unicode\wx\_gdi.py", > line 530, in __init__ > PyAssertionError: C++ assertion "IsOpened()" failed at > ..\..\src\common\ffile.cpp(187) in wxFFile::Seek(): can't seek on > closed file > > Alternatively, it occasionally will tell me there are too many files > open. I have checked and all my file operations include a close(). Any > thoughts? I am using wxpython and wxAgg as my backend, with pycrust > (pyshell) on windows XP. > > Thanks, > Jack >
Hello, I wrote a script that loops over some files, plotting them individually with imshow(). In between each file, the program waits for user input and then clears/closes the current figure before making a new one. Roughly 5-10 files into the loop, the script dies, outputting a loop of stuff like this until I close the figure: File "C:\Python25\Lib\site-packages\matplotlib\pyplot.py", line 201, in gcf File "C:\Python25\Lib\site-packages\matplotlib\pyplot.py", line 187, in figure File "C:\Python25\Lib\site-packages\matplotlib\backends\backend_wxagg.py", line 120, in new_figure_manager File "C:\Python25\Lib\site-packages\matplotlib\backends\backend_wx.py", line 1302, in __init__ File "C:\Python25\Lib\site-packages\matplotlib\backends\backend_wxagg.py", line 39, in _get_toolbar File "C:\Python25\Lib\site-packages\matplotlib\backends\backend_wx.py", line 1593, in __init__ File "C:\Python25\Lib\site-packages\matplotlib\backend_bases.py", line 1391, in __init__ File "C:\Python25\Lib\site-packages\matplotlib\backends\backend_wx.py", line 1615, in _init_toolbar File "C:\Python25\Lib\site-packages\matplotlib\backends\backend_wx.py", line 1452, in _load_bitmap File "C:\Python25\Lib\site-packages\wx-2.8-msw-unicode\wx\_gdi.py", line 530, in __init__ PyAssertionError: C++ assertion "IsOpened()" failed at ..\..\src\common\ffile.cpp(187) in wxFFile::Seek(): can't seek on closed file Alternatively, it occasionally will tell me there are too many files open. I have checked and all my file operations include a close(). Any thoughts? I am using wxpython and wxAgg as my backend, with pycrust (pyshell) on windows XP. Thanks, Jack
Hi folks, Is there a way to get the colors assigned with set_under and set over besides looking at _rgba_set_under and _rgba_set_over? Sample code fragment: from pylab import * cmap = cm.get_cmap('jet') cmap.set_over('wheat') # Make some kind of polygon to fill x = ... y = ... # Use the over-the-top color to fill the polygon clrstr = rgb2hex(cmap._rgba_over[:3]) fill(x,y,clrstr) -- Ms. Carol A. Leger SRI International Phone: (650) 859-4114 333 Ravenswood Avenue G-273 Menlo Park, CA 94025 e-mail: le...@sr...
All very helpful information. Thanks. This is probably something to move to the pygtk list. Personally, I don't consider it a high priority since the Gdk backend is limited in a number of other ways. Maybe someone more motivated (who uses X remotely, for instance) wants to take the charge. It would probably benefit more than just mpl. Cheers, Mike
James Boyle wrote: > I am using the colorbar with a discrete set of intervals, the > progression through the levels is not linear. > Presently, the colorbar call labels every other level, this looks > very nice, but unfortunately in my case one cannot infer the value > of the unlabeled levels due to the non-linear scale. > Is there any easy way to force a label for every level ? > I am aware of the ticker - Locator, Formatter mechanism but I am > looking for a very simple solution. If not I'll just do it. Jim, Try the ticks=blist kwarg, where blist is the list of boundaries that you want labeled. The ticks kwarg can specify either a sequence or a Locator; if no ticks kwarg is given then a default Locator is used. Eric > > Thanks for any help. > > --Jim > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Michael Droettboom wrote: >> not quite -- it would have to be re-written to use the array >> interface, which is different, as that can be done without requiring >> numpy, or its headers. > > Of course, that's what I meant. It is passed numpy arrays now -- but > they are accessed with all of the function call overhead of the Python > sequence API, rather than the numpy array interface. right, which is slow, slower than lists. In fact, it might make sense for MPL to convert to a list of tuples (using numpy) first, then pass that to pyGTK: l = array.tolist() It might speed things up a bit -- it did with wxPython a while back. >> That was true before the array interface, when supporting arrays >> essentially meant a dependency on numpy. That's not longer true, so >> it's quite likely that the pygtk folks would accept a patch -- someone >> still would need to write that patch, though! > > Unless I misunderstand, I thought that functionality was slated for > inclusion in Python 3.0 -- still a long ways off in terms of adoption > rate. That patch would only make sense on a pygtk branch specifically > intended for Python 3.0. The array interface is slated for be built-in for Py3k, but you can use it in the meantime. You just need to make sure your code understands it. PIL, for instance, uses it for its fromarray() and toarray() methods. Travis O. and others on the numpy list have been very helpful to folks trying to add it to their packages. -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...
Hi all, Thanks for the helpful responses. I had switched back to Matlab, meanwhile. lasso_demo.py does look close to what I had wanted to implement. Earlier, while checking it out, I must have right-clicked first and after that it didn't seem to work ( perhaps a bug? ). I'll look in to Rob's solution as well, once I upgrade to the latest release. Thanks, Venkat. Michael Droettboom wrote: > John Hunter wrote: > >> On Jan 4, 2008 4:33 PM, Mephisto <dr_...@ho...> wrote: >> >>> For some simple but effective Python code you can use to create a mask >>> similar to that provided by the Matlab roipoly function, see >>> http://www.ariel.com.au/a/python-point-int-poly.html >>> http://www.ariel.com.au/a/python-point-int-poly.html . The code seems to be >>> quite effective. >>> >> matplotlib implements these algorithms in C -- see >> matplotlib.nxutils.pnpoly for a testing inclusion of a single point, >> and matplotlib.nxutils.points_inside_poly for testing multiple points. >> There is some example code using the latter function at >> http://matplotlib.sf.net/examples/lasso_demo.py. Not sure why this >> example is not working for Venkat. >> > > This is probably not the reason for Venkat (I think he said he was using > 0.87)... but lasso_demo.py is currently broken on the trunk, and working > for me in 0.91.2. I'm looking into it. > > Cheers, > Mike > > -- Venkat Ramanan, Research Associate, Imaging Research, Sunnybrook Health Sciences Centre, 2075 Bayview Ave, Toronto-M4N3M5 Ontario, Canada
I am using the colorbar with a discrete set of intervals, the progression through the levels is not linear. Presently, the colorbar call labels every other level, this looks very nice, but unfortunately in my case one cannot infer the value of the unlabeled levels due to the non-linear scale. Is there any easy way to force a label for every level ? I am aware of the ticker - Locator, Formatter mechanism but I am looking for a very simple solution. If not I'll just do it. Thanks for any help. --Jim
I'm hoping someone can shed some light on this. I get the following error when building on OSX. Notice that it looks into /usr/local for libraries: /usr/local/include/ft2build.h:56:38:/usr/local/include/ft2build.h:56:38: error: error: freetype/config/ftheader.h: No such file or directoryfreetype/config/ftheader.h: No such file or directory Even though there is nothing that points there in my env: MANPATH=/usr/share/man:/usr/local/share/man:/usr/X11/man TERM=xterm-color SHELL=/bin/bash SSH_CLIENT=fe80::211:24ff:fe8d:9019%en1 57594 22 OLDPWD=/Users/chris/Development/freetype-2.3.5 LFLAGS=-arch ppc -arch i386 -L/Users/chris/Development/libpng-1.2.23 -L/Users/chris/Development/freetype-2.3.5 SSH_TTY=/dev/ttys001 USER=chris PAGER=less MAIL=/var/mail/chris PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin: /usr/local/bin:/usr/texbin PWD=/Users/chris/Development/matplotlib PS1=(\[$(tput md)\]\t <\w>\[$(tput me)\]) $(echo $?) \$ SHLVL=1 HOME=/Users/chris CFLAGS=-arch ppc -arch i386 -I/Users/chris/Development/libpng-1.2.23 -I/Users/chris/Development/freetype-2.3.5 PYTHONPATH=/Library/Python/2.5/site-packages: LESS=-r LOGNAME=chris SSH_CONNECTION=fe80::211:24ff:fe8d:9019%en1 57594 fe80::214:51ff:feef:bad8%en1 22 _=/usr/bin/env Moreover, basedir['darwin'] is set to [] in setupext.py. So, I'm totally baffled. Where else could matplotlib be getting library path information from?? Thanks.
I dont think newlines are supported this way in tex. Here's an example: \documentclass[]{article} \begin{document} $a=e^{i\pi}\\x=y$ $$a=e^{i\pi}\\x=y$$ \begin{eqnarray} a & = & \frac{e^{i\pi}}{e^{-i\pi}} \\ & = & e^{i2\pi} \end{eqnarray} \end{document} The first treats the newline as if it occurred in regular text mode, the second ignores the newline entirely, and the third is intelligent enough to do what it should. On Thursday 17 January 2008 08:51:06 am Michael Droettboom wrote: > There is no way to insert newlines in the mathtext part of the string > (by that I mean between the '$'). However, you can put newline > characters outside of '$'. It gets a bit hairy because of Python's > string escaping rules, but you could do something like: > > "$\\alpha=%G$\n$\\beta=%G$" > > Note the double \\ where we really want a backslash, since we can't use > "raw" string literals and write a newline character. > > One other caveat: The spacing of the lines doesn't take into account the > height of the math expression, so you can really only do simple > one-liners (i.e. no fractions or exponents) in the math expression. > Your example looks like it will work though. > > This is really sort of "unsupported" and my example works only by > accident... it's something I didn't think about while re-writing > mathtext recently. Hopefully this can be improved in a future version > -- I can see it as being generally useful. > > Also -- for others on the list: Is there a TeX or LaTeX standard for > putting newlines in the middle of a math expression that perhaps we > should support? All the Googling I've been able to do basically assumes > that layout such as that would occur in a layer outside of the math > expression (with the exception of typesetting things like matrices). > > Cheers, > Mike > > BL wrote: > > Hi, > > > > I want to display the values of some variable (namely, alpha, beta, > > gamma, delta) on a plot, and making a legend like > > "$ \alpha=%G, \ \bet=%G, \ \gamma=%G, \ \delta=%G $" % values is not > > very readable. > > Is there away to make multiline mathtext ? > > > > > > thanks > > > > BL > > > > > > ------------------------------------------------------------------------ > > > > ------------------------------------------------------------------------- > > This SF.net email is sponsored by: Microsoft > > Defy all challenges. Microsoft(R) Visual Studio 2008. > > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > > > > > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > Matplotlib-users mailing list > > Mat...@li... > > https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Darren S. Dale, Ph.D. Staff Scientist Cornell High Energy Synchrotron Source Cornell University 275 Wilson Lab Rt. 366 & Pine Tree Road Ithaca, NY 14853 dar...@co... office: (607) 255-3819 fax: (607) 255-9001 http://www.chess.cornell.edu
I do this sort of stuff all of the time. I have a tool that is interactive, making a polygon that you can edit (similar to poly_editor in the examples), that is linked to the polygeom class below, but it is broken in the new transforms release of the code. poly_editor is also broken, by the way. You can't insert a point anymore. For now, you can use these simpler tools: Good luck, -Rob
Darren Dale wrote: > On Wednesday 16 January 2008 08:22:45 am Michael Droettboom wrote: >> But reading Darren's new bug report makes me wonder if my fix was >> correct. To be honest, I'm a little confused by the bug report, not out >> of any lack of clarity on Darren's part, but I think due to insufficient >> understanding of the problem. As assumption about the purpose of cla is >> that is should return the plot to a pristine state -- and in this case >> that means linear axes. But are you suggesting that sometimes that is >> not the case? > > If you have hold=True, and the x or y scale is log, repeated calls to plot() > will add new lines to the plot without changing the scaling. If hold is > instead False, one might reasonably expect that future calls to plot would > replace the old line with the new one, again without changing the scaling. > That would be consistent. Instead, the scaling changes. That indeed is a problem. I suspect it has something to do with the extra step that log scales do to "round" to the nearest decade. I can have a look when I get a chance, or let me know if you'd like to tackle it, Darren. Cheers, Mike -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA
John Hunter wrote: > On Jan 4, 2008 4:33 PM, Mephisto <dr_...@ho...> wrote: >> For some simple but effective Python code you can use to create a mask >> similar to that provided by the Matlab roipoly function, see >> http://www.ariel.com.au/a/python-point-int-poly.html >> http://www.ariel.com.au/a/python-point-int-poly.html . The code seems to be >> quite effective. > > matplotlib implements these algorithms in C -- see > matplotlib.nxutils.pnpoly for a testing inclusion of a single point, > and matplotlib.nxutils.points_inside_poly for testing multiple points. > There is some example code using the latter function at > http://matplotlib.sf.net/examples/lasso_demo.py. Not sure why this > example is not working for Venkat. This is probably not the reason for Venkat (I think he said he was using 0.87)... but lasso_demo.py is currently broken on the trunk, and working for me in 0.91.2. I'm looking into it. Cheers, Mike -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA
John Hunter wrote: > On Jan 16, 2008 1:03 PM, Kevin Christman <kch...@ya...> wrote: > def myfunc(x, pos=0): > return '%1.2f''%(100*x) And you may want to try: def myfunc(x, pos=0): return '%1.2f%%''%(100*x) to get a percent sign after each value. (I mention it only because the "double percent" trick is non-obvious to many newcomers to Python's string formatting syntax.) Cheers, Mike -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA
There was a change between 0.90 to 0.91 as to how the TrueType to Type 42 (which is essentially a thin wrapper around a TrueType font) conversion is done. In 0.90 it was done in Python -- in 0.91 when font subsetting was added, this conversion is done in some borrowed C code called "ttconv". That's just a guess as to what may be the specific cause. I don't have a copy of Illustrator, so I haven't done any testing with that. I'm happy to hear of a positive report from Rob. Perhaps you both (Rob and Jordan) are using different versions of Illustrator? Note that ps.useafm essentially overrides the ps.fonttype setting. If ps.useafm is True, you will always only get one of the 14 "builtin" Postscript fonts, which are not embedded in the file because all Postscript interpreters are required to support them. If ps.useafm is False, then the other setting kicks in. Type 42 essentially includes the whole Truetype font somewhat verbatim in the Ps file. Type 3 will include only the used characters, using a format that is more native to Postscript. All of them *should* be able to be editable on a purely theoretical level, though I would imagine Type 3 to be broken if you try to add a character that wasn't embedded in the file. (This is different from how matplotlib does SVG font embedding where the original text really is lost). But I don't really know what Illustrator's abilities and limitations are in that regard. Hopefully Rob's suggestions will work for you. Otherwise, I may want to revisit pulling the old Type 42 code back out of SVN to see if that solves your problem. A good place to start might be if you could send me (off list) two eps files of the same plot -- one created with 0.90.1, and one with 0.91.2. Cheers, Mike Rob Hetland wrote: > There have been quite a few changes to fonts in MPL since 8.x. > Perhaps one of the biggest is mathtext. Real unicode fonts with > mathematics. Since you do what I do, sort of, I am guessing that you > might be happy with the same configuration I use. I looks great, and > can be edited in Illustrator (et al.). > > I really like Arev Sans, but others like the new STIX fonts. This > setup is for Arev Sans. The important stuff is what begins with > mathtext. If you want serif fonts, this should be enough to get you > started on customizing. Just make sure whatever fontset you pick has > all of the math symbols built in, or change fallback_to_cm to True. > > -Rob > > > font.family : sans-serif > font.style : normal > font.variant : normal > font.weight : medium > font.stretch : normal > font.size : 12.0 > font.serif : STIX, Bitstream Vera Serif, New Century > Schoolbook, Century Schoolbook L, Utopia, ITC Bookman, Bookman, > Nimbus Roman No9 L, Times New Roman, Times, Palatino, Charter, serif > font.sans-serif : Arev Sans > font.cursive : Zapfino, Apple Chancery, Textile, Sand, cursive > font.fantasy : Chicago, Comic Sans MS, Charcoal, Impact, > Western, fantasy > font.monospace : Bitstream Vera Sans Mono, Andale Mono, Nimbus > Mono L, Courier New, Courier, Fixed, Terminal, monospace > > > text.color : black > text.usetex : False > text.dvipnghack : True > > mathtext.fallback_to_cm : False > mathtext.fontset : custom > > mathtext.cal : Arev Sans:oblique > mathtext.it : Arev Sans:oblique > mathtext.rm : Arev Sans > mathtext.bf : Arev Sans:bold > mathtext.sf : Arev Sans > > pdf.fonttype : 42 > > > > > > On Jan 16, 2008, at 10:13 PM, Jordan Dawe wrote: > >> Setting ps.useafm = True while ps.fonttype = 42 allows illustrator to >> open the eps files again and gives me back text editing capability, >> but >> I don't have any control over the typeface anymore, it just >> defaults to >> Helvetica. >> >> Jordan >> >> ---------------------------------------------------------------------- >> --- >> This SF.net email is sponsored by: Microsoft >> Defy all challenges. Microsoft(R) Visual Studio 2008. >> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > ---- > Rob Hetland, Associate Professor > Dept. of Oceanography, Texas A&M University > http://pong.tamu.edu/~rob > phone: 979-458-0096, fax: 979-845-6331 > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA
There is no way to insert newlines in the mathtext part of the string (by that I mean between the '$'). However, you can put newline characters outside of '$'. It gets a bit hairy because of Python's string escaping rules, but you could do something like: "$\\alpha=%G$\n$\\beta=%G$" Note the double \\ where we really want a backslash, since we can't use "raw" string literals and write a newline character. One other caveat: The spacing of the lines doesn't take into account the height of the math expression, so you can really only do simple one-liners (i.e. no fractions or exponents) in the math expression. Your example looks like it will work though. This is really sort of "unsupported" and my example works only by accident... it's something I didn't think about while re-writing mathtext recently. Hopefully this can be improved in a future version -- I can see it as being generally useful. Also -- for others on the list: Is there a TeX or LaTeX standard for putting newlines in the middle of a math expression that perhaps we should support? All the Googling I've been able to do basically assumes that layout such as that would occur in a layer outside of the math expression (with the exception of typesetting things like matrices). Cheers, Mike BL wrote: > Hi, > > I want to display the values of some variable (namely, alpha, beta, > gamma, delta) on a plot, and making a legend like > "$ \alpha=%G, \ \bet=%G, \ \gamma=%G, \ \delta=%G $" % values is not > very readable. > Is there away to make multiline mathtext ? > > > thanks > > BL > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > > > ------------------------------------------------------------------------ > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA
There have been quite a few changes to fonts in MPL since 8.x. Perhaps one of the biggest is mathtext. Real unicode fonts with mathematics. Since you do what I do, sort of, I am guessing that you might be happy with the same configuration I use. I looks great, and can be edited in Illustrator (et al.). I really like Arev Sans, but others like the new STIX fonts. This setup is for Arev Sans. The important stuff is what begins with mathtext. If you want serif fonts, this should be enough to get you started on customizing. Just make sure whatever fontset you pick has all of the math symbols built in, or change fallback_to_cm to True. -Rob font.family : sans-serif font.style : normal font.variant : normal font.weight : medium font.stretch : normal font.size : 12.0 font.serif : STIX, Bitstream Vera Serif, New Century Schoolbook, Century Schoolbook L, Utopia, ITC Bookman, Bookman, Nimbus Roman No9 L, Times New Roman, Times, Palatino, Charter, serif font.sans-serif : Arev Sans font.cursive : Zapfino, Apple Chancery, Textile, Sand, cursive font.fantasy : Chicago, Comic Sans MS, Charcoal, Impact, Western, fantasy font.monospace : Bitstream Vera Sans Mono, Andale Mono, Nimbus Mono L, Courier New, Courier, Fixed, Terminal, monospace text.color : black text.usetex : False text.dvipnghack : True mathtext.fallback_to_cm : False mathtext.fontset : custom mathtext.cal : Arev Sans:oblique mathtext.it : Arev Sans:oblique mathtext.rm : Arev Sans mathtext.bf : Arev Sans:bold mathtext.sf : Arev Sans pdf.fonttype : 42 On Jan 16, 2008, at 10:13 PM, Jordan Dawe wrote: > Setting ps.useafm = True while ps.fonttype = 42 allows illustrator to > open the eps files again and gives me back text editing capability, > but > I don't have any control over the typeface anymore, it just > defaults to > Helvetica. > > Jordan > > ---------------------------------------------------------------------- > --- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users ---- Rob Hetland, Associate Professor Dept. of Oceanography, Texas A&M University http://pong.tamu.edu/~rob phone: 979-458-0096, fax: 979-845-6331
The subject line intrigues me, and hopefully I can help. For whatever reason, the body of your message didn't make it to the mailing list. Can you please resend? Cheers, Mike BL wrote: > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > > > ------------------------------------------------------------------------ > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA
John Hunter wrote: > On Jan 15, 2008 7:46 AM, Michael Droettboom <md...@st...> wrote: >> Ah -- just thought of something else. >> >> If I adjust simple_plot_fps.py to have 100,000 data points rather than >> 1,000 I see something that starts to match with what you're seeing: >> >> GtkAgg: >> wallclock: 4.23297405243 >> user: 3.33 >> fps: 23.6240522057 >> >> Gtk: >> wallclock: 15.0203828812 >> user: 14.92 >> fps: 6.65761990165 >> >> TkAgg: >> wallclock: 4.8252530098 >> user: 4.67 >> fps: 20.7243018754 >> >> You can see that the Gtk time is starting to explode. If I go to >> 1,000,000 points, Gtk runs out of memory before the first plot, whereas >> the other two continue to chug along at a reasonable pace. >> >> From looking at the code, I suspect the crucial difference is that the >> Gdk backend uses the Python sequence API (rather slow) to access the >> data as it gets rendered, whereas GtkAgg uses the numpy array interface >> which is essentially raw access to a C array. > > This is not likely to be the culprit -- for drawing markers, the old > matplotlib API made a separate call to draw_polygon for every marker, > with a new gc each time. Many moons ago, we implemented draw_markers > as a renderer method to avoid this problem. For hundreds of thousands > of markers, we saw performance benefits of 25x to 100x. The backends > which implement draw_markers (Agg and PS) get the benefits, but the > other backends which did not are still slow. Basically it is a problem > with a lot of redundant function call overhead. The backend_bases > renderer method _draw_markers discusses this a little bit (it is > underscore hidden). Markers are not the issue here. These benchmarks were done with lines. There are markers for the ticks, of course, but the number of those are fixed. I agree it's function call overhead, but I believe it's in the overhead of PySequence_GetItem vs. array[index]. In both cases, the line is still getting drawn with a single Python -> C function call. > My guess is this difference will not be so pronounced on the trunk. Actually, I'm getting surprising results there. Numbers are in fps. Gtk GtkAgg 0.91.2, 1000 points 50 26 0.91.2, 10000 points 6 23 trunk, 1000 points 38 31 trunk, 10000 points 3 9 So, yes, the ratio between Gtk and GtkAgg on the trunk is not as pronounced. I'm a little disappointed by the timings on the trunk -- while one could say that Agg is a little better on the trunk with 1000 points, it doesn't scale nearly as well. That's certainly something to look into -- and I don't have any thoughts offhand. I would expect the trunk to do better since it doesn't perform a memory copy on the data with each call to draw_line/draw_path. Cheers, Mike -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA
Christopher Barker wrote: > Michael Droettboom wrote: >> It's sort of a pygtk issue -- it >> would have to be rewritten to take numpy arrays > > not quite -- it would have to be re-written to use the array interface, > which is different, as that can be done without requiring numpy, or its > headers. Of course, that's what I meant. It is passed numpy arrays now -- but they are accessed with all of the function call overhead of the Python sequence API, rather than the numpy array interface. > > which is probably >> unlikely to happen in the official codebase. > > That was true before the array interface, when supporting arrays > essentially meant a dependency on numpy. That's not longer true, so it's > quite likely that the pygtk folks would accept a patch -- someone still > would need to write that patch, though! Unless I misunderstand, I thought that functionality was slated for inclusion in Python 3.0 -- still a long ways off in terms of adoption rate. That patch would only make sense on a pygtk branch specifically intended for Python 3.0. Cheers, Mike -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA
Hi, all is in the subject: ##################### ax=3Daxes() setp(ax.get_xticklabels(), rotation=3D30, fontsize=3D14) twinx() #################### It's not really a problem because we can manually modify the xticks, but it= =20 would be great if it was done automatically. Cheers =2D-=20 Lionel Roubeyrie - lro...@li... Charg=C3=A9 d'=C3=A9tudes et de maintenance LIMAIR - la Surveillance de l'Air en Limousin http://www.limair.asso.fr
Carol Leger wrote: > Hi folks, > > I have encountered a problem using colorbar and set_under with a color > map that has only 32 colors. The downward arrow is not filled with the > correct color. If 64 colors are used, the arrow is filled correctly. I > actually want 8 colors. > > The test code is essentially image_masked.py from the 0.90.0 examples. > > if I use: palette = cm.get_cmap("gray", 64) > the plot is OK. > if I use: palette = cm.get_cmap("gray", 32) > it is not OK. > > In both cases, the upper arrow is the correct color. > > I am using matplotlib version 0.90.0. Carol, It works for me even with 8 colors, using the svn version of mpl. There have been a lot of changes between 0.90.0 and the present svn trunk (including a heart transplant by Mike D.), but I would not have expected any changes that would change the behavior you describe. I can't think of any way a bug would have made a break point in behavior between 32 and 64 colors. I'm baffled. Can you install and run the svn version? Or the latest release (which does not include the new heart)? I also tried the svn maintenance branch, which is virtually identical to the last release, and it works the same as the trunk. Eric
On Jan 13, 2008 7:26 PM, Christopher Fonnesbeck <fon...@ma...> wrote: > On some OSX systems, pylab is failing on importing pylab because of > lack of GTK. This appears to be a bug; if the system doesnt have gtk, > it should simply not import that backend to begin with. matplotlib does not do runtime checking to see if a backend is available (arguably it should, but it does not_. It does do compile time checking, and if gtk was available at compile time it will spit out a default matplotlib rc file which uses gtkagg. If you ship this to your users who do not have gtk, it can cause problems (you can tweak this with setup.cfg). You may want to make tkagg the default backend if you are distributing binaries, since it is most likely to work on the user side. JDH