@@ -917,6 +917,7 @@ def plot(
917
917
cntrcolors = None ,
918
918
ncontours = 21 ,
919
919
savefilename = None ,
920
+ ** kwargs ,
920
921
):
921
922
"""
922
923
Plot the potential.
@@ -959,6 +960,8 @@ def plot(
959
960
Colors of the contours (single color or array with length ncontours). Default is None.
960
961
ncontours : int, optional
961
962
Number of contours when levels is None. Default is 21.
963
+ **kwargs : dict, optional
964
+ Any additional keyword arguments are passed to `galpy.util.plot.dens2d`.
962
965
963
966
Returns
964
967
-------
@@ -968,6 +971,7 @@ def plot(
968
971
-----
969
972
- 2010-07-09 - Written - Bovy (NYU)
970
973
- 2014-04-08 - Added effective= - Bovy (IAS)
974
+ - 2024-07-09 - Propagate other plotting keywords - Bovy (UofT)
971
975
972
976
"""
973
977
if effective and xy :
@@ -981,7 +985,7 @@ def plot(
981
985
xrange = [rmin , rmax ]
982
986
if yrange is None :
983
987
yrange = [zmin , zmax ]
984
- if not savefilename is None and os .path .exists (savefilename ):
988
+ if savefilename is not None and os .path .exists (savefilename ):
985
989
print ("Restoring savefile " + savefilename + " ..." )
986
990
savefile = open (savefilename , "rb" )
987
991
potRz = pickle .load (savefile )
@@ -1012,7 +1016,7 @@ def plot(
1012
1016
potRz [:, zs > zmax ] = numpy .nan
1013
1017
# Infinity is bad for plotting
1014
1018
potRz [~ numpy .isfinite (potRz )] = numpy .nan
1015
- if not savefilename == None :
1019
+ if savefilename is not None :
1016
1020
print ("Writing savefile " + savefilename + " ..." )
1017
1021
savefile = open (savefilename , "wb" )
1018
1022
pickle .dump (potRz , savefile )
@@ -1043,6 +1047,7 @@ def plot(
1043
1047
justcontours = justcontours ,
1044
1048
levels = levels ,
1045
1049
cntrcolors = cntrcolors ,
1050
+ ** kwargs ,
1046
1051
)
1047
1052
1048
1053
def plotDensity (
@@ -2766,6 +2771,7 @@ def plotPotentials(
2766
2771
justcontours = False ,
2767
2772
levels = None ,
2768
2773
cntrcolors = None ,
2774
+ ** kwargs ,
2769
2775
):
2770
2776
"""
2771
2777
Plot a set of potentials.
@@ -2812,6 +2818,8 @@ def plotPotentials(
2812
2818
Save to or restore from this savefile (pickle). Default is None.
2813
2819
aspect : float, optional
2814
2820
Aspect ratio of the plot. Default is None.
2821
+ **kwargs : dict, optional
2822
+ Any additional keyword arguments are passed to `galpy.util.plot.dens2d`.
2815
2823
2816
2824
Returns
2817
2825
-------
@@ -2820,6 +2828,7 @@ def plotPotentials(
2820
2828
Notes
2821
2829
-----
2822
2830
- 2010-07-09 - Written by Bovy (NYU).
2831
+ - 2024-07-09 - Propagate keyword arguments to `galpy.util.plot.dens2d` - Bovy (UofT)
2823
2832
2824
2833
See Also
2825
2834
--------
@@ -2838,7 +2847,7 @@ def plotPotentials(
2838
2847
xrange = [rmin , rmax ]
2839
2848
if yrange is None :
2840
2849
yrange = [zmin , zmax ]
2841
- if not savefilename == None and os .path .exists (savefilename ):
2850
+ if savefilename is not None and os .path .exists (savefilename ):
2842
2851
print ("Restoring savefile " + savefilename + " ..." )
2843
2852
savefile = open (savefilename , "rb" )
2844
2853
potRz = pickle .load (savefile )
@@ -2869,7 +2878,7 @@ def plotPotentials(
2869
2878
potRz [:, zs > zmax ] = numpy .nan
2870
2879
# Infinity is bad for plotting
2871
2880
potRz [~ numpy .isfinite (potRz )] = numpy .nan
2872
- if not savefilename == None :
2881
+ if savefilename is not None :
2873
2882
print ("Writing savefile " + savefilename + " ..." )
2874
2883
savefile = open (savefilename , "wb" )
2875
2884
pickle .dump (potRz , savefile )
@@ -2902,6 +2911,7 @@ def plotPotentials(
2902
2911
justcontours = justcontours ,
2903
2912
levels = levels ,
2904
2913
cntrcolors = cntrcolors ,
2914
+ ** kwargs ,
2905
2915
)
2906
2916
2907
2917
0 commit comments