File: pacman_chart.py

package info (click to toggle)
python-altair 5.0.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 6,952 kB
  • sloc: python: 25,649; sh: 14; makefile: 5
file content (17 lines) | stat: -rw-r--r-- 479 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
"""
Pacman Chart
------------
Chart made using ``mark_arc`` and constant values.
This could also be made using 
``alt.Chart(source).mark_arc(color = "gold", theta = (5/8)*np.pi, theta2 = (19/8)*np.pi,radius=100)``.
"""
# category: circular plots

import numpy as np
import altair as alt

alt.Chart().mark_arc(color="gold").encode(
    theta=alt.ThetaDatum((5 / 8) * np.pi).scale(None),
    theta2=alt.Theta2Datum((19 / 8) * np.pi),
    radius=alt.RadiusDatum(100).scale(None),
)