UltraPlot UltraPlot UltraPlot
  • Why UltraPlot?
  • Gallery
  • Installation guide
  • Usage
  • API
  • GitHub
  • Discussions
/

Getting Started

  • Installation
  • Why UltraPlot?
  • Using UltraPlot
  • UltraPlot Gallery

User Guide

  • The basics
  • Subplots
  • Cartesian axes
  • Networks
  • Geographic and polar axes
  • Colorbars and legends
  • Insets and panels
  • 1D plotting commands
  • 2D plotting commands
  • Statistical plotting
  • Colormaps
  • Color cycles
  • Color names
  • Font selection
  • Configuring UltraPlot

Reference

  • API reference
    • Figure
    • GridSpec
    • SubplotGrid
    • Axes
    • PlotAxes
    • CartesianAxes
    • PolarAxes
    • TaylorAxes
    • GeoAxes
    • ThreeAxes
    • ExternalAxesContainer
    • figure
    • subplot
    • subplots
    • show
    • close
    • switch_backend
    • ion
    • ioff
    • isinteractive
    • Configurator
    • rc
    • rc_ultraplot
    • rc_matplotlib
    • use_style
    • config_inline_backend
    • register_cmaps
    • register_cycles
    • register_colors
    • register_fonts
    • Proj
    • Locator
    • Formatter
    • Scale
    • Colormap
    • Norm
    • Cycle
    • IndexLocator
    • DiscreteLocator
    • DegreeLocator
    • LongitudeLocator
    • LatitudeLocator
    • AutoFormatter
    • SimpleFormatter
    • IndexFormatter
    • SciFormatter
    • SigFigFormatter
    • FracFormatter
    • CFDatetimeFormatter
    • AutoCFDatetimeFormatter
    • AutoCFDatetimeLocator
    • DegreeFormatter
    • LongitudeFormatter
    • LatitudeFormatter
    • CutoffScale
    • ExpScale
    • FuncScale
    • InverseScale
    • LinearScale
    • LogitScale
    • LogScale
    • MercatorLatitudeScale
    • PowerScale
    • SineLatitudeScale
    • SymmetricalLogScale
    • DiscreteColormap
    • ContinuousColormap
    • PerceptualColormap
    • DiscreteNorm
    • DivergingNorm
    • SegmentedNorm
    • ColorDatabase
    • ColormapDatabase
    • Aitoff
    • Hammer
    • KavrayskiyVII
    • WinkelTripel
    • NorthPolarAzimuthalEquidistant
    • SouthPolarAzimuthalEquidistant
    • NorthPolarGnomonic
    • SouthPolarGnomonic
    • NorthPolarLambertAzimuthalEqualArea
    • SouthPolarLambertAzimuthalEqualArea
    • show_cmaps
    • show_channels
    • show_colors
    • show_colorspaces
    • show_cycles
    • show_fonts
    • align_text
    • arange
    • edges
    • edges2d
    • get_colors
    • set_hue
    • set_saturation
    • set_luminance
    • set_alpha
    • shift_hue
    • scale_saturation
    • scale_luminance
    • to_hex
    • to_rgb
    • to_xyz
    • to_rgba
    • to_xyza
    • units
  • Lazy Loading and Adding New Modules
  • External links
  • What’s new?
  • How to contribute?
  • About UltraPlot

On this page

  • set_alpha()
  1. UltraPlot /
  2. API reference /
  3. set_alpha
View Source Open in ChatGPT Open in Claude

set_alpha#

set_alpha(color, alpha)[source]#

Return a color with the opacity channel set to the specified value.

Parameters:
  • color (color-spec) – The color. Sanitized with to_rgba.

  • alpha (float, optional) – The new opacity. Should be between 0 and 1.

Returns:

color (str) – An 8-digit HEX string indicating the red, green, blue, and alpha channel values.

See also

set_hue, set_saturation, set_luminance, shift_hue, scale_saturation, scale_luminance

Previous
set_luminance
Next
shift_hue

2026, UltraPlot

Made with Sphinx and Shibuya theme.