Re: [Matplotlib-users] Basemap: Coastlines intersecting with map boundary

2012-09-17 Thread Joachim Saul
Jeff, thanks for your feedback!

Jeff Whitaker [15.09.2012 17:25]:
 On 9/15/12 8:05 AM, Joachim Saul wrote:
 Hi there,

 in basemap coastlines are apparently (always?) drawn as closed polygons not 
 exceeding the map boundary, i.e. when the coastline intersects with the map 
 boundary the polygon is continued along the map boundary until the next 
 intersection point. The somewhat annoying side effect of this is a map 
 boundary that appears thicker where it crosses landmasses. See for instance 
 on http://matplotlib.org/basemap/users/examples the example Plot hurricane 
 tracks from a shapefile where clearly the upper and left map boundaries are 
 thicker where they cross the western U.S. or northern Canada. Another 
 example where this effect is particularly pronounced is the example Draw 
 great circle between NY and London on the same page. The effect gets worse 
 if running these examples without antialiasing. Apparently only the upper 
 and left boundaries are affected, whereas the lower and right boundaries are 
 plotted properly.

 It looks to me as if this might simply be a bug due to the coastline not 
 aligning perfectly with the map boundary, perhaps because of some roundoff 
 error. Is there a way to avoid this? Wouldn't it be better to draw the 
 coastlines not as closed polygons but as collections of line segments?

 Cheers,
 Joachim


 Joachim: I've noticed this myself, but have not found any solution. I suppose 
 I could add an option to treat coastlines as line segments, but then you 
 would not be able to use the fillcontinents method.

On the other hand, computing the coastlines /either/ as segments /or/ 
closed polygons might be inexpensive enough to be done on the fly - i.e. 
segments in drawcoastlines() but closed polygons in fillcontinents(). A 
computational penalty comes into play only where both are called. But I 
think this would be acceptable.

  Here's what happens now when a Basemap instance is created:

 1) the intersection between the coastline polygons and the map boundary is 
 computed using the geos C library.
 2) the coastline polygons are clipped at the map boundary
 3) the coordinates of the coastline polygons are transformed to map 
 projection coordinates

 Then, when the drawcoastlines or fillcontinents methods are called only the 
 polygons inside the map projection region are drawn.  This saves  *a lot* of 
 time when you're using high-resolution coastlines in a small map region.  
 There is a similar process for political boundaries, but since they are line 
 segments you don't see the thickening around the map edges.

Generally speaking this optimization stragegy is absolutely fine and 
works well - except for this nasty little line width artefact. ;)

 Maybe one solution would be to clip the polygons to a region slightly larger 
 than the actual map projection region.

That should work but on the other hand it seems a little hackish and the 
resulting code could be harder to understand. Besides the suggestion 
given above I still have the feeling that part of the problem might be 
related to some roundoff issue - how else could the presence of 
thickened lines be (apparently) confined to only the upper and left border?

Cheers,
Joachim

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Problem with axvline in gridspec with log Y axis

2012-09-17 Thread Phil Elson
Sometimes, having a point of reference really helps in tracking the issue
down, particularly when complimented with the very cool bisect tool that
comes with git. In this case though, I knew where the problem came in
because I have been working closely in this area recently (and it's my
change which has exposed the problem). I have fixed this in the pull
request, and fully expect the fix to be in the next 1.2.x release candidate.

If your willing and able, you could get hold of my branch until it is
merged to carry on testing the release candidate.

Hope that helps,

All the best,

Phil


On 14 September 2012 17:53, Scott Lasley slas...@space.umd.edu wrote:


 On Sep 14, 2012, at 5:02 AM, Phil Elson pelson@gmail.com wrote:

  Thanks for raising this. I have simplified and opened an issue for the
 bug (https://github.com/matplotlib/matplotlib/issues/1246) and will be
 looking at this asap.
 
  All the best,
 
  Phil

 I don't know if this helps, but my scripts and the code snippet in my
 email message work without crashing using matplotlib 1.2.x compiled from
 github on July 23, 2012 and
 numpy-1.8.0.dev_63cd8f3-py2.7-macosx-10.6-intel.egg on another mac running
 OS X 10.8.1.

 Thank you for looking into this,
 Scott
--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] sharex with different tick labels

2012-09-17 Thread Stan West
From: Daniel Welling [mailto:dantwell...@gmail.com] 
Sent: Thursday, September 13, 2012 16:23

Greetings, all. 

I have an issue: I have several axes stacked in a column with a common time
vector on each x-axis.  Each plot is a contour, so overplotting is not an
option.  In a perfect world, I want the following:
1) The subplots are tightly spaced such that with ax.grid() activated, the
grid lines appear continuous.  This makes comparing simultaneous
characteristics between subplots very easy.
2) The subplots are linked via the sharex keyword so I can move them all in
unison.
3) Only the bottommost subplot has x tick labels; on other plots, the long
time-formatted labels stick out of the left and right of the plots.

[...]

For #3, there is a convenience method of subplots, label_outer [1], that sets
the visibility of the tick labels (as Francesco described), making them
visible in the bottom row and invisible elsewhere (as in Sterling's code).
Just iterate over all of your subplots and call the label_outer method on each
one.

[1]
http://matplotlib.org/api/axes_api.html#matplotlib.axes.SubplotBase.label_oute
r

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Basemap: Coastlines intersecting with map boundary

2012-09-17 Thread Jeff Whitaker
On 9/17/12 5:09 AM, Joachim Saul wrote:
 Jeff, thanks for your feedback!

A workaround for this (having drawcoastlines use line segments instead 
of polygons) is now part of this pull request:

https://github.com/matplotlib/basemap/pull/78

Let's move discussion there..

-Jeff


 Jeff Whitaker [15.09.2012 17:25]:
 On 9/15/12 8:05 AM, Joachim Saul wrote:
 Hi there,

 in basemap coastlines are apparently (always?) drawn as closed polygons not 
 exceeding the map boundary, i.e. when the coastline intersects with the map 
 boundary the polygon is continued along the map boundary until the next 
 intersection point. The somewhat annoying side effect of this is a map 
 boundary that appears thicker where it crosses landmasses. See for instance 
 on http://matplotlib.org/basemap/users/examples the example Plot hurricane 
 tracks from a shapefile where clearly the upper and left map boundaries 
 are thicker where they cross the western U.S. or northern Canada. Another 
 example where this effect is particularly pronounced is the example Draw 
 great circle between NY and London on the same page. The effect gets worse 
 if running these examples without antialiasing. Apparently only the upper 
 and left boundaries are affected, whereas the lower and right boundaries 
 are plotted properly.

 It looks to me as if this might simply be a bug due to the coastline not 
 aligning perfectly with the map boundary, perhaps because of some roundoff 
 error. Is there a way to avoid this? Wouldn't it be better to draw the 
 coastlines not as closed polygons but as collections of line segments?

 Cheers,
 Joachim

 Joachim: I've noticed this myself, but have not found any solution. I 
 suppose I could add an option to treat coastlines as line segments, but then 
 you would not be able to use the fillcontinents method.
 On the other hand, computing the coastlines /either/ as segments /or/
 closed polygons might be inexpensive enough to be done on the fly - i.e.
 segments in drawcoastlines() but closed polygons in fillcontinents(). A
 computational penalty comes into play only where both are called. But I
 think this would be acceptable.

   Here's what happens now when a Basemap instance is created:

 1) the intersection between the coastline polygons and the map boundary is 
 computed using the geos C library.
 2) the coastline polygons are clipped at the map boundary
 3) the coordinates of the coastline polygons are transformed to map 
 projection coordinates

 Then, when the drawcoastlines or fillcontinents methods are called only the 
 polygons inside the map projection region are drawn.  This saves  *a lot* of 
 time when you're using high-resolution coastlines in a small map region.  
 There is a similar process for political boundaries, but since they are line 
 segments you don't see the thickening around the map edges.
 Generally speaking this optimization stragegy is absolutely fine and
 works well - except for this nasty little line width artefact. ;)

 Maybe one solution would be to clip the polygons to a region slightly larger 
 than the actual map projection region.
 That should work but on the other hand it seems a little hackish and the
 resulting code could be harder to understand. Besides the suggestion
 given above I still have the feeling that part of the problem might be
 related to some roundoff issue - how else could the presence of
 thickened lines be (apparently) confined to only the upper and left border?

 Cheers,
 Joachim

 --
 Live Security Virtual Conference
 Exclusive live event will cover all the ways today's security and
 threat landscape has changed and how IT managers can respond. Discussions
 will include endpoint security, mobile security and the latest in malware
 threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


-- 
Jeffrey S. Whitaker Phone  : (303)497-6313
Meteorologist   FAX: (303)497-6449
NOAA/OAR/PSD  R/PSD1Email  : jeffrey.s.whita...@noaa.gov
325 BroadwayOffice : Skaggs Research Cntr 1D-113
Boulder, CO, USA 80303-3328 Web: http://tinyurl.com/5telg



--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] broken links at github

2012-09-17 Thread Christian.Strobl

hi all,
a lot of links at the github repository are broken. for example all the links 
to png, source code, ... of the image tutorial 
(http://matplotlib.org/users/image_tutorial.html). but also links of other 
pages are broken (e.g. 
http://matplotlib.org/users/plotting/examples/demo_gridspec01.png or 
http://matplotlib.org/users/tight_layout_guide.html or ) and a lot of 
google search results.
best regards
christian
--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] broken links at github

2012-09-17 Thread Michael Droettboom
Thanks for pointing this out.  I'll get to the bottom of it.

Mike

On 09/17/2012 05:16 PM, christian.str...@dlr.de wrote:
 hi all,
 a lot of links at the github repository are broken. for example all the links 
 to png, source code, ... of the image tutorial 
 (http://matplotlib.org/users/image_tutorial.html). but also links of other 
 pages are broken (e.g. 
 http://matplotlib.org/users/plotting/examples/demo_gridspec01.png or 
 http://matplotlib.org/users/tight_layout_guide.html or ) and a lot of 
 google search results.
 best regards
 christian
 --
 Live Security Virtual Conference
 Exclusive live event will cover all the ways today's security and
 threat landscape has changed and how IT managers can respond. Discussions
 will include endpoint security, mobile security and the latest in malware
 threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] broken links at github

2012-09-17 Thread Christian.Strobl


thanks for your fast help. the links for the image tutorial are working already 
again.


On Sep 17, 2012, at 11:53 PM, Michael Droettboom wrote:

 Thanks for pointing this out.  I'll get to the bottom of it.
 
 Mike
 
 On 09/17/2012 05:16 PM, christian.str...@dlr.de wrote:
 hi all,
 a lot of links at the github repository are broken. for example all the 
 links to png, source code, ... of the image tutorial 
 (http://matplotlib.org/users/image_tutorial.html). but also links of other 
 pages are broken (e.g. 
 http://matplotlib.org/users/plotting/examples/demo_gridspec01.png or 
 http://matplotlib.org/users/tight_layout_guide.html or ) and a lot of 
 google search results.
 best regards
 christian
 --
 Live Security Virtual Conference
 Exclusive live event will cover all the ways today's security and
 threat landscape has changed and how IT managers can respond. Discussions
 will include endpoint security, mobile security and the latest in malware
 threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users
 
 
 --
 Live Security Virtual Conference
 Exclusive live event will cover all the ways today's security and 
 threat landscape has changed and how IT managers can respond. Discussions 
 will include endpoint security, mobile security and the latest in malware 
 threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] broken links at github

2012-09-17 Thread Michael Droettboom
Thanks.  I believe it should all be fixed now.

On 09/17/2012 06:33 PM, christian.str...@dlr.de wrote:

 thanks for your fast help. the links for the image tutorial are working 
 already again.


 On Sep 17, 2012, at 11:53 PM, Michael Droettboom wrote:

 Thanks for pointing this out.  I'll get to the bottom of it.

 Mike

 On 09/17/2012 05:16 PM, christian.str...@dlr.de wrote:
 hi all,
 a lot of links at the github repository are broken. for example all the 
 links to png, source code, ... of the image tutorial 
 (http://matplotlib.org/users/image_tutorial.html). but also links of other 
 pages are broken (e.g. 
 http://matplotlib.org/users/plotting/examples/demo_gridspec01.png or 
 http://matplotlib.org/users/tight_layout_guide.html or ) and a lot of 
 google search results.
 best regards
 christian
 --
 Live Security Virtual Conference
 Exclusive live event will cover all the ways today's security and
 threat landscape has changed and how IT managers can respond. Discussions
 will include endpoint security, mobile security and the latest in malware
 threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

 --
 Live Security Virtual Conference
 Exclusive live event will cover all the ways today's security and
 threat landscape has changed and how IT managers can respond. Discussions
 will include endpoint security, mobile security and the latest in malware
 threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users