# [AstroPy] Oblique rectangles in APLpy

Thomas Robitaille thomas.robitaille at gmail.com
Sun Jun 5 10:11:17 EDT 2011

```Hi JB,

The polygon has to be expressed as a 2xN numpy array:

polygon = np.array([[RaMin, RaMin, RaMax, RaMax],[DecMin, DecMax, DecMax, DecMin]])

and show_polygons takes a list of polygons

f.show_polygons([polygon])

Let me know if this doesn't work for you

Cheers,
Tom

On Sunday, June 5, 2011 at 9:59 AM, Jean-Baptiste Marquette wrote:

> Hi Tom,
>
> I don't find the correct syntax for the coordinates of the corners.
>
>  Polygon = [[RaMin, DecMin], [RaMin, DecMax], [RaMax, DecMin], [RaMax, DecMax]]
>
> doesn't work.
>
> Please give an example.
>
> Cheers
> JB
>
> Le 31 mai 2011 à 02:57, Thomas Robitaille a écrit :
>
> > Hi Jean-Baptiste,
> >
> > The easiest way to do this would be to figure out the coordinates of the corners of the rectangles in Galactic coordinates, and use show_polygons to plot them. Note that you can use the fk52gal function in aplpy.wcs_util to facilitate the conversion from J2000 to Galactic coordinates. Let me know if this does not work!
> >
> > Cheers,
> > Tom
> >
> >
> >
> > On Monday, May 30, 2011 at 6:51 AM, Marquette Jean-Baptiste wrote:
> >
> > > Dear APLpy gurus,
> > >
> > > I have observational rectangle fields with J2000 coordinates I would
> > > like to plot on images in galactic coordinates. But the
> > > show_rectangles routine doesn't allow to plot those rectangles
> > > obliquely.
> > > Any hint welcome.
> > >
> > > Cheers
> > > Jean-Baptiste Marquette
> > > _______________________________________________
> > > AstroPy mailing list
> > > AstroPy at scipy.org (mailto:AstroPy at scipy.org)
> > > http://mail.scipy.org/mailman/listinfo/astropy

```

More information about the AstroPy mailing list