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
(38) |
2
(31) |
3
(9) |
|
4
(13) |
5
(24) |
6
(11) |
7
(8) |
8
(14) |
9
(7) |
10
(4) |
|
11
(7) |
12
(11) |
13
(16) |
14
(19) |
15
(11) |
16
(9) |
17
(3) |
|
18
(4) |
19
(47) |
20
(28) |
21
(9) |
22
(9) |
23
(11) |
24
|
|
25
|
26
(12) |
27
(22) |
28
(20) |
29
(16) |
30
(19) |
|
|
From: K. -M. A. <kmi...@go...> - 2010-04-13 16:13:50
|
> > On 2010-04-13 10:18 AM, K. -Michael Aye wrote: >> Dear all, >> >> maybe this should go to the Enthought list, but as the failure is directly related to the pylab switch of ipython, I thought I try it here first: >> >> On OSX I have trouble with using the pylab switch for ipython after I copied the gdal.pth into the Enthought site-packages folder (to be able to use my KyngChaos GDAL Frameworks inside the Enthought Python). >> >> The gdal.pth does the following to the sys.path: >> import sys; sys.path.insert(0,'/Library/Frameworks/GDAL.framework/Versions/1.7/Python/site-packages') >> >> and in that folder there is: >> >> -rw-rw-r-- 1 root admin 128B 8 Feb 20:52 gdal.py >> -rw-r--r-- 1 root admin 274B 3 Mar 23:20 gdal.pyc >> -rw-rw-r-- 1 root admin 143B 8 Feb 20:52 gdalconst.py >> -rw-r--r-- 1 root admin 304B 3 Mar 23:20 gdalconst.pyc >> -rw-rw-r-- 1 root admin 147B 8 Feb 20:52 gdalnumeric.py >> -rw-r--r-- 1 root admin 309B 3 Mar 23:20 gdalnumeric.pyc >> drwxrwxr-x 42 root admin 1.4K 3 Mar 23:20 numpy >> -rw-rw-r-- 1 root admin 125B 8 Feb 20:52 ogr.py >> -rw-r--r-- 1 root admin 286B 3 Mar 23:20 ogr.pyc >> drwxrwxr-x 21 root admin 714B 3 Mar 23:20 osgeo >> -rw-rw-r-- 1 root admin 125B 8 Feb 20:52 osr.py >> -rw-r--r-- 1 root admin 286B 3 Mar 23:20 osr.pyc >> >> Maybe the double import of a potentially different numpy compared to the Enthought numpy creates the Bus Error? > > Not so much a double import. Only one version ever gets imported, but the GDAL > Python bindings expect its version and matplotlib expects another version. > >> If so, how can I avoid it? > > You would have to rebuild the GDAL Python bindings against Enthought's numpy. > But why does everything work fine, when I start an Enthought ipython withOUT the -pylab switch? Importing 'from osgeo import gdal' and using it works fine in this case (Tried ReadAsArray from a gdal dataset and imshow'ed it without problems, apart from that I had to call show() because of the lack of the -pylab switch, but other than that, fine). PS.: Sorry for the mail-list noob question, but how can I nicely reply to your answer like you replied to my question, with 'Robert Kern wrote' and so on? There's no reply possible on sourceforge and the digest contains obviously many emails, so how do you do this? ;) |
|
From: MariaLuisa C. <ca...@at...> - 2010-04-13 16:09:04
|
Hello, I have to add new features to my windows project developed in Python 2.3 . So I need the Matplotlib and Basemap extension for Python 23. I have not found it in SourceForge. Could someone help me in finding these extensions? Thanks very much!! |
|
From: Daniel P. <mai...@go...> - 2010-04-13 16:08:35
|
Hello,
I have a question concerning the label positions of x- or y-ticks. My
problem is that I want to make a polar plot with ticklabels. To
generate such a plot you can use the following simple example script.
# #################################################
import numpy as np
import matplotlib.pyplot as plt
r = np.linspace(0, 10, 100)
t = np.linspace(0, 4*np.pi, 100)
fig = plt.figure(1)
fig.clf()
ax = fig.add_subplot(1,1,1, polar=True)
ax.plot(t, r, lw=2)
plt.draw()
plt.show()
# ##################################################
When generating a polarplot with this script one realizes that the
r-ticklabels (y-ticklabels) end up on the gridlines. This looks looks
kind of ugly especially for the last ticklabel ("10") which breaks the
solid line at the outer plot boundary. So I would like to move the
ticklabels a little bit to the right.
My question is: Is there a simple trick to change the default
ticklabelpad between the axis and the ticklabels or do I have to do
this manually by changing the position of every single ticklabel?
About a short answer I would be very glad.
With kind regards,
Daniel
|
|
From: Friedrich R. <fri...@gm...> - 2010-04-13 15:57:42
|
2010/4/12 Filipe Pires Alvarenga Fernandes <oc...@gm...>: > Thanks for point TKinter to me. However, I'm stuck again. > > I've tried two approaches, one is following what you suggested: > > """ Tkinter """ > import Tkinter as tk > root = tk.Tk() > from PIL import Image, ImageTk > image = ImageTk.PhotoImage(Image.open('map.png')) # load saved image > #image = ImageTk.PhotoImage(im) # load image from StringIO > tk.Label(root, image=image).pack() > > The other is to convert the PIL image to array and show with imshow() > > """ PIL to array """ > from matplotlib.image import pil_to_array > rgba = pil_to_array(Image.open('map.png')) # load saved image > #rgba = pil_to_array(im) # load image from StringIO > rgba = rgba.astype(np.float32)/255. > imshow(rgba) > > Both work fine for a saved image. However, they return strange errors > when I tried to apply them to the image from "StringIO", or even for a > saved image in the same script used to generate them. I guess that > something I import from matplotlib is causing a conflict here. > > Here are the error messages: > > """ Tkinter """ > _tkinter.TclError: image "pyimage9" doesn't exist > > > """ PIL to array """ > terminate called after throwing an instance of 'char const*' Hi, with the Tkinter PhotoImage, I think it's intended for use with Tkinter.Canvas, and not compatible with Label. For what I know, it works fine for me with Canvas (Windows). I guess what you end up with is not a real PhotoImage but something faky. Now, I cannot execute your script and dive in myself, because I switched to another laptop, where I have to compile everything ... So in some days, I will know more. With the pil_to_image issue, I really have no idea. It's really quite strange, isn't it? I mean, it should return a newly created numpy.ndarray, and shouldn't borrow any memory with the PIL Image? I really don't know at the moment, I'm sorry. For the Tkinter issue, from your script it seems that you simply want to display it, so give the Canvas a try. I used it in http://github.com/friedrichromstedt/diagram_cl/blob/master/panels/tk/diagram.py , start with update() and __init__(). hth for now, Friedrich |
|
From: Shaexoh6Wi E. <ooh...@gm...> - 2010-04-13 15:42:01
|
I saw something about the spy method. Do you think it's possible to use it combined with the imshow() capabilities ? 2010/4/13 Shaexoh6Wi Eweiju5ohx <ooh...@gm...> > Hello, > > I would like to ask you a way to fill certain regions with a specific motif > > when running imshow(). I take the following example : > > For certain value, instead of writing directly a numerical result, I would > like to fill my table with > 'x'. For other values, with 'o'. How take care of this with imshow, and how > assign a specific > color to such a specific region ? > > Thank you very much. > > > > |
|
From: hettling <het...@fe...> - 2010-04-13 15:35:41
|
Dear all,
I want to plot 3 overlapping regions using fill() into one panel, but my
solution looks sort of messy... Here is the code:
===
import matplotlib.pyplot as plt
import scipy
##Data to plot
seq = scipy.sin(range(0,10))
xpts = scipy.concatenate((range(0,10), range(0,10)[::-1]))
plt.figure()
##Plot 3 overlapping regions, a different color for each one
for diff, color in zip([1,2,3], ["blue", "red", "yellow"]):
ypts = scipy.concatenate((seq - diff, (seq - diff * 2)[::-1]))
plt.fill(xpts, ypts, alpha=0.4, fc=color, ec="black", lw=2,
label=str(diff))
plt.legend()
plt.show()
===
The figure looks like 4 regions are plotted, because overlapping red and
yellow make an orange region... I tried some different combination, but
it never looked good. Does anybody have an idea how to chose the colors
and 'alpha' values for transparency so that the plot looks good and
could be printed?
Any help is appreciated,
thanks in advance,
Hannes
|
|
From: Robert K. <rob...@gm...> - 2010-04-13 15:31:37
|
On 2010-04-13 10:18 AM, K. -Michael Aye wrote: > Dear all, > > maybe this should go to the Enthought list, but as the failure is directly related to the pylab switch of ipython, I thought I try it here first: > > On OSX I have trouble with using the pylab switch for ipython after I copied the gdal.pth into the Enthought site-packages folder (to be able to use my KyngChaos GDAL Frameworks inside the Enthought Python). > > The gdal.pth does the following to the sys.path: > import sys; sys.path.insert(0,'/Library/Frameworks/GDAL.framework/Versions/1.7/Python/site-packages') > > and in that folder there is: > > -rw-rw-r-- 1 root admin 128B 8 Feb 20:52 gdal.py > -rw-r--r-- 1 root admin 274B 3 Mar 23:20 gdal.pyc > -rw-rw-r-- 1 root admin 143B 8 Feb 20:52 gdalconst.py > -rw-r--r-- 1 root admin 304B 3 Mar 23:20 gdalconst.pyc > -rw-rw-r-- 1 root admin 147B 8 Feb 20:52 gdalnumeric.py > -rw-r--r-- 1 root admin 309B 3 Mar 23:20 gdalnumeric.pyc > drwxrwxr-x 42 root admin 1.4K 3 Mar 23:20 numpy > -rw-rw-r-- 1 root admin 125B 8 Feb 20:52 ogr.py > -rw-r--r-- 1 root admin 286B 3 Mar 23:20 ogr.pyc > drwxrwxr-x 21 root admin 714B 3 Mar 23:20 osgeo > -rw-rw-r-- 1 root admin 125B 8 Feb 20:52 osr.py > -rw-r--r-- 1 root admin 286B 3 Mar 23:20 osr.pyc > > Maybe the double import of a potentially different numpy compared to the Enthought numpy creates the Bus Error? Not so much a double import. Only one version ever gets imported, but the GDAL Python bindings expect its version and matplotlib expects another version. > If so, how can I avoid it? You would have to rebuild the GDAL Python bindings against Enthought's numpy. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco |
|
From: Shaexoh6Wi E. <ooh...@gm...> - 2010-04-13 15:28:27
|
Hello, I would like to ask you a way to fill certain regions with a specific motif when running imshow(). I take the following example : For certain value, instead of writing directly a numerical result, I would like to fill my table with 'x'. For other values, with 'o'. How take care of this with imshow, and how assign a specific color to such a specific region ? Thank you very much. |
|
From: K. -M. A. <kmi...@go...> - 2010-04-13 15:18:49
|
Dear all, maybe this should go to the Enthought list, but as the failure is directly related to the pylab switch of ipython, I thought I try it here first: On OSX I have trouble with using the pylab switch for ipython after I copied the gdal.pth into the Enthought site-packages folder (to be able to use my KyngChaos GDAL Frameworks inside the Enthought Python). The gdal.pth does the following to the sys.path: import sys; sys.path.insert(0,'/Library/Frameworks/GDAL.framework/Versions/1.7/Python/site-packages') and in that folder there is: -rw-rw-r-- 1 root admin 128B 8 Feb 20:52 gdal.py -rw-r--r-- 1 root admin 274B 3 Mar 23:20 gdal.pyc -rw-rw-r-- 1 root admin 143B 8 Feb 20:52 gdalconst.py -rw-r--r-- 1 root admin 304B 3 Mar 23:20 gdalconst.pyc -rw-rw-r-- 1 root admin 147B 8 Feb 20:52 gdalnumeric.py -rw-r--r-- 1 root admin 309B 3 Mar 23:20 gdalnumeric.pyc drwxrwxr-x 42 root admin 1.4K 3 Mar 23:20 numpy -rw-rw-r-- 1 root admin 125B 8 Feb 20:52 ogr.py -rw-r--r-- 1 root admin 286B 3 Mar 23:20 ogr.pyc drwxrwxr-x 21 root admin 714B 3 Mar 23:20 osgeo -rw-rw-r-- 1 root admin 125B 8 Feb 20:52 osr.py -rw-r--r-- 1 root admin 286B 3 Mar 23:20 osr.pyc Maybe the double import of a potentially different numpy compared to the Enthought numpy creates the Bus Error? If so, how can I avoid it? For a complete picture, here is my sys.path: ['', '/Library/Frameworks/Python.framework/Versions/6.1/bin', '/Users/aye/Library/Python/2.6/site-packages/ipython-0.10-py2.6.egg', '/Users/aye/Library/Python/2.6/site-packages/pydot-1.0.2-py2.6.egg', '/Users/aye/Library/Python/2.6/site-packages/pyparsing-1.5.2-py2.6.egg', '/Users/aye/Library/Python/2.6/site-packages/simplejson-2.0.9-py2.6.egg', '/Users/aye/Library/Python/2.6/site-packages/python_twitter-0.6-py2.6.egg', '/Users/aye/Library/Python/2.6/site-packages/PIL-1.1.7-py2.6-macosx-10.6-universal.egg', '/Users/aye/Library/Python/2.6/site-packages/Sphinx-0.6.3-py2.6.egg', '/Users/aye/Library/Python/2.6/site-packages/docutils-0.6-py2.6.egg', '/Users/aye/Library/Python/2.6/site-packages/Jinja2-2.2.1-py2.6.egg', '/Users/aye/Library/Python/2.6/site-packages/Pygments-1.1.1-py2.6.egg', '/Users/aye/Library/Python/2.6/site-packages/spyder-1.0.3-py2.6.egg', '/Users/aye/Library/Python/2.6/site-packages/scikits.image-0.2.2-py2.6-macosx-10.5-i386.egg', '/Users/aye/Library/Python/2.6/site-packages/PyXML-0.8.4-py2.6-macosx-10.6-universal.egg', '/Users/aye/Library/Python/2.6/site-packages/pyfo-0.6-py2.6.egg', '/Users/aye/Library/Python/2.6/site-packages/Amara-2.0a4-py2.6-macosx-10.6-universal.egg', '/Users/aye/Library/Python/2.6/site-packages/setuptools-0.6c11-py2.6.egg', '/Users/aye/Library/Python/2.6/site-packages/distribute-0.6.10-py2.6.egg', '/Users/aye/Library/Python/2.6/site-packages/pip-0.6.3-py2.6.egg', '/Library/Frameworks/GDAL.framework/Versions/1.7/Python/site-packages', '/Library/Frameworks/Python.framework/Versions/6.1/lib/python26.zip', '/Library/Frameworks/Python.framework/Versions/6.1/lib/python2.6', '/Library/Frameworks/Python.framework/Versions/6.1/lib/python2.6/plat-darwin', '/Library/Frameworks/Python.framework/Versions/6.1/lib/python2.6/plat-mac', '/Library/Frameworks/Python.framework/Versions/6.1/lib/python2.6/plat-mac/lib-scriptpackages', '/Library/Frameworks/Python.framework/Versions/6.1/lib/python2.6/lib-tk', '/Library/Frameworks/Python.framework/Versions/6.1/lib/python2.6/lib-old', '/Library/Frameworks/Python.framework/Versions/6.1/lib/python2.6/lib-dynload', '/Library/Frameworks/Python.framework/Versions/6.1/lib/python2.6/site-packages/PIL', '/Library/Frameworks/Python.framework/Versions/6.1/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg-info', '/Users/aye/Library/Python/2.6/site-packages', '/Users/aye/Library/Python/2.6/site-packages/PIL', '/Users/aye/Library/Python/2.6/site-packages/ipython-0.10-py2.6.egg/IPython/Extensions', u'/Users/aye/.ipython'] I am grateful for any hint how to make the -pylab switch working again in this scenario. Best regards, Michael |
|
From: <tom...@gm...> - 2010-04-12 21:20:46
|
Thank you very much, you helped me a great deal. The video tutorials are great. I'm going through the stuff you sent and things seem to become clearer.... Tomislav ----- Original Message ----- From: John Hunter Sent: 04/11/10 04:19 PM To: tom...@gm... Subject: Re: [Matplotlib-users] how to plot a Polygon / plt.draw() problem On Sun, Apr 11, 2010 at 7:15 AM, tom...@gm... <tom...@gm...> wrote: > can someone help me to plot a polygon in matplotlib? > > I have been reading about the axes.patches.Polygon class and I have defined > the > > Polygon object that has a preset lw and points. How do I plot it? > > I'm confused because the Axes documentation states that this class holds > most of > > the figure objects like Rectangle, Line2D, and then the website states that > the Line2D > > is a return object from the plt.plot() invocation. Yes, Axes.plot is a helper function which creates a Line2D object, adds it to the axes, sets the transformation, etc... This process is covered in some detail in the matplotlib Artist tutorial http://matplotlib.sourceforge.net/users/artists.html and in the advanced matplotlib tutorial at scipy -- video available here http://www.archive.org/details/scipy09_advancedTutorialDay1_3 > What if I create my own > set of Rectangle > > (Polygon) objects and want to create a list of them and plot them? If you create your own polygons/rectangles/patches, create them, and then add them with Axes.add_patch http://matplotlib.sourceforge.net/api/axes_api.html#matplotlib.axes.Axes.add_patch If you want to create a bunch of them, consider a PolygonCollection (or a RegularPolygonCollection depending on your use case) http://matplotlib.sourceforge.net/api/collections_api.html http://matplotlib.sourceforge.net/search.html?q=codex+PolyCollection > Also, I'm using this sequence of commands to work in OO mode interactively > > (just to learn) but when I execute plt.draw() no figure appears. We make a distinction between raising a figure (plt.show) and rendering to an existing figure (plt.draw). In interactive mode (which is what ipython -pylab turns on) figures are automatically raised/shown. You can control these settings from a regular python shell using ion and ioff. See http://matplotlib.sourceforge.net/users/shell.html Here is a complete example:: import matplotlib.patches as patches import matplotlib.pyplot as plt fig = plt.figure() ax = fig.add_subplot(111) verts = [0,0], [0,1], [1,1], [1,0] poly = patches.Polygon(verts) ax.add_patch(poly) ax.set_xlim(-2,2) ax.set_ylim(-2,2) plt.show() Hope this helps, JDH |
|
From: <qu...@gm...> - 2010-04-12 21:20:27
|
I need to plot the path the tip of a specific vector draws, when the vector is rotated around certain axis for some angels as a basic example: start vector is (0,0,1) rotation around axis (0,1,0) for an angle of (pi/2) rotation around axis (0,0,1) for an angle of (pi) so the path should show something like starting at the bottom, go up to the equator plane and then turn around the equator to the other side this could also be expressed in terms of a point moving on a sphere ... a graphical example would be like the path C in this figure http://physics.aps.org/view_image/2213/medium/4 does anyone happen to know how i could easily implement something like that? with best regards and thanks for your help/suggestions q -- The king who needs to remind his people of his rank, is no king. A beggar's mistake harms no one but the beggar. A king's mistake, however, harms everyone but the king. Too often, the measure of power lies not in the number who obey your will, but in the number who suffer your stupidity. |
|
From: lmkli <ken...@gm...> - 2010-04-12 20:50:16
|
Firstly, I want to thank Marius (Marius 't Hart-3) and Eric (efiring) for the help on my question. Especially Eric, your advices about 'antialiased' gave me the hint to get the solution. In my previous topic " http://old.nabble.com/contourf-creats-white-like-lines-(or-gaps)-between-each-two-color-patches-tp27982822p28210898.html contourf creats white-like lines (or gaps) between each two color patches ", I attached two figures to show the bug-like problem of contourf plotting function. The first one is created by contourf only, and the in second one, I used contourf and contour together to fill up the gaps between each two patches. It seems a kind of solution to make the filled contour map better looking, but I really don't like this messy way. So I posted the questionhere to find answers. Following Eric's suggestion > CS = contourf(Z) > for c in CS.collections: > c.set_antialiased(False) the antialiased attributes of each polygon in the filled contour map is changed to be unsmoothed, and the gaps are gone. This is much better way to solve the gap problem, but I should do this every time after I plotting the filled contour map. It's not the best solution. 1. Basic solution I tried to study the arguments of contourf function to find the proper parameter about antiliased, and there is one in the doc string: ''' contourf-only keyword arguments: *antialiased*: [ True | False ] enable antialiasing ''' Good! Try this: CS = contourf(Z, antialiased=False) Oops~~~ nothing happens, gaps are still there. Why? Bug? I searched 'antialiased' in the contour.py(this file located in the installed matplotlib package directory), and find this: (line 604 through 607) col = collections.PolyCollection(nlist, antialiaseds = (self.antialiased,), edgecolors= 'none', alpha=self.alpha) I changed the line 605 antialiaseds = (self.antialiased,), to antialiaseds = self.antialiased, plotted the filled contourf map again: CS = contourf(Z, antialiased=False) Wow~~~ gaps free. I don't know if it is a bug or not, but edit it simply, works well. 2. Upgrade the solution Don't like the unsmoothed edge? Still want the antialiased to be True? OK, notice the line just under antialiaseds setting listed above? edgecolors='none', it means no edge is plotted. Go straight down to line 640: collection.set_facecolor(color) here the face colors are set. Just below this line, I added one new line: collection.set_edgecolor(color) then plotted the filled contourf map anain, without setting antialiased=False: CS = contourf(Z) Aha, Mission accomplished. -- View this message in context: http://old.nabble.com/Solution-of-my-previous-topic%3A-contourf-creats-white-like-lines-%28or-gaps%29-tp28219185p28219185.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
|
From: Friedrich R. <fri...@gm...> - 2010-04-12 20:09:10
|
2010/4/11 Alan G Isaac <ala...@gm...>: > On 4/11/2010 9:27 AM, Friedrich Romstedt wrote: >> I think you can use Tk via the Tkinter Python package. On linux I >> heard it's looking a bit weird, but as a starting points it's easy >> enough. > > Weird how? > Will that be fixed with the new release (ttk, in Python 2.7)? Hmm, it was meant as a warning, nothing shure. I just read somewhere that the Tk, although originating from linux, would look the worst on linux. I can neither verify nor falsify, because I have no linux. Sorry for the noise. I even cannot exclude that it's wrong. This amazing page: http://docs.python.org/dev/library/ttk.html (I especially like the ComboBox, something I always missed in Tkinter :-) states that look and feed would change with ttk, so maybe you're lucky. Friedrich |
|
From: Tsviki H. <tsv...@gm...> - 2010-04-12 18:25:52
|
My simple way to solve the white-lines issue is simply to give the contourf command twice: contourf(x,y,z) contourf(x,y,z) The white lines are magically disappearing, also in png files. This works well also with alpha<1 Tsviki Hirsh > What version of mpl are you using? My mpl version is 0.99.1 > Are you modifying the default anti-aliasing in the patch collections that > contour is creating? Could you please tell me how to this? I am very new to matplotlib, thank you very much if you can give me some advices. >Are you seeing the problem when using the ps and pdf backends, or only with agg (that is, creating png files directly)? So far I only creating png files directly. Also, how to use ps and pdf backend? > ....which has been fixed in svn. Do you mean I should download another mpl by svn? Thank you for your answers very much! efiring wrote: > > What version of mpl are you using? Are you modifying the default > anti-aliasing in the patch collections that contour is creating? Are you > seeing the problem when using the ps and pdf backends, or only with agg > (that is, creating png files directly)? > > There are two problems that can contribute to this, one related to the > way the agg backend handles the boundaries between filled regions, and > the other a bug in path simplification, which has been fixed in svn. > > Eric > > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > -- View this message in context: http://old.nabble.com/contourf-creats-white-like-lines-%28or-gaps%29-between-each-two-color-patches-tp27982822p28210898.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
|
From: KrishnaPribadi <Kri...@ha...> - 2010-04-12 17:44:26
|
I figured it out on my own! Why I couldn't figure it out before... I don't
know...
Here is the code:
myhighlights[1].set_facecolor('y')
myhighlights[1].set_xy([[ 3.5 , 0. ],\
[ 3.5 , 1. ],
[ 3.75, 1. ],
[ 3.75, 0. ],
[ 3.5 , 0. ]])
KrishnaPribadi wrote:
>
> Hi,
> I added several axvspan "highlights on my plot.
>
> I'd like to change the properties of only one of those "highlights" such
> as the facecolor, xmin, and xmax. I've included some code below. Lets say
> I'd like to change the properties on the 2nd vertical highlight (axvspan).
>
> Can someone please suggest some code on accessing and changing properties
> on that specific object?
>
> do I access it from the object "myhighlights" or do I access is from the
> object "ax"?
>
> Note: This is just some simple code I came up with. My real application is
> in a wx app GUI so I will be using the draw() function.
>
> Here is my code:
> import numpy as np
> import matplotlib.pyplot as plt
>
>
> t = np.arange(0, np.pi*2, 0.01)
> x = np.sin(2*np.pi*t)
>
>
> fig = plt.figure()
> ax = fig.add_subplot(111)
> ax.grid('On')
>
> myplot = ax.plot(t, x, 'b')
>
> myhighlights = []
> myhighlights.append(ax.axvspan(1,2, facecolor='g', alpha=0.2))
> myhighlights.append(ax.axvspan(3,4, facecolor='g', alpha=0.2)) #later
> let's change the facecolor, xmin, and xmax
> myhighlights.append(ax.axvspan(5,6, facecolor='g', alpha=0.2))
>
> #need code to change properties of the 2nd axvspan
> #change facecolor to yellow
> #change xmin to 3.5 and xmax to 4.5
>
> plt.show()
>
-----
Krishna Adrianto Pribadi
Test Engineer
Harley-Davidson Motor Co.
Talladega Test Facility
Vehicle Test Stands
--
View this message in context: http://old.nabble.com/axvspan%2C-multiple-calls%2C-how-to-change-prop-of-1-object-instance-tp28219155p28219166.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
|
|
From: KrishnaPribadi <Kri...@ha...> - 2010-04-12 16:22:27
|
Hi,
I added several axvspan "highlights on my plot.
I'd like to change the properties of only one of those "highlights" such as
the facecolor, xmin, and xmax. I've included some code below. Lets say I'd
like to change the properties on the 2nd vertical highlight (axvspan).
Can someone please suggest some code on accessing and changing properties on
that specific object?
do I access it from the object "myhighlights" or do I access is from the
object "ax"?
Note: This is just some simple code I came up with. My real application is
in a wx app GUI so I will be using the draw() function.
Here is my code:
import numpy as np
import matplotlib.pyplot as plt
t = np.arange(0, np.pi*2, 0.01)
x = np.sin(2*np.pi*t)
fig = plt.figure()
ax = fig.add_subplot(111)
ax.grid('On')
myplot = ax.plot(t, x, 'b')
myhighlights = []
myhighlights.append(ax.axvspan(1,2, facecolor='g', alpha=0.2))
myhighlights.append(ax.axvspan(3,4, facecolor='g', alpha=0.2)) #later let's
change the facecolor, xmin, and xmax
myhighlights.append(ax.axvspan(5,6, facecolor='g', alpha=0.2))
#need code to change properties of the 2nd axvspan
#change facecolor to yellow
#change xmin to 3.5 and xmax to 4.5
plt.show()
-----
Krishna Adrianto Pribadi
Test Engineer
Harley-Davidson Motor Co.
Talladega Test Facility
Vehicle Test Stands
--
View this message in context: http://old.nabble.com/axvspan%2C-multiple-calls%2C-how-to-change-prop-of-1-object-instance-tp28219155p28219155.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
|
|
From: lmkli <ken...@gm...> - 2010-04-12 15:17:07
|
> CS = contourf(Z)
> for c in CS.collections:
> c.set_antialiased(False)
Eric,
Thank you! I like this very much!
So, the last thing is, is there any way to set this antialiased feature to
False by default?
efiring wrote:
>
> lmkli wrote:
>>> What version of mpl are you using?
>> My mpl version is 0.99.1
>>
>>> Are you modifying the default anti-aliasing in the patch collections
>>> that
>>> contour is creating?
>> Could you please tell me how to this? I am very new to matplotlib, thank
>> you
>> very much if you can give me some advices.
>
> see below.
>
>>
>>> Are you seeing the problem when using the ps and pdf backends, or only
>>> with
>> agg (that is, creating png files directly)?
>> So far I only creating png files directly. Also, how to use ps and pdf
>> backend?
>
> The easiest way is with the pyplot savefig command: e.g.
>
> savefig("test.pdf")
>
> to save the current figure as a pdf.
>
> It doesn't look to me like this solves the problem, though.
>
>>
>>> ....which has been fixed in svn.
>> Do you mean I should download another mpl by svn?
>
> That might help, but it probably won't cure the problem completely. I
> don't know that there is any combination of parameters that gives
> boundaries as smooth and gap-free as in your second example. You may
> get a bit closer to it like this:
>
> CS = contourf(Z)
> for c in CS.collections:
> c.set_antialiased(False)
>
> (If working interactively in ipython, follow this with a "draw()"
> command to force a redraw.)
>
> Eric
>
>>
>> Thank you for your answers very much!
>>
>>
>> efiring wrote:
>>> What version of mpl are you using? Are you modifying the default
>>> anti-aliasing in the patch collections that contour is creating? Are you
>>> seeing the problem when using the ps and pdf backends, or only with agg
>>> (that is, creating png files directly)?
>>>
>>> There are two problems that can contribute to this, one related to the
>>> way the agg backend handles the boundaries between filled regions, and
>>> the other a bug in path simplification, which has been fixed in svn.
>>>
>>> Eric
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Download Intel® Parallel Studio Eval
>>> Try the new software tools for yourself. Speed compiling, find bugs
>>> proactively, and fine-tune applications for parallel performance.
>>> See why Intel Parallel Studio got high marks during beta.
>>> http://p.sf.net/sfu/intel-sw-dev
>>> _______________________________________________
>>> Matplotlib-users mailing list
>>> Mat...@li...
>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>>
>>>
>>
>
>
> ------------------------------------------------------------------------------
> Download Intel® Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
--
View this message in context: http://old.nabble.com/contourf-creats-white-like-lines-%28or-gaps%29-between-each-two-color-patches-tp27982822p28219132.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
|
|
From: Filipe P. A. F. <oc...@gm...> - 2010-04-12 13:57:41
|
Thanks for point TKinter to me. However, I'm stuck again. I've tried two approaches, one is following what you suggested: """ Tkinter """ import Tkinter as tk root = tk.Tk() from PIL import Image, ImageTk image = ImageTk.PhotoImage(Image.open('map.png')) # load saved image #image = ImageTk.PhotoImage(im) # load image from StringIO tk.Label(root, image=image).pack() The other is to convert the PIL image to array and show with imshow() """ PIL to array """ from matplotlib.image import pil_to_array rgba = pil_to_array(Image.open('map.png')) # load saved image #rgba = pil_to_array(im) # load image from StringIO rgba = rgba.astype(np.float32)/255. imshow(rgba) Both work fine for a saved image. However, they return strange errors when I tried to apply them to the image from "StringIO", or even for a saved image in the same script used to generate them. I guess that something I import from matplotlib is causing a conflict here. Here are the error messages: """ Tkinter """ _tkinter.TclError: image "pyimage9" doesn't exist """ PIL to array """ terminate called after throwing an instance of 'char const*' I'm attaching the script. Aborted |
|
From: Michael D. <md...@st...> - 2010-04-12 12:57:21
|
There doesn't seem to be a screenshot attached. Maybe the mailing list ate it. Can you send it to me directly (off list)? Mike KrishnaPribadi wrote: > Here my screen shot. Notice the red and green line merging then turning > brown... > > -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA |
|
From: Eric F. <ef...@ha...> - 2010-04-12 01:10:36
|
lmkli wrote:
>> What version of mpl are you using?
> My mpl version is 0.99.1
>
>> Are you modifying the default anti-aliasing in the patch collections that
>> contour is creating?
> Could you please tell me how to this? I am very new to matplotlib, thank you
> very much if you can give me some advices.
see below.
>
>> Are you seeing the problem when using the ps and pdf backends, or only with
> agg (that is, creating png files directly)?
> So far I only creating png files directly. Also, how to use ps and pdf
> backend?
The easiest way is with the pyplot savefig command: e.g.
savefig("test.pdf")
to save the current figure as a pdf.
It doesn't look to me like this solves the problem, though.
>
>> ....which has been fixed in svn.
> Do you mean I should download another mpl by svn?
That might help, but it probably won't cure the problem completely. I
don't know that there is any combination of parameters that gives
boundaries as smooth and gap-free as in your second example. You may
get a bit closer to it like this:
CS = contourf(Z)
for c in CS.collections:
c.set_antialiased(False)
(If working interactively in ipython, follow this with a "draw()"
command to force a redraw.)
Eric
>
> Thank you for your answers very much!
>
>
> efiring wrote:
>> What version of mpl are you using? Are you modifying the default
>> anti-aliasing in the patch collections that contour is creating? Are you
>> seeing the problem when using the ps and pdf backends, or only with agg
>> (that is, creating png files directly)?
>>
>> There are two problems that can contribute to this, one related to the
>> way the agg backend handles the boundaries between filled regions, and
>> the other a bug in path simplification, which has been fixed in svn.
>>
>> Eric
>>
>>
>> ------------------------------------------------------------------------------
>> Download Intel® Parallel Studio Eval
>> Try the new software tools for yourself. Speed compiling, find bugs
>> proactively, and fine-tune applications for parallel performance.
>> See why Intel Parallel Studio got high marks during beta.
>> http://p.sf.net/sfu/intel-sw-dev
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>>
>
|
|
From: lmkli <ken...@gm...> - 2010-04-11 18:56:43
|
> What version of mpl are you using? My mpl version is 0.99.1 > Are you modifying the default anti-aliasing in the patch collections that > contour is creating? Could you please tell me how to this? I am very new to matplotlib, thank you very much if you can give me some advices. >Are you seeing the problem when using the ps and pdf backends, or only with agg (that is, creating png files directly)? So far I only creating png files directly. Also, how to use ps and pdf backend? > ....which has been fixed in svn. Do you mean I should download another mpl by svn? Thank you for your answers very much! efiring wrote: > > What version of mpl are you using? Are you modifying the default > anti-aliasing in the patch collections that contour is creating? Are you > seeing the problem when using the ps and pdf backends, or only with agg > (that is, creating png files directly)? > > There are two problems that can contribute to this, one related to the > way the agg backend handles the boundaries between filled regions, and > the other a bug in path simplification, which has been fixed in svn. > > Eric > > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > -- View this message in context: http://old.nabble.com/contourf-creats-white-like-lines-%28or-gaps%29-between-each-two-color-patches-tp27982822p28210898.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
|
From: John H. <jd...@gm...> - 2010-04-11 17:07:41
|
This is mainly a question for JJ. I would like to make a schematic
diagram, like you might get from Dia or OmniGraffle. With the offset
boxes, annotations, vpackers/hpackers and fancy arrows, it seems like
the pieces are mostly in place. Unlike simple annotations, I need to
have multiple arrows originating from a single box. The diagram I am
trying to draw shows the relationship between various packages for
scientific computing in python. The crude ASCII art picture looks
like this:
Python
/ \
/ \
IPython Numpy
| / \
| / \
matplotlib scipy
where arrows are pointing from
Python -> IPython
Python -> numpy
IPython -> matplotlib
numpy -> matplotlib
numpy -> scipy
and IPython and numpy are on one level (HPacker?) and are below Python
(Vpacker?) and so on. Each text instance is surrounded by a fancy box
and are connected by fancy arrows.
Is it fairly easy to put something like this together using all the
offsetbox tools and fancy arrows?
Thanks,
JDH
|
|
From: Peter B. <bu...@gm...> - 2010-04-11 16:40:59
|
sorry if this has been covered before, but I must say I've found the
following quite confusing :
color="cyan" is not in fact equivalent to color='c'
in colors.py :
Commands which take color arguments can use several formats to specify
the colors. For the basic builtin colors, you can use a single letter
- b : blue
- g : green
- r : red
- c : cyan
- m : magenta
- y : yellow
- k : black
- w : white
in ColorConverter :
colors = {
'b' : (0.0, 0.0, 1.0),
'g' : (0.0, 0.5, 0.0),
'r' : (1.0, 0.0, 0.0),
'c' : (0.0, 0.75, 0.75),
'm' : (0.75, 0, 0.75),
'y' : (0.75, 0.75, 0),
'k' : (0.0, 0.0, 0.0),
'w' : (1.0, 1.0, 1.0),
}
we are told 'c' is short for cyan. Yet color="cyan" is not equivalent
to color='c'
'cyan' : '#00FFFF'
In [50]: rgb2hex((0.0, 0.75, 0.75))
Out[50]: '#00bfbf'
|
|
From: John H. <jd...@gm...> - 2010-04-11 14:19:39
|
On Sun, Apr 11, 2010 at 7:15 AM, tom...@gm... <tom...@gm...> wrote: > can someone help me to plot a polygon in matplotlib? > > I have been reading about the axes.patches.Polygon class and I have defined > the > > Polygon object that has a preset lw and points. How do I plot it? > > I'm confused because the Axes documentation states that this class holds > most of > > the figure objects like Rectangle, Line2D, and then the website states that > the Line2D > > is a return object from the plt.plot() invocation. Yes, Axes.plot is a helper function which creates a Line2D object, adds it to the axes, sets the transformation, etc... This process is covered in some detail in the matplotlib Artist tutorial http://matplotlib.sourceforge.net/users/artists.html and in the advanced matplotlib tutorial at scipy -- video available here http://www.archive.org/details/scipy09_advancedTutorialDay1_3 > What if I create my own > set of Rectangle > > (Polygon) objects and want to create a list of them and plot them? If you create your own polygons/rectangles/patches, create them, and then add them with Axes.add_patch http://matplotlib.sourceforge.net/api/axes_api.html#matplotlib.axes.Axes.add_patch If you want to create a bunch of them, consider a PolygonCollection (or a RegularPolygonCollection depending on your use case) http://matplotlib.sourceforge.net/api/collections_api.html http://matplotlib.sourceforge.net/search.html?q=codex+PolyCollection > Also, I'm using this sequence of commands to work in OO mode interactively > > (just to learn) but when I execute plt.draw() no figure appears. We make a distinction between raising a figure (plt.show) and rendering to an existing figure (plt.draw). In interactive mode (which is what ipython -pylab turns on) figures are automatically raised/shown. You can control these settings from a regular python shell using ion and ioff. See http://matplotlib.sourceforge.net/users/shell.html Here is a complete example:: import matplotlib.patches as patches import matplotlib.pyplot as plt fig = plt.figure() ax = fig.add_subplot(111) verts = [0,0], [0,1], [1,1], [1,0] poly = patches.Polygon(verts) ax.add_patch(poly) ax.set_xlim(-2,2) ax.set_ylim(-2,2) plt.show() Hope this helps, JDH |
|
From: Alan G I. <ala...@gm...> - 2010-04-11 13:40:02
|
On 4/11/2010 9:27 AM, Friedrich Romstedt wrote: > I think you can use Tk via the Tkinter Python package. On linux I > heard it's looking a bit weird, but as a starting points it's easy > enough. Weird how? Will that be fixed with the new release (ttk, in Python 2.7)? Thanks, Alan Isaac |