convert_gempak_color

metpy.plots.convert_gempak_color(c, style='psc')[source]

Convert GEMPAK color numbers into corresponding Matplotlib colors.

Takes a sequence of GEMPAK color numbers and turns them into equivalent Matplotlib colors. Various GEMPAK quirks are respected, such as treating negative values as equivalent to 0.

Parameters:
  • c (int or sequence of ints) – GEMPAK color number(s)
  • style (str, optional) – The GEMPAK ‘device’ to use to interpret color numbers. May be ‘psc’ (the default; best for a white background) or ‘xw’ (best for a black background).
Returns:

List of strings of Matplotlib colors, or a single string if only one color requested.