Hi Mario, (Sorry for the reply to a reply, but I was not on the list when the original message was posted)
This may not be useful for Basemap, but I did this with the matplotlib.projections.geo HammerAxes projection. I got it to work by subclassing that and modifying the _get_affine_transform() to negate the x-axis scale. I also seem to have had to fiddle with _set_lim_and_transforms() to account for this, though I don't remember the details. In any case, I don't know how Basemap works and whether this is helpful. Maybe as inspiration... The code is below if it helps. joey On Sep 18, 2010, at 6:02 AM, Jeff Whitaker wrote: > On 9/16/10 12:38 PM, Mario Juric wrote: >> Hi, >> I'm looking at Basemap as a backend for plotting maps of the sky in >> different projections, and so far it seems like a really good match! >> Excellent work! >> >> The only problem that I don't know how to solve is that in astronomy >> the longitude on maps typically increases from right to left (we're >> looking at the celestial sphere from the "inside"). Is there any way (or >> a trick) to make Basemap do this? >> >> Regards, class AstroHammerAxes(HammerAxes): """Astronomical hammer projection. This is just a Hammer projection with the longitude axis reversed left-right. """ name='astrohammer' def _get_affine_transform(self): """get affine transform This is cribbed from GeoAxes, but negates the xscale to put positive longitude to the left. Not sure this is actually robust. """ transform=self._get_core_transform(1) xscale,_=transform.transform_point((pi,0)) _,yscale=transform.transform_point((0,pi/2.0)) return Affine2D()\ .scale(-0.5/xscale, 0.5/yscale)\ .translate(0.5,0.5) def _set_lim_and_transforms(self): HammerAxes._set_lim_and_transforms(self) yaxis_stretch = Affine2D().scale(pi * 2.0, 1.0).translate(pi, 0.0) yaxis_space = Affine2D().scale(1.0, 1.1) yaxis_text_base = \ yaxis_stretch + \ self.transProjection + \ (yaxis_space + \ self.transAffine + \ self.transAxes) self._yaxis_text1_transform = \ yaxis_text_base + \ Affine2D().translate(-8.0, 0.0) self._yaxis_text2_transform = \ yaxis_text_base + \ Affine2D().translate(8.0, 0.0) # register the projection on import register_projection(AstroHammerAxes) ------------------------------------------------------------------------------ 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 Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users