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
(13) |
|
3
(4) |
4
(34) |
5
(14) |
6
(23) |
7
(26) |
8
(12) |
9
(7) |
|
10
(7) |
11
(9) |
12
(12) |
13
(20) |
14
(14) |
15
(13) |
16
(5) |
|
17
(4) |
18
(22) |
19
(29) |
20
(13) |
21
(9) |
22
(22) |
23
(3) |
|
24
(3) |
25
(29) |
26
(9) |
27
(10) |
28
(16) |
29
(16) |
30
(16) |
|
31
(9) |
|
|
|
|
|
|
|
From: Daniele N. <da...@gr...> - 2010-10-03 18:36:46
|
On 18/09/10 02:57, Joey Richards wrote: > When I plot with the MacOSX backend using a serif font, the negative > signs on the axis labels show up as the "missing glyph" open squares > rather than minus signs. Hello, I have the same problem on MacOsX 10.4 and matplotlib 1.0, but also with the default sans-serif font. I would guess that the default fonts available with MacOSX do not have a glyph for the unicode character used by matplotlib, but if you see it with different backends (i do not have compiled them because i was to lazy to install the required libraries) I suspect something is wrong with the macosx backend... Cheers, -- Daniele |
|
From: Benjamin R. <ben...@ou...> - 2010-10-03 16:12:54
|
On Fri, Oct 1, 2010 at 9:47 AM, Tony S Yu <ts...@gm...> wrote: > > On Oct 1, 2010, at 9:40 AM, Benjamin Root wrote: > > On Thu, Sep 30, 2010 at 8:44 PM, Tony S Yu <ts...@gm...> wrote: > >> I'd like to make something in between a box plot [1] and a histogram. Each >> histogram would be represented by a single, tall, rectangular patch (like >> the box in a box plot), and the patch would be subdivided by the bin edges >> of the histogram. The face color of each sub-patch would replace the bar >> height in the histogram. >> >> If any of that actually made sense: >> >> * Does this type of plot have a name? >> >> * Is there an easy way to do this in Matplotlib? >> >> * If there isn't an easy way, what would be a good starting point? Initial >> ideas: 1) Use pcolor or imshow and embed this axes in a larger axes, 2) >> represent the sub-patches as a PolyCollection. >> >> Thoughts? >> -Tony >> >> [1] e.g. >> http://matplotlib.sourceforge.net/examples/pylab_examples/boxplot_demo.html >> > > Tony, > > I am not quite sure I understand. > > > [snip] > > Or maybe something else in the gallery is more like what you want: > > http://matplotlib.sourceforge.net/gallery.html > > Ben Root > > > I've checked the gallery, but I don't see anything that appears similar. In > any case, I ended up hacking together something that works. I've attached an > image of what I had in mind (created with the code at the very bottom of > this reply). > > I ended up using mpl Rectangle objects and stringing them together using a > PatchCollection. Maybe there's a more efficient way to do this, but this > approach worked well-enough. > > Best, > -Tony > Actually, that looks kinda cool. If anyone is aware of the name for this kind of plot, maybe we could add a new plotting function? Ben Root |
|
From: Åke K. <ake...@gm...> - 2010-10-03 10:23:28
|
I just installed matplotlib-1.0.0 on my system (Snow Leopard, python 2.7), but somehow when I try to import pyplot i get the error below. For reference, I installed matplotlib from source. Prior to that I installed libpng-1.4.4 and freetype-2.4.2 the usual way (./configure, make, make install) plus I installed pkgcong as well. After getting the error I tried the tips Friedrich R gave in this thread ( http://old.nabble.com/Symbol-not-found-td28994434.html) too, but I still get the error. >From a few google attempts it seems that it is an issue of dynamic vs static linking. I can't say that I know what that is, but I'd be very interested in knowing whether I can do anything from my side to sort things out. Here is the error: >>> import matplotlib.pyplot as plt Traceback (most recent call last): File "<pyshell#2>", line 1, in <module> import matplotlib.pyplot as plt File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/pyplot.py", line 23, in <module> from matplotlib.figure import Figure, figaspect File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/figure.py", line 18, in <module> from axes import Axes, SubplotBase, subplot_class_factory File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/axes.py", line 14, in <module> import matplotlib.axis as maxis File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/axis.py", line 10, in <module> import matplotlib.font_manager as font_manager File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/font_manager.py", line 52, in <module> from matplotlib import ft2font ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/ft2font.so, 2): Symbol not found: _FT_Attach_File Referenced from: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/ft2font.so Expected in: dynamic lookup |
|
From: Daπid <dav...@gm...> - 2010-10-02 22:50:18
|
On Sat, Oct 2, 2010 at 7:39 PM, Jouni K. Seppänen <jk...@ik...> wrote: >> And yet, we still allow for saving to jpegs. > > Wow, I didn't know. Last time I tried that I got a traceback, and > assumed that it was not supported exactly because jpeg is a nonsensical > format for most graphs. Don't forget MPL is also capable of dealing with photographs, and it is really useful. I am currently working in two scientific projects based on this capability, and for some issues could be useful to save JPGs. |
|
From: Gaius H. <Ga...@Ga...> - 2010-10-02 18:41:07
|
It's really not clear to me why we would want to lower the quality of our graphs to save Google's bandwidth bills. Because that's all this is... Cheers, G ------------------ -----Original Message----- From: "Nils Wagner" <nw...@ia...> Date: Sat, 02 Oct 2010 12:59:12 To: <mat...@li...> Subject: [Matplotlib-users] WebP support Hi all, just curious - is the WebP format supported by matplotlib ? Nils http://code.google.com/intl/de-DE/speed/webp/ ------------------------------------------------------------------------------ Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing. http://p.sf.net/sfu/novell-sfdev2dev _______________________________________________ Matplotlib-users mailing list Mat...@li... https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
|
From: Benjamin R. <ben...@ou...> - 2010-10-02 18:01:36
|
On Sat, Oct 2, 2010 at 12:39 PM, Jouni K. Seppänen <jk...@ik...> wrote: > Benjamin Root <ben...@ou...> writes: > > > And yet, we still allow for saving to jpegs. > > Wow, I didn't know. Last time I tried that I got a traceback, and > assumed that it was not supported exactly because jpeg is a nonsensical > format for most graphs. > > I just tried again, and got "TypeError: 'int' object is unsubscriptable" > from PIL/JpegImagePlugin.pyc in _save(im, fp, filename). I suppose this > doesn't get much testing. > > Yeah, I just double-checked which backend I was using and it turned out to be GTKAgg (I forgot that I changed it at one point for a test). In TkAgg, I get the same error message you report. > > Also, matplotlib is also able to do imshow(), pcolor() and other > > rasterized drawings, so we aren't restricted to just line drawings. > > Yes, I guess there are some circumstances in which this would make > sense. Would supporting WebP require new library dependencies? > > -- > Jouni K. Seppänen > http://www.iki.fi/jks > > I am certainly not an expert, but it would appear that we offload a lot of the file-format stuff to PIL anyway. So, if PIL ever supports WebP, then I would imagine (although I could be wrong) that it would be fairly trivial to add support to WebP at least to whereever we support JPEG. Ben Root |
|
From: Ed L. <la...@fu...> - 2010-10-02 17:55:35
|
All, I am wondering if anyone knows of a working example that yields a postscript figure editable in Adobe Illustrator; that is, the characters are editable as characters. I have only been able to get drawn fonts and would love to have a test case that is known to work. My environment is: > python Python 2.6.6 (r266:84292, Sep 11 2010, 15:25:14) [GCC 4.2.1 (Apple Inc. build 5659)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import matplotlib >>> matplotlib.__version__ '1.0.0' >>> matplotlib.__file__ '/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/__init__.pyc' >>> my rc file is: backend : TkAgg # the default backend interactive : True ps.usedistiller : xpdf I can produce postscript fonts outside python, say in IDL. I can produce postscript fonts in python using the psg package, but not matplotlib. In all the examples at http://matplotlib.sourceforge.net/ I did not find anything that explicitly addresses this issue. Thanks to anyone who answers with a test case. |
|
From: Jouni K. S. <jk...@ik...> - 2010-10-02 17:39:38
|
Benjamin Root <ben...@ou...> writes: > And yet, we still allow for saving to jpegs. Wow, I didn't know. Last time I tried that I got a traceback, and assumed that it was not supported exactly because jpeg is a nonsensical format for most graphs. I just tried again, and got "TypeError: 'int' object is unsubscriptable" from PIL/JpegImagePlugin.pyc in _save(im, fp, filename). I suppose this doesn't get much testing. > Also, matplotlib is also able to do imshow(), pcolor() and other > rasterized drawings, so we aren't restricted to just line drawings. Yes, I guess there are some circumstances in which this would make sense. Would supporting WebP require new library dependencies? -- Jouni K. Seppänen http://www.iki.fi/jks |
|
From: Benjamin R. <ben...@ou...> - 2010-10-02 17:19:08
|
On Sat, Oct 2, 2010 at 11:54 AM, Darren Dale <dsd...@gm...> wrote: > On Sat, Oct 2, 2010 at 11:58 AM, Benjamin Root <ben...@ou...> wrote: > > On Sat, Oct 2, 2010 at 7:28 AM, Jouni K. Seppänen <jk...@ik...> wrote: > >> > >> "Nils Wagner" <nw...@ia...> writes: > >> > >> > just curious - is the WebP format supported by matplotlib > >> > >> No. It seems to be a method for lossy compression of photographs and > >> therefore not likely to be useful for line drawings - or what did you > >> have in mind? > > > > And yet, we still allow for saving to jpegs. > > Only some of the non-agg backends support saving to jpegs. Whenever > someone posts to the list asking why jpegs are not supported, the > answer is that, aside from not being supported by agg, lossy formats > like jpeg are a poor choice for saving line art. > > Heh, I never noticed that. On this computer, I use TkAgg, and it worked just fine. Admittedly, I haven't tried this out much because I usually use png or one of the vector-based formats. Ben Root |
|
From: Darren D. <dsd...@gm...> - 2010-10-02 16:54:54
|
On Sat, Oct 2, 2010 at 11:58 AM, Benjamin Root <ben...@ou...> wrote: > On Sat, Oct 2, 2010 at 7:28 AM, Jouni K. Seppänen <jk...@ik...> wrote: >> >> "Nils Wagner" <nw...@ia...> writes: >> >> > just curious - is the WebP format supported by matplotlib >> >> No. It seems to be a method for lossy compression of photographs and >> therefore not likely to be useful for line drawings - or what did you >> have in mind? > > And yet, we still allow for saving to jpegs. Only some of the non-agg backends support saving to jpegs. Whenever someone posts to the list asking why jpegs are not supported, the answer is that, aside from not being supported by agg, lossy formats like jpeg are a poor choice for saving line art. Darren |
|
From: Benjamin R. <ben...@ou...> - 2010-10-02 16:03:38
|
On Sat, Oct 2, 2010 at 10:37 AM, Nicolas Bigaouette <nbi...@gm...>wrote: > On Fri, Oct 1, 2010 at 5:38 PM, Stan West <sta...@nr...> wrote: > >> *From:* Nicolas Bigaouette [mailto:nbi...@gm...] >> *Sent:* Thursday, September 30, 2010 18:00 >> >> What I would like to do it have a colormap which is transparent for lower >> values of data and opaque for high values, so the blue on the figure would >> appear white/transparent. >> >> Would it suffice for the colormap to be light or white for low values but >> still opaque? There are several built-in maps [1] with a light color at one >> end; if it's light at the high end, append "_r" to the colormap name to get >> the reversed version. >> >> [1] >> http://matplotlib.sourceforge.net/examples/pylab_examples/show_colormaps.html >> > I guess it's the best solution for now. Thanks ;) > > > Nicolas, It would be extremely useful if you could file a feature request for this at our tracker: http://sourceforge.net/tracker/?atid=560723&group_id=80706&func=browse This way, your suggestion won't get lost. Ben Root |
|
From: Benjamin R. <ben...@ou...> - 2010-10-02 15:58:35
|
On Sat, Oct 2, 2010 at 7:28 AM, Jouni K. Seppänen <jk...@ik...> wrote: > "Nils Wagner" <nw...@ia...> writes: > > > just curious - is the WebP format supported by matplotlib > > No. It seems to be a method for lossy compression of photographs and > therefore not likely to be useful for line drawings - or what did you > have in mind? > > -- > Jouni K. Seppänen > http://www.iki.fi/jks > > > And yet, we still allow for saving to jpegs. Also, matplotlib is also able to do imshow(), pcolor() and other rasterized drawings, so we aren't restricted to just line drawings. Nils, the answer is "no, we don't support webp -- yet". There is no reason why we can't eventually do so, and patches will always be welcomed. I just wouldn't expect it anytime soon. Ben Root |
|
From: Nicolas B. <nbi...@gm...> - 2010-10-02 15:37:13
|
On Fri, Oct 1, 2010 at 5:38 PM, Stan West <sta...@nr...> wrote: > *From:* Nicolas Bigaouette [mailto:nbi...@gm...] > *Sent:* Thursday, September 30, 2010 18:00 > > What I would like to do it have a colormap which is transparent for lower > values of data and opaque for high values, so the blue on the figure would > appear white/transparent. > > Would it suffice for the colormap to be light or white for low values but > still opaque? There are several built-in maps [1] with a light color at one > end; if it's light at the high end, append "_r" to the colormap name to get > the reversed version. > > [1] > http://matplotlib.sourceforge.net/examples/pylab_examples/show_colormaps.html > I guess it's the best solution for now. Thanks ;) |
|
From: Jouni K. S. <jk...@ik...> - 2010-10-02 12:29:21
|
"Nils Wagner" <nw...@ia...> writes: > just curious - is the WebP format supported by matplotlib No. It seems to be a method for lossy compression of photographs and therefore not likely to be useful for line drawings - or what did you have in mind? -- Jouni K. Seppänen http://www.iki.fi/jks |
|
From: Nils W. <nw...@ia...> - 2010-10-02 10:59:24
|
Hi all, just curious - is the WebP format supported by matplotlib ? Nils http://code.google.com/intl/de-DE/speed/webp/ |
|
From: Wes M. <wes...@gm...> - 2010-10-02 05:15:27
|
I'm getting the error:
can't invoke "event" command: application has been destroyed
while executing
"event generate $w <<ThemeChanged>>"
(procedure "ttk::ThemeChanged" line 6)
invoked from within
"ttk::ThemeChanged"
With the latest matplotlib 1.0.0 on 64-bit Ubuntu 10.04 running the
following script within IPython 0.10 in pylab mode:
import matplotlib.pyplot as plt
import numpy as np
def test():
plt.figure(figsize=(10,5))
plt.plot(np.arange(1, 51), np.arange(1, 51), color='k')
def make_figs():
test()
plt.savefig('foo.pdf')
plt.close('all')
if __name__ == '__main__':
make_figs()
Here's the build information:
wesm@wesm-desktop:~/code/repos/matplotlib$ sudo python setupegg.py develop
basedirlist is: ['/usr/local', '/usr']
============================================================================
BUILDING MATPLOTLIB
matplotlib: 1.0.0
python: 2.6.5 |EPD 6.2-2 (64-bit)| (r265:79063, Mar 22 2010,
17:32:05) [GCC 4.1.2 20080704 (Red Hat 4.1.2-44)]
platform: linux2
REQUIRED DEPENDENCIES
numpy: 1.4.0
freetype2: 9.22.3
OPTIONAL BACKEND DEPENDENCIES
libpng: 1.2.42
Tkinter: Tkinter: 73770, Tk: 8.5, Tcl: 8.5
* Guessing the library and include directories for
* Tcl and Tk because the tclConfig.sh and
* tkConfig.sh could not be found and/or parsed.
Gtk+: no
* Building for Gtk+ requires pygtk; you must be able
* to "import gtk" in your build/install environment
Mac OS X native: no
Qt: no
Qt4: no
Cairo: no
OPTIONAL DATE/TIMEZONE DEPENDENCIES
datetime: present, version unknown
dateutil: 1.5
pytz: 2010h
OPTIONAL USETEX DEPENDENCIES
dvipng: 1.12
ghostscript: 8.71
latex: 3.1415926
pdftops: 0.12.4
[Edit setup.cfg to suppress the above messages]
I checked that EPD 6.2.2 was built with tk8.5/tcl8.5 in case that was
causing a problem, does not seem to be.
I can switch to the WXAgg backend for now, but would help to know if
I'm doing something wrong by chance.
Note: I do not get this message running the script standalone outside
of IPython!
Thanks,
Wes
|
|
From: Stan W. <sta...@nr...> - 2010-10-01 21:40:33
|
From: Nicolas Bigaouette [mailto:nbi...@gm...] Sent: Thursday, September 30, 2010 18:00 What I would like to do it have a colormap which is transparent for lower values of data and opaque for high values, so the blue on the figure would appear white/transparent. Would it suffice for the colormap to be light or white for low values but still opaque? There are several built-in maps [1] with a light color at one end; if it's light at the high end, append "_r" to the colormap name to get the reversed version. [1] http://matplotlib.sourceforge.net/examples/pylab_examples/show_colormaps.html |
|
From: Gökhan S. <gok...@gm...> - 2010-10-01 18:09:12
|
I temporarily fixed this by commenting the following lines in
pkg_resources.py folder in /site-packages/distribute.. folder.
issue_warning(
"Module %s was already imported from %s, but %s is being added"
" to sys.path" % (modname, fn, self.location),
)
Now, I don't get any dateutil imported messages each time I launch an
IPython session.
On Wed, Sep 8, 2010 at 1:26 PM, Gökhan Sever <gok...@gm...> wrote:
> It is clear with python -c "import matplotlib"
> I can't seem to find any "dateutil" phrase occurring within the IPython
> installation folder (/site-packages/IPython)
> Where else to look for?
>
> On Wed, Sep 8, 2010 at 12:35 PM, Aman Thakral <ama...@gm...>
> wrote:
>>
>> try this in the terminal:
>> python -c "import matplotlib"
>>
>> -Aman
>>
>> On Wed, Sep 8, 2010 at 12:17 PM, Gökhan Sever <gok...@gm...>
>> wrote:
>>>
>>> Hello,
>>> My usual ipython -pylab is giving me these warnings after I installed
>>> matplotlib from the source (matplotlib rev.8624 using python setupegg.py
>>> develop).
>>>
>>> /usr/lib/python2.6/site-packages/EPDLab-3.0.1.dev_r24658-py2.6.egg/enthought/__init__.py:7:
>>> UserWarning: Module dateutil was already imported from
>>> /home/user/Desktop/python-repo/matplotlib/lib/dateutil/__init__.pyc, but
>>> /usr/lib/python2.6/site-packages is being added to sys.path
>>> __import__('pkg_resources').declare_namespace(__name__)
>>>
>>> Under /site-packages in easy-install.pth I moved
>>> the /home/user/Desktop/python-repo/matplotlib/lib line to the very bottom of
>>> the file but this doesn't make any change.
>>> Any ideas how to remove this warning?
>>> --
>>> Gökhan
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> This SF.net Dev2Dev email is sponsored by:
>>>
>>> Show off your parallel programming skills.
>>> Enter the Intel(R) Threading Challenge 2010.
>>> http://p.sf.net/sfu/intel-thread-sfd
>>> _______________________________________________
>>> Matplotlib-users mailing list
>>> Mat...@li...
>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>>
>>
>>
>>
>> --
>> Aman Thakral
>> B.Eng & Biosci, M.Eng Design
>
>
>
> --
> Gökhan
>
--
Gökhan
|
|
From: Michael D. <md...@st...> - 2010-10-01 15:54:30
|
On 10/01/2010 11:46 AM, Jason Grout wrote: > On 10/01/2010 10:40 AM, Michael Droettboom wrote: >> On 10/01/2010 11:31 AM, Jason Grout wrote: >>> I'm working on updating matplotlib in Sage to 1.0. We're running into >>> a problem where it seems that the fontList.cache is not being updated. >>> I've included an example session below. The .matplotlib directory is >>> accessible here: >>> http://sage.math.washington.edu/home/jason/.matplotlib/ The problem >>> seems to be that it is looking for a file that does not exist: >>> >>> [jason@sage:/scratch/jason/sage-4.6.alpha2]$ ls >>> /scratch/grout/sage-4.5.3/local/lib/python2.6/site-packages/matplotlib/mpl-data/fonts/ttf/Vera.ttf >>> ls: cannot access >>> /scratch/grout/sage-4.5.3/local/lib/python2.6/site-packages/matplotlib/mpl-data/fonts/ttf/Vera.ttf: >>> No such file or directory >>> >>> >>> Does anyone have any idea what is going on? Why is the fontList.cache >>> file not being updated, instead of trying to access a path that doesn't >>> exist? >> There is a fix in SVN for this, but it has not yet been released. When >> a font file is not found, it rebuilds the entire font cache on the spot. > Thanks. Do you know the commit? We'll apply it to the Sage matplotlib > package. > > It's r8712. >>> A related question is: I see the variable USE_FONTCONFIG in >>> font_manager.py. It says it is experimental. How stable is that code? >>> It's tempting to switch to using fontconfig. >> I use it as a matter of course on my Linux box and haven't had any >> issues. It's experimental because it's the kind of thing that is so >> affected by external environmental issues and distro differences. Just >> because it "works for me", there's no guarantee it will work >> everywhere. But go ahead and give it a try and report back with the >> distro you're using. >> > Well, with Sage, we're using it on a number of distros, flavors of OSX, > Solaris, etc. So maybe I'll stick with the home-grown caching > solution. At least until we've tested it a bit on different support > platforms for Sage. > > I thought there was some sort of build bot for matplotlib that tested on > a number of platforms. Do you know how the fontconfig stuff does on > that (if it exists...). I don't think the buildbots are turning on fontconfig support. And I believe all of the buildbots are some flavour of Ubuntu (the OS-X buildbot is not running), so there's not a lot of coverage. Mike > Thanks, > > Jason > > > ------------------------------------------------------------------------------ > Start uncovering the many advantages of virtual appliances > and start using them to simplify application deployment and > accelerate your shift to cloud computing. > http://p.sf.net/sfu/novell-sfdev2dev > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
|
From: Jason G. <jas...@cr...> - 2010-10-01 15:46:50
|
On 10/01/2010 10:40 AM, Michael Droettboom wrote: > On 10/01/2010 11:31 AM, Jason Grout wrote: >> I'm working on updating matplotlib in Sage to 1.0. We're running into >> a problem where it seems that the fontList.cache is not being updated. >> I've included an example session below. The .matplotlib directory is >> accessible here: >> http://sage.math.washington.edu/home/jason/.matplotlib/ The problem >> seems to be that it is looking for a file that does not exist: >> >> [jason@sage:/scratch/jason/sage-4.6.alpha2]$ ls >> /scratch/grout/sage-4.5.3/local/lib/python2.6/site-packages/matplotlib/mpl-data/fonts/ttf/Vera.ttf >> ls: cannot access >> /scratch/grout/sage-4.5.3/local/lib/python2.6/site-packages/matplotlib/mpl-data/fonts/ttf/Vera.ttf: >> No such file or directory >> >> >> Does anyone have any idea what is going on? Why is the fontList.cache >> file not being updated, instead of trying to access a path that doesn't >> exist? > There is a fix in SVN for this, but it has not yet been released. When > a font file is not found, it rebuilds the entire font cache on the spot. Thanks. Do you know the commit? We'll apply it to the Sage matplotlib package. >> A related question is: I see the variable USE_FONTCONFIG in >> font_manager.py. It says it is experimental. How stable is that code? >> It's tempting to switch to using fontconfig. > I use it as a matter of course on my Linux box and haven't had any > issues. It's experimental because it's the kind of thing that is so > affected by external environmental issues and distro differences. Just > because it "works for me", there's no guarantee it will work > everywhere. But go ahead and give it a try and report back with the > distro you're using. > Well, with Sage, we're using it on a number of distros, flavors of OSX, Solaris, etc. So maybe I'll stick with the home-grown caching solution. At least until we've tested it a bit on different support platforms for Sage. I thought there was some sort of build bot for matplotlib that tested on a number of platforms. Do you know how the fontconfig stuff does on that (if it exists...). Thanks, Jason |
|
From: Michael D. <md...@st...> - 2010-10-01 15:40:55
|
On 10/01/2010 11:31 AM, Jason Grout wrote: > I'm working on updating matplotlib in Sage to 1.0. We're running into > a problem where it seems that the fontList.cache is not being updated. > I've included an example session below. The .matplotlib directory is > accessible here: > http://sage.math.washington.edu/home/jason/.matplotlib/ The problem > seems to be that it is looking for a file that does not exist: > > [jason@sage:/scratch/jason/sage-4.6.alpha2]$ ls > /scratch/grout/sage-4.5.3/local/lib/python2.6/site-packages/matplotlib/mpl-data/fonts/ttf/Vera.ttf > ls: cannot access > /scratch/grout/sage-4.5.3/local/lib/python2.6/site-packages/matplotlib/mpl-data/fonts/ttf/Vera.ttf: > No such file or directory > > > Does anyone have any idea what is going on? Why is the fontList.cache > file not being updated, instead of trying to access a path that doesn't > exist? There is a fix in SVN for this, but it has not yet been released. When a font file is not found, it rebuilds the entire font cache on the spot. > A related question is: I see the variable USE_FONTCONFIG in > font_manager.py. It says it is experimental. How stable is that code? > It's tempting to switch to using fontconfig. I use it as a matter of course on my Linux box and haven't had any issues. It's experimental because it's the kind of thing that is so affected by external environmental issues and distro differences. Just because it "works for me", there's no guarantee it will work everywhere. But go ahead and give it a try and report back with the distro you're using. Mike > Thanks, > > Jason > > > Here is my example session: > > In [1]: from pylab import * > > In [2]: text(0.5, 0.5, 'text 0') > Out[2]:<matplotlib.text.Text object at 0x18e7b50> > > In [3]: savefig('test.png') > ERROR: An unexpected error occurred while tokenizing input > The following traceback may be corrupted or invalid > The error message is: ('EOF in multi-line statement', (532, 0)) > > ERROR: An unexpected error occurred while tokenizing input > The following traceback may be corrupted or invalid > The error message is: ('EOF in multi-line statement', (643, 0)) > > ERROR: An unexpected error occurred while tokenizing input > The following traceback may be corrupted or invalid > The error message is: ('EOF in multi-line statement', (10, 0)) > > --------------------------------------------------------------------------- > RuntimeError Traceback (most recent call last) > > /mnt/usb1/scratch/jason/sage-4.6.alpha2/<ipython console> in<module>() > > /mnt/usb1/scratch/jason/sage-4.6.alpha2/local/lib/python2.6/site-packages/matplotlib/pyplot.pyc > in savefig(*args, **kwargs) > 361 def savefig(*args, **kwargs): > 362 fig = gcf() > --> 363 return fig.savefig(*args, **kwargs) > 364 > 365 @docstring.copy_dedent(Figure.ginput) > > /mnt/usb1/scratch/jason/sage-4.6.alpha2/local/lib/python2.6/site-packages/matplotlib/figure.pyc > in savefig(self, *args, **kwargs) > 1082 kwargs.setdefault('edgecolor', > rcParams['savefig.edgecolor']) > 1083 > -> 1084 self.canvas.print_figure(*args, **kwargs) > 1085 > 1086 if transparent: > > /mnt/usb1/scratch/jason/sage-4.6.alpha2/local/lib/python2.6/site-packages/matplotlib/backend_bases.pyc > in print_figure(self, filename, dpi, facecolor, edgecolor, orientation, > format, **kwargs) > 1884 orientation=orientation, > 1885 bbox_inches_restore=_bbox_inches_restore, > -> 1886 **kwargs) > 1887 finally: > 1888 if bbox_inches and restore_bbox: > > /mnt/usb1/scratch/jason/sage-4.6.alpha2/local/lib/python2.6/site-packages/matplotlib/backends/backend_agg.pyc > in print_png(self, filename_or_obj, *args, **kwargs) > 436 > 437 def print_png(self, filename_or_obj, *args, **kwargs): > --> 438 FigureCanvasAgg.draw(self) > 439 renderer = self.get_renderer() > 440 original_dpi = renderer.dpi > > /mnt/usb1/scratch/jason/sage-4.6.alpha2/local/lib/python2.6/site-packages/matplotlib/backends/backend_agg.pyc > in draw(self) > 392 > 393 self.renderer = self.get_renderer() > --> 394 self.figure.draw(self.renderer) > 395 > 396 def get_renderer(self): > > /mnt/usb1/scratch/jason/sage-4.6.alpha2/local/lib/python2.6/site-packages/matplotlib/artist.pyc > in draw_wrapper(artist, renderer, *args, **kwargs) > 53 def draw_wrapper(artist, renderer, *args, **kwargs): > 54 before(artist, renderer) > ---> 55 draw(artist, renderer, *args, **kwargs) > 56 after(artist, renderer) > 57 > > /mnt/usb1/scratch/jason/sage-4.6.alpha2/local/lib/python2.6/site-packages/matplotlib/figure.pyc > in draw(self, renderer) > 796 dsu.sort(key=itemgetter(0)) > 797 for zorder, func, args in dsu: > --> 798 func(*args) > 799 > 800 renderer.close_group('figure') > > /mnt/usb1/scratch/jason/sage-4.6.alpha2/local/lib/python2.6/site-packages/matplotlib/artist.pyc > in draw_wrapper(artist, renderer, *args, **kwargs) > 53 def draw_wrapper(artist, renderer, *args, **kwargs): > 54 before(artist, renderer) > ---> 55 draw(artist, renderer, *args, **kwargs) > 56 after(artist, renderer) > 57 > > /mnt/usb1/scratch/jason/sage-4.6.alpha2/local/lib/python2.6/site-packages/matplotlib/axes.pyc > in draw(self, renderer, inframe) > 1932 > 1933 for zorder, a in dsu: > -> 1934 a.draw(renderer) > 1935 > 1936 renderer.close_group('axes') > > /mnt/usb1/scratch/jason/sage-4.6.alpha2/local/lib/python2.6/site-packages/matplotlib/artist.pyc > in draw_wrapper(artist, renderer, *args, **kwargs) > 53 def draw_wrapper(artist, renderer, *args, **kwargs): > 54 before(artist, renderer) > ---> 55 draw(artist, renderer, *args, **kwargs) > 56 after(artist, renderer) > 57 > > /mnt/usb1/scratch/jason/sage-4.6.alpha2/local/lib/python2.6/site-packages/matplotlib/axis.pyc > in draw(self, renderer, *args, **kwargs) > 1015 tick.set_label1(label) > 1016 tick.set_label2(label) > -> 1017 tick.draw(renderer) > 1018 if tick.label1On and tick.label1.get_visible(): > 1019 extent = tick.label1.get_window_extent(renderer) > > /mnt/usb1/scratch/jason/sage-4.6.alpha2/local/lib/python2.6/site-packages/matplotlib/artist.pyc > in draw_wrapper(artist, renderer, *args, **kwargs) > 53 def draw_wrapper(artist, renderer, *args, **kwargs): > 54 before(artist, renderer) > ---> 55 draw(artist, renderer, *args, **kwargs) > 56 after(artist, renderer) > 57 > > /mnt/usb1/scratch/jason/sage-4.6.alpha2/local/lib/python2.6/site-packages/matplotlib/axis.pyc > in draw(self, renderer) > 232 > 233 if self.label1On: > --> 234 self.label1.draw(renderer) > 235 if self.label2On: > 236 self.label2.draw(renderer) > > /mnt/usb1/scratch/jason/sage-4.6.alpha2/local/lib/python2.6/site-packages/matplotlib/artist.pyc > in draw_wrapper(artist, renderer, *args, **kwargs) > 53 def draw_wrapper(artist, renderer, *args, **kwargs): > 54 before(artist, renderer) > ---> 55 draw(artist, renderer, *args, **kwargs) > 56 after(artist, renderer) > 57 > > /mnt/usb1/scratch/jason/sage-4.6.alpha2/local/lib/python2.6/site-packages/matplotlib/text.pyc > in draw(self, renderer) > 522 renderer.open_group('text', self.get_gid()) > 523 > --> 524 bbox, info = self._get_layout(renderer) > 525 trans = self.get_transform() > 526 > > /mnt/usb1/scratch/jason/sage-4.6.alpha2/local/lib/python2.6/site-packages/matplotlib/text.pyc > in _get_layout(self, renderer) > 296 tmp, lp_h, lp_bl = get_text_width_height_descent('lp', > 297 > self._fontproperties, > --> 298 > ismath=False) > 299 offsety = lp_h * self._linespacing > 300 > > /mnt/usb1/scratch/jason/sage-4.6.alpha2/local/lib/python2.6/site-packages/matplotlib/backends/backend_agg.pyc > in get_text_width_height_descent(self, s, prop, ismath) > 178 > 179 flags = self._get_hinting_flag() > --> 180 font = self._get_agg_font(prop) > 181 font.set_text(s, 0.0, flags=flags) # the width and > height of unrotated string > 182 w, h = font.get_width_height() > > /mnt/usb1/scratch/jason/sage-4.6.alpha2/local/lib/python2.6/site-packages/matplotlib/backends/backend_agg.pyc > in _get_agg_font(self, prop) > 219 font = self._fontd.get(fname) > 220 if font is None: > --> 221 font = FT2Font(str(fname)) > 222 self._fontd[fname] = font > 223 self._fontd[key] = font > > RuntimeError: Could not open facefile > /scratch/grout/sage-4.5.3/local/lib/python2.6/site-packages/matplotlib/mpl-data/fonts/ttf/Vera.ttf; > Cannot_Open_Resource > > > > ------------------------------------------------------------------------------ > Start uncovering the many advantages of virtual appliances > and start using them to simplify application deployment and > accelerate your shift to cloud computing. > http://p.sf.net/sfu/novell-sfdev2dev > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
|
From: Jason G. <jas...@cr...> - 2010-10-01 15:31:24
|
I'm working on updating matplotlib in Sage to 1.0. We're running into a problem where it seems that the fontList.cache is not being updated. I've included an example session below. The .matplotlib directory is accessible here: http://sage.math.washington.edu/home/jason/.matplotlib/ The problem seems to be that it is looking for a file that does not exist: [jason@sage:/scratch/jason/sage-4.6.alpha2]$ ls /scratch/grout/sage-4.5.3/local/lib/python2.6/site-packages/matplotlib/mpl-data/fonts/ttf/Vera.ttf ls: cannot access /scratch/grout/sage-4.5.3/local/lib/python2.6/site-packages/matplotlib/mpl-data/fonts/ttf/Vera.ttf: No such file or directory Does anyone have any idea what is going on? Why is the fontList.cache file not being updated, instead of trying to access a path that doesn't exist? A related question is: I see the variable USE_FONTCONFIG in font_manager.py. It says it is experimental. How stable is that code? It's tempting to switch to using fontconfig. Thanks, Jason Here is my example session: In [1]: from pylab import * In [2]: text(0.5, 0.5, 'text 0') Out[2]: <matplotlib.text.Text object at 0x18e7b50> In [3]: savefig('test.png') ERROR: An unexpected error occurred while tokenizing input The following traceback may be corrupted or invalid The error message is: ('EOF in multi-line statement', (532, 0)) ERROR: An unexpected error occurred while tokenizing input The following traceback may be corrupted or invalid The error message is: ('EOF in multi-line statement', (643, 0)) ERROR: An unexpected error occurred while tokenizing input The following traceback may be corrupted or invalid The error message is: ('EOF in multi-line statement', (10, 0)) --------------------------------------------------------------------------- RuntimeError Traceback (most recent call last) /mnt/usb1/scratch/jason/sage-4.6.alpha2/<ipython console> in <module>() /mnt/usb1/scratch/jason/sage-4.6.alpha2/local/lib/python2.6/site-packages/matplotlib/pyplot.pyc in savefig(*args, **kwargs) 361 def savefig(*args, **kwargs): 362 fig = gcf() --> 363 return fig.savefig(*args, **kwargs) 364 365 @docstring.copy_dedent(Figure.ginput) /mnt/usb1/scratch/jason/sage-4.6.alpha2/local/lib/python2.6/site-packages/matplotlib/figure.pyc in savefig(self, *args, **kwargs) 1082 kwargs.setdefault('edgecolor', rcParams['savefig.edgecolor']) 1083 -> 1084 self.canvas.print_figure(*args, **kwargs) 1085 1086 if transparent: /mnt/usb1/scratch/jason/sage-4.6.alpha2/local/lib/python2.6/site-packages/matplotlib/backend_bases.pyc in print_figure(self, filename, dpi, facecolor, edgecolor, orientation, format, **kwargs) 1884 orientation=orientation, 1885 bbox_inches_restore=_bbox_inches_restore, -> 1886 **kwargs) 1887 finally: 1888 if bbox_inches and restore_bbox: /mnt/usb1/scratch/jason/sage-4.6.alpha2/local/lib/python2.6/site-packages/matplotlib/backends/backend_agg.pyc in print_png(self, filename_or_obj, *args, **kwargs) 436 437 def print_png(self, filename_or_obj, *args, **kwargs): --> 438 FigureCanvasAgg.draw(self) 439 renderer = self.get_renderer() 440 original_dpi = renderer.dpi /mnt/usb1/scratch/jason/sage-4.6.alpha2/local/lib/python2.6/site-packages/matplotlib/backends/backend_agg.pyc in draw(self) 392 393 self.renderer = self.get_renderer() --> 394 self.figure.draw(self.renderer) 395 396 def get_renderer(self): /mnt/usb1/scratch/jason/sage-4.6.alpha2/local/lib/python2.6/site-packages/matplotlib/artist.pyc in draw_wrapper(artist, renderer, *args, **kwargs) 53 def draw_wrapper(artist, renderer, *args, **kwargs): 54 before(artist, renderer) ---> 55 draw(artist, renderer, *args, **kwargs) 56 after(artist, renderer) 57 /mnt/usb1/scratch/jason/sage-4.6.alpha2/local/lib/python2.6/site-packages/matplotlib/figure.pyc in draw(self, renderer) 796 dsu.sort(key=itemgetter(0)) 797 for zorder, func, args in dsu: --> 798 func(*args) 799 800 renderer.close_group('figure') /mnt/usb1/scratch/jason/sage-4.6.alpha2/local/lib/python2.6/site-packages/matplotlib/artist.pyc in draw_wrapper(artist, renderer, *args, **kwargs) 53 def draw_wrapper(artist, renderer, *args, **kwargs): 54 before(artist, renderer) ---> 55 draw(artist, renderer, *args, **kwargs) 56 after(artist, renderer) 57 /mnt/usb1/scratch/jason/sage-4.6.alpha2/local/lib/python2.6/site-packages/matplotlib/axes.pyc in draw(self, renderer, inframe) 1932 1933 for zorder, a in dsu: -> 1934 a.draw(renderer) 1935 1936 renderer.close_group('axes') /mnt/usb1/scratch/jason/sage-4.6.alpha2/local/lib/python2.6/site-packages/matplotlib/artist.pyc in draw_wrapper(artist, renderer, *args, **kwargs) 53 def draw_wrapper(artist, renderer, *args, **kwargs): 54 before(artist, renderer) ---> 55 draw(artist, renderer, *args, **kwargs) 56 after(artist, renderer) 57 /mnt/usb1/scratch/jason/sage-4.6.alpha2/local/lib/python2.6/site-packages/matplotlib/axis.pyc in draw(self, renderer, *args, **kwargs) 1015 tick.set_label1(label) 1016 tick.set_label2(label) -> 1017 tick.draw(renderer) 1018 if tick.label1On and tick.label1.get_visible(): 1019 extent = tick.label1.get_window_extent(renderer) /mnt/usb1/scratch/jason/sage-4.6.alpha2/local/lib/python2.6/site-packages/matplotlib/artist.pyc in draw_wrapper(artist, renderer, *args, **kwargs) 53 def draw_wrapper(artist, renderer, *args, **kwargs): 54 before(artist, renderer) ---> 55 draw(artist, renderer, *args, **kwargs) 56 after(artist, renderer) 57 /mnt/usb1/scratch/jason/sage-4.6.alpha2/local/lib/python2.6/site-packages/matplotlib/axis.pyc in draw(self, renderer) 232 233 if self.label1On: --> 234 self.label1.draw(renderer) 235 if self.label2On: 236 self.label2.draw(renderer) /mnt/usb1/scratch/jason/sage-4.6.alpha2/local/lib/python2.6/site-packages/matplotlib/artist.pyc in draw_wrapper(artist, renderer, *args, **kwargs) 53 def draw_wrapper(artist, renderer, *args, **kwargs): 54 before(artist, renderer) ---> 55 draw(artist, renderer, *args, **kwargs) 56 after(artist, renderer) 57 /mnt/usb1/scratch/jason/sage-4.6.alpha2/local/lib/python2.6/site-packages/matplotlib/text.pyc in draw(self, renderer) 522 renderer.open_group('text', self.get_gid()) 523 --> 524 bbox, info = self._get_layout(renderer) 525 trans = self.get_transform() 526 /mnt/usb1/scratch/jason/sage-4.6.alpha2/local/lib/python2.6/site-packages/matplotlib/text.pyc in _get_layout(self, renderer) 296 tmp, lp_h, lp_bl = get_text_width_height_descent('lp', 297 self._fontproperties, --> 298 ismath=False) 299 offsety = lp_h * self._linespacing 300 /mnt/usb1/scratch/jason/sage-4.6.alpha2/local/lib/python2.6/site-packages/matplotlib/backends/backend_agg.pyc in get_text_width_height_descent(self, s, prop, ismath) 178 179 flags = self._get_hinting_flag() --> 180 font = self._get_agg_font(prop) 181 font.set_text(s, 0.0, flags=flags) # the width and height of unrotated string 182 w, h = font.get_width_height() /mnt/usb1/scratch/jason/sage-4.6.alpha2/local/lib/python2.6/site-packages/matplotlib/backends/backend_agg.pyc in _get_agg_font(self, prop) 219 font = self._fontd.get(fname) 220 if font is None: --> 221 font = FT2Font(str(fname)) 222 self._fontd[fname] = font 223 self._fontd[key] = font RuntimeError: Could not open facefile /scratch/grout/sage-4.5.3/local/lib/python2.6/site-packages/matplotlib/mpl-data/fonts/ttf/Vera.ttf; Cannot_Open_Resource |
|
From: Tony S Yu <ts...@gm...> - 2010-10-01 14:47:53
|
On Oct 1, 2010, at 9:40 AM, Benjamin Root wrote: > On Thu, Sep 30, 2010 at 8:44 PM, Tony S Yu <ts...@gm...> wrote: > I'd like to make something in between a box plot [1] and a histogram. Each histogram would be represented by a single, tall, rectangular patch (like the box in a box plot), and the patch would be subdivided by the bin edges of the histogram. The face color of each sub-patch would replace the bar height in the histogram. > > If any of that actually made sense: > > * Does this type of plot have a name? > > * Is there an easy way to do this in Matplotlib? > > * If there isn't an easy way, what would be a good starting point? Initial ideas: 1) Use pcolor or imshow and embed this axes in a larger axes, 2) represent the sub-patches as a PolyCollection. > > Thoughts? > -Tony > > [1] e.g. http://matplotlib.sourceforge.net/examples/pylab_examples/boxplot_demo.html > > Tony, > > I am not quite sure I understand. [snip] > Or maybe something else in the gallery is more like what you want: > > http://matplotlib.sourceforge.net/gallery.html > > Ben Root > I've checked the gallery, but I don't see anything that appears similar. In any case, I ended up hacking together something that works. I've attached an image of what I had in mind (created with the code at the very bottom of this reply). I ended up using mpl Rectangle objects and stringing them together using a PatchCollection. Maybe there's a more efficient way to do this, but this approach worked well-enough. Best, -Tony """ First attempt at a histogram strip chart (made up name). if-main block taken from [1] except that I've replaced uniform distributions with normal distributions. [1] http://matplotlib.sourceforge.net/examples/pylab_examples/boxplot_demo3.html """ import numpy as np import matplotlib.pyplot as plt from matplotlib import collections NORM_TYPES = dict(max=max, sum=sum) class BinCollection(collections.PatchCollection): def __init__(self, hist, bin_edges, x=0, width=1, cmap=plt.cm.gray_r, norm_type='max', **kwargs): yy = (bin_edges[:-1] + bin_edges[1:])/2. heights = np.diff(bin_edges) bins = [plt.Rectangle((x, y), width, h) for y, h in zip(yy, heights)] norm = NORM_TYPES[norm_type] fc = cmap(np.asarray(hist, dtype=float)/norm(hist)) super(BinCollection, self).__init__(bins, facecolors=fc, **kwargs) def histstrip(x, positions=None, widths=None, ax=None): if ax is None: ax = plt.gca() if positions is None: positions = range(1, len(x) + 1) if widths is None: widths = np.min(np.diff(positions)) / 2. * np.ones(len(positions)) for data, x_pos, w in zip(x, positions, widths): x_pos -= w/2. hist, bin_edges = np.histogram(data) bins = BinCollection(hist, bin_edges, width=w, x=x_pos) ax.add_collection(bins, autolim=True) ax.set_xticks(positions) ax.autoscale_view() if __name__ == '__main__': import matplotlib.pyplot as plt import numpy as np np.random.seed(2) inc = 0.1 e1 = np.random.normal(0,1, size=(500,)) e2 = np.random.normal(0,1, size=(500,)) e3 = np.random.normal(0,1 + inc, size=(500,)) e4 = np.random.normal(0,1 + 2*inc, size=(500,)) treatments = [e1,e2,e3,e4] fig, ax = plt.subplots() pos = np.array(range(len(treatments)))+1 histstrip(treatments, ax=ax) ax.set_xlabel('treatment') ax.set_ylabel('response') fig.subplots_adjust(right=0.99,top=0.99) plt.show() |
|
From: Benjamin R. <ben...@ou...> - 2010-10-01 13:41:02
|
On Thu, Sep 30, 2010 at 8:44 PM, Tony S Yu <ts...@gm...> wrote: > I'd like to make something in between a box plot [1] and a histogram. Each > histogram would be represented by a single, tall, rectangular patch (like > the box in a box plot), and the patch would be subdivided by the bin edges > of the histogram. The face color of each sub-patch would replace the bar > height in the histogram. > > If any of that actually made sense: > > * Does this type of plot have a name? > > * Is there an easy way to do this in Matplotlib? > > * If there isn't an easy way, what would be a good starting point? Initial > ideas: 1) Use pcolor or imshow and embed this axes in a larger axes, 2) > represent the sub-patches as a PolyCollection. > > Thoughts? > -Tony > > [1] e.g. > http://matplotlib.sourceforge.net/examples/pylab_examples/boxplot_demo.html > Tony, I am not quite sure I understand. Are you looking for error bars on the histogram, maybe? http://matplotlib.sourceforge.net/users/screenshots.html#bar-charts Or maybe something more like this: http://matplotlib.sourceforge.net/examples/pylab_examples/bar_stacked.html Or maybe something else in the gallery is more like what you want: http://matplotlib.sourceforge.net/gallery.html Ben Root |
|
From: damiano m. <dam...@wa...> - 2010-10-01 11:59:30
|
hi !
i would like to write a server side python script that generate .pdf
documents.
for the moment i have Python 2.7 installed server side
and matplolib installed server side too.
A simple script that create a simple plot and generate a .png picture
works.
this is the script i use :
#-------------------------------------------
# to access standard output :
import sys
# select a non-GUI backend :
import matplotlib
matplotlib.use('Agg')
#matplotlib.use("cairo.pdf")
#matplotlib.use('PDF')
# import plotting module :
import matplotlib.pyplot as plt
# generate the plot :
plt.plot([1,2,3,2,3,4])
# print the content type (what's the data type)
# the new line is embedded, using '\n' notation :
print "Content-Type: image/png\n"
# print "Content-Type: image/PDF\n"
# print "Content-type: application/pdf"
# output directly to webserver, as a png file
:
plt.savefig(sys.stdout, format='png')
# plt.savefig(sys.stdout, format='PDF')
# plt.savefig( "test.pdf", format='pdf' )
#-----------------------------------------------
I am wondering how to do the same thing but with sending a pdf file
instead of
a png picture. (the # are for all the things i tried)
Does someone know ?
thanks.
jean-claude
|