Skip to main content
v2.2

Polar Heatmap

Polar Heatmap SeriesPolar Heatmap Series
import lightningchart as lc

# Set your license key here
lc.set_license('my-license-key')

chart = lc.PolarChart(theme=lc.Themes.Light, title="Polar Heatmap")

# Add a Heatmap series to the polar chart
heatmap_series = chart.add_heatmap_series(sectors=4, annuli=3)

# Define the intensity values for the heatmap in a 3x4 matrix format
intensity_values = [
[0, 1, 2, 3], # first annulus (ring)
[4, 5, 6, 7], # second annulus (ring)
[8, 9, 10, 11] # third annulus (ring)
]

# Apply the intensity values from the first sector and annulus
heatmap_series.invalidate_intensity_values(values=intensity_values, i_annulus=0, i_sector=0)

# Set the color palette for the heatmap:
heatmap_series.set_palette_coloring(
steps=[
{'value': 0, 'color': ('purple')},
{'value': 10, 'color': ('yellow')},
{'value': 11, 'color': ('red')},
],
look_up_property='value', # Color lookup based on intensity values
interpolate=True # Enabling smooth interpolation between colors
)

# Set the heatmap intensity interpolation method to 'bilinear' for smooth transitions between values
heatmap_series.set_intensity_interpolation('bilinear')

chart.open()