@@ -1978,11 +1978,10 @@ def colormaps():
1978
1978
1979
1979
def _setup_pyplot_info_docstrings ():
1980
1980
"""
1981
- Generate the plotting docstring .
1981
+ Setup the docstring of ` plotting` and of the colormap-setting functions .
1982
1982
1983
- These must be done after the entire module is imported, so it is
1984
- called from the end of this module, which is generated by
1985
- boilerplate.py.
1983
+ These must be done after the entire module is imported, so it is called
1984
+ from the end of this module, which is generated by boilerplate.py.
1986
1985
"""
1987
1986
commands = get_plot_commands ()
1988
1987
@@ -2018,6 +2017,15 @@ def _setup_pyplot_info_docstrings():
2018
2017
]
2019
2018
plotting .__doc__ = '\n ' .join (lines )
2020
2019
2020
+ for cm_name in colormaps ():
2021
+ if cm_name in globals ():
2022
+ globals ()[cm_name ].__doc__ = f"""
2023
+ Set the colormap to { cm_name !r} .
2024
+
2025
+ This changes the default colormap as well as the colormap of the current
2026
+ image if there is one. See ``help(colormaps)`` for more information.
2027
+ """
2028
+
2021
2029
2022
2030
## Plotting part 1: manually generated functions and wrappers ##
2023
2031
@@ -2979,211 +2987,25 @@ def yscale(value, **kwargs):
2979
2987
2980
2988
2981
2989
# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
2982
- def autumn ():
2983
- """
2984
- Set the colormap to "autumn".
2985
-
2986
- This changes the default colormap as well as the colormap of the current
2987
- image if there is one. See ``help(colormaps)`` for more information.
2988
- """
2989
- set_cmap ("autumn" )
2990
-
2991
-
2992
- # Autogenerated by boilerplate.py. Do not edit as changes will be lost.
2993
- def bone ():
2994
- """
2995
- Set the colormap to "bone".
2996
-
2997
- This changes the default colormap as well as the colormap of the current
2998
- image if there is one. See ``help(colormaps)`` for more information.
2999
- """
3000
- set_cmap ("bone" )
2990
+ def autumn (): set_cmap ( 'autumn' )
2991
+ def bone (): set_cmap ( 'bone' )
2992
+ def cool (): set_cmap ( 'cool' )
2993
+ def copper (): set_cmap ( 'copper' )
2994
+ def flag (): set_cmap ( 'flag' )
2995
+ def gray (): set_cmap ( 'gray' )
2996
+ def hot (): set_cmap ( 'hot' )
2997
+ def hsv (): set_cmap ('hsv' )
2998
+ def jet (): set_cmap ( 'jet' )
2999
+ def pink (): set_cmap ( 'pink' )
3000
+ def prism (): set_cmap ( 'prism' )
3001
+ def spring (): set_cmap ( 'spring' )
3002
+ def summer (): set_cmap ( 'summer' )
3003
+ def winter (): set_cmap ( 'winter' )
3004
+ def magma (): set_cmap ( 'magma' )
3005
+ def inferno (): set_cmap ( 'inferno' )
3006
+ def plasma (): set_cmap ( 'plasma' )
3007
+ def viridis (): set_cmap ( 'viridis' )
3008
+ def nipy_spectral (): set_cmap ('nipy_spectral' )
3001
3009
3002
3010
3003
- # Autogenerated by boilerplate.py. Do not edit as changes will be lost.
3004
- def cool ():
3005
- """
3006
- Set the colormap to "cool".
3007
-
3008
- This changes the default colormap as well as the colormap of the current
3009
- image if there is one. See ``help(colormaps)`` for more information.
3010
- """
3011
- set_cmap ("cool" )
3012
-
3013
-
3014
- # Autogenerated by boilerplate.py. Do not edit as changes will be lost.
3015
- def copper ():
3016
- """
3017
- Set the colormap to "copper".
3018
-
3019
- This changes the default colormap as well as the colormap of the current
3020
- image if there is one. See ``help(colormaps)`` for more information.
3021
- """
3022
- set_cmap ("copper" )
3023
-
3024
-
3025
- # Autogenerated by boilerplate.py. Do not edit as changes will be lost.
3026
- def flag ():
3027
- """
3028
- Set the colormap to "flag".
3029
-
3030
- This changes the default colormap as well as the colormap of the current
3031
- image if there is one. See ``help(colormaps)`` for more information.
3032
- """
3033
- set_cmap ("flag" )
3034
-
3035
-
3036
- # Autogenerated by boilerplate.py. Do not edit as changes will be lost.
3037
- def gray ():
3038
- """
3039
- Set the colormap to "gray".
3040
-
3041
- This changes the default colormap as well as the colormap of the current
3042
- image if there is one. See ``help(colormaps)`` for more information.
3043
- """
3044
- set_cmap ("gray" )
3045
-
3046
-
3047
- # Autogenerated by boilerplate.py. Do not edit as changes will be lost.
3048
- def hot ():
3049
- """
3050
- Set the colormap to "hot".
3051
-
3052
- This changes the default colormap as well as the colormap of the current
3053
- image if there is one. See ``help(colormaps)`` for more information.
3054
- """
3055
- set_cmap ("hot" )
3056
-
3057
-
3058
- # Autogenerated by boilerplate.py. Do not edit as changes will be lost.
3059
- def hsv ():
3060
- """
3061
- Set the colormap to "hsv".
3062
-
3063
- This changes the default colormap as well as the colormap of the current
3064
- image if there is one. See ``help(colormaps)`` for more information.
3065
- """
3066
- set_cmap ("hsv" )
3067
-
3068
-
3069
- # Autogenerated by boilerplate.py. Do not edit as changes will be lost.
3070
- def jet ():
3071
- """
3072
- Set the colormap to "jet".
3073
-
3074
- This changes the default colormap as well as the colormap of the current
3075
- image if there is one. See ``help(colormaps)`` for more information.
3076
- """
3077
- set_cmap ("jet" )
3078
-
3079
-
3080
- # Autogenerated by boilerplate.py. Do not edit as changes will be lost.
3081
- def pink ():
3082
- """
3083
- Set the colormap to "pink".
3084
-
3085
- This changes the default colormap as well as the colormap of the current
3086
- image if there is one. See ``help(colormaps)`` for more information.
3087
- """
3088
- set_cmap ("pink" )
3089
-
3090
-
3091
- # Autogenerated by boilerplate.py. Do not edit as changes will be lost.
3092
- def prism ():
3093
- """
3094
- Set the colormap to "prism".
3095
-
3096
- This changes the default colormap as well as the colormap of the current
3097
- image if there is one. See ``help(colormaps)`` for more information.
3098
- """
3099
- set_cmap ("prism" )
3100
-
3101
-
3102
- # Autogenerated by boilerplate.py. Do not edit as changes will be lost.
3103
- def spring ():
3104
- """
3105
- Set the colormap to "spring".
3106
-
3107
- This changes the default colormap as well as the colormap of the current
3108
- image if there is one. See ``help(colormaps)`` for more information.
3109
- """
3110
- set_cmap ("spring" )
3111
-
3112
-
3113
- # Autogenerated by boilerplate.py. Do not edit as changes will be lost.
3114
- def summer ():
3115
- """
3116
- Set the colormap to "summer".
3117
-
3118
- This changes the default colormap as well as the colormap of the current
3119
- image if there is one. See ``help(colormaps)`` for more information.
3120
- """
3121
- set_cmap ("summer" )
3122
-
3123
-
3124
- # Autogenerated by boilerplate.py. Do not edit as changes will be lost.
3125
- def winter ():
3126
- """
3127
- Set the colormap to "winter".
3128
-
3129
- This changes the default colormap as well as the colormap of the current
3130
- image if there is one. See ``help(colormaps)`` for more information.
3131
- """
3132
- set_cmap ("winter" )
3133
-
3134
-
3135
- # Autogenerated by boilerplate.py. Do not edit as changes will be lost.
3136
- def magma ():
3137
- """
3138
- Set the colormap to "magma".
3139
-
3140
- This changes the default colormap as well as the colormap of the current
3141
- image if there is one. See ``help(colormaps)`` for more information.
3142
- """
3143
- set_cmap ("magma" )
3144
-
3145
-
3146
- # Autogenerated by boilerplate.py. Do not edit as changes will be lost.
3147
- def inferno ():
3148
- """
3149
- Set the colormap to "inferno".
3150
-
3151
- This changes the default colormap as well as the colormap of the current
3152
- image if there is one. See ``help(colormaps)`` for more information.
3153
- """
3154
- set_cmap ("inferno" )
3155
-
3156
-
3157
- # Autogenerated by boilerplate.py. Do not edit as changes will be lost.
3158
- def plasma ():
3159
- """
3160
- Set the colormap to "plasma".
3161
-
3162
- This changes the default colormap as well as the colormap of the current
3163
- image if there is one. See ``help(colormaps)`` for more information.
3164
- """
3165
- set_cmap ("plasma" )
3166
-
3167
-
3168
- # Autogenerated by boilerplate.py. Do not edit as changes will be lost.
3169
- def viridis ():
3170
- """
3171
- Set the colormap to "viridis".
3172
-
3173
- This changes the default colormap as well as the colormap of the current
3174
- image if there is one. See ``help(colormaps)`` for more information.
3175
- """
3176
- set_cmap ("viridis" )
3177
-
3178
-
3179
- # Autogenerated by boilerplate.py. Do not edit as changes will be lost.
3180
- def nipy_spectral ():
3181
- """
3182
- Set the colormap to "nipy_spectral".
3183
-
3184
- This changes the default colormap as well as the colormap of the current
3185
- image if there is one. See ``help(colormaps)`` for more information.
3186
- """
3187
- set_cmap ("nipy_spectral" )
3188
-
3189
3011
_setup_pyplot_info_docstrings ()
0 commit comments