@@ -111,6 +111,7 @@ def plot_pixel_list(pixels: List[HealpixPixel], plot_title: str = "", projection
111
111
112
112
def plot_moc (
113
113
moc : MOC ,
114
+ * ,
114
115
projection : str = "MOL" ,
115
116
title : str = "" ,
116
117
fov : Quantity | Tuple [Quantity , Quantity ] = None ,
@@ -161,7 +162,7 @@ def plot_moc(
161
162
frame_class = frame_class ,
162
163
ax = ax ,
163
164
fig = fig ,
164
- fig_size = (9 , 5 ),
165
+ figsize = (9 , 5 ),
165
166
)
166
167
167
168
mocpy_args = {"alpha" : 0.5 , "fill" : True , "color" : "teal" }
@@ -440,6 +441,7 @@ def plot_healpix_map(
440
441
frame_class = frame_class ,
441
442
ax = ax ,
442
443
fig = fig ,
444
+ figsize = (10 , 5 ),
443
445
)
444
446
445
447
_plot_healpix_value_map (ipix , depth , healpix_map , ax , wcs , cmap = cmap , norm = norm , cbar = cbar , ** kwargs )
@@ -458,15 +460,34 @@ def initialize_wcs_axes(
458
460
frame_class : Type [BaseFrame ] | None = None ,
459
461
ax : WCSAxes | None = None ,
460
462
fig : Figure | None = None ,
461
- fig_size = None ,
463
+ ** kwargs ,
462
464
):
465
+ """Initializes matplotlib Figure and WCSAxes if they do not exist
466
+
467
+ Args:
468
+ projection (str): The projection to use in the WCS. Available projections listed at
469
+ https://docs.astropy.org/en/stable/wcs/supported_projections.html
470
+ fov (Quantity or Sequence[Quantity, Quantity] | None): The Field of View of the WCS. Must be an
471
+ astropy Quantity with an angular unit, or a tuple of quantities for different longitude and \
472
+ latitude FOVs (Default covers the full sky)
473
+ center (SkyCoord | None): The center of the projection in the WCS (Default: SkyCoord(0, 0))
474
+ wcs (WCS | None): The WCS to specify the projection of the plot. If used, all other WCS parameters
475
+ are ignored and the parameters from the WCS object is used.
476
+ frame_class (Type[BaseFrame] | None): The class of the frame for the WCSAxes to be initialized with.
477
+ if the `ax` kwarg is used, this value is ignored (By Default uses EllipticalFrame for full
478
+ sky projection. If FOV is set, RectangularFrame is used)
479
+ ax (WCSAxes | None): The matplotlib axes to plot onto. If None, an axes will be created to be used. If
480
+ specified, the axes must be an astropy WCSAxes, and the `wcs` parameter must be set with the WCS
481
+ object used in the axes. (Default: None)
482
+ fig (Figure | None): The matplotlib figure to add the axes to. If None, one will be created, unless
483
+ ax is specified (Default: None)
484
+ kwargs: additional kwargs to pass to figure initialization
485
+ """
463
486
if fig is None :
464
487
if ax is not None :
465
488
fig = ax .get_figure ()
466
489
else :
467
- if fig_size is None :
468
- fig_size = (10 , 5 )
469
- fig = plt .figure (figsize = fig_size )
490
+ fig = plt .figure (** kwargs )
470
491
if frame_class is None and fov is None and wcs is None :
471
492
frame_class = EllipticalFrame
472
493
if fov is None :
0 commit comments