Falling over the edge of the world

Dear Jeff & ALL,

When trying to plot a set of points in Basemap using an
Equirectangular projection centered on a longitude different from the
default (using the parameter lon_0 to generate a map centered on the
desired longitude), I end up with a stange plot like the one attached
to this message (ie., all the points are plotted "over the edge of the
world"). Has Basemap been taught about the sphericity of the Earth?
(just a joke!)

N.B. This happens no matter if I call ax.cla() (where ax is an
instance of figure.axes) and reload all the dataset after changing the
longitude.

Any hints?

With warmest regards,

image.png

···

--
Dr. Mauro J. Cavalcanti
Ecoinformatics Studio
P.O. Box 46521, CEP 20551-970
Rio de Janeiro, RJ, BRASIL
E-mail: maurobio@...287...
Web: http://studio.infobio.net
Linux Registered User #473524 * Ubuntu User #22717
"Life is complex. It consists of real and imaginary parts."

Mauro Cavalcanti wrote:

Dear Jeff & ALL,

When trying to plot a set of points in Basemap using an
Equirectangular projection centered on a longitude different from the
default (using the parameter lon_0 to generate a map centered on the
desired longitude), I end up with a stange plot like the one attached
to this message (ie., all the points are plotted "over the edge of the
world"). Has Basemap been taught about the sphericity of the Earth?
(just a joke!)

N.B. This happens no matter if I call ax.cla() (where ax is an
instance of figure.axes) and reload all the dataset after changing the
longitude.

Any hints?
  
Mauro: Say you create a cylindrical basemap with lon_0=180. The longitudinal extent of the map will be lon=0 to lon=360. If you then plot a point with a longitude of -60, it will be off the map to the left (similar to what your example plot shows). The solution is to renormalize the longitudes of the points your are plotting to be within 0 and 360 (by adding 360 if the longitude is negative).

-Jeff

···

With warmest regards,

------------------------------------------------------------------------

------------------------------------------------------------------------

------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you. Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
------------------------------------------------------------------------

_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options
  
--
Jeffrey S. Whitaker Phone : (303)497-6313
Meteorologist FAX : (303)497-6449
NOAA/OAR/PSD R/PSD1 Email : Jeffrey.S.Whitaker@...259...
325 Broadway Office : Skaggs Research Cntr 1D-113
Boulder, CO, USA 80303-3328 Web : Jeffrey S. Whitaker: NOAA Physical Sciences Laboratory

Dear Jeff,

2008/12/17 Jeff Whitaker <jswhit@...146...>:

Mauro: Say you create a cylindrical basemap with lon_0=180. The
longitudinal extent of the map will be lon=0 to lon=360. If you then plot a
point with a longitude of -60, it will be off the map to the left (similar
to what your example plot shows). The solution is to renormalize the
longitudes of the points your are plotting to be within 0 and 360 (by adding
360 if the longitude is negative).

Thanks for the explanation -- it is obvious in retrospect! (Have to
find the nearest wall...).

With best regards,

···

--
Dr. Mauro J. Cavalcanti
Ecoinformatics Studio
P.O. Box 46521, CEP 20551-970
Rio de Janeiro, RJ, BRASIL
E-mail: maurobio@...287...
Web: http://studio.infobio.net
Linux Registered User #473524 * Ubuntu User #22717
"Life is complex. It consists of real and imaginary parts."