diff --git a/altair/__init__.py b/altair/__init__.py index 8eb8bca36..7079e8ccc 100644 --- a/altair/__init__.py +++ b/altair/__init__.py @@ -1,5 +1,5 @@ # flake8: noqa -__version__ = "4.2.0rc1" +__version__ = "4.2.0" from .vegalite import * from . import examples diff --git a/altair/examples/line_with_log_scale.py b/altair/examples/line_with_log_scale.py index a47cd40cd..b45fcd92e 100644 --- a/altair/examples/line_with_log_scale.py +++ b/altair/examples/line_with_log_scale.py @@ -1,7 +1,7 @@ """ Line Chart with Logarithmic Scale --------------------------------- -How to make a line chart on a ` https://en.wikipedia.org/wiki/Logarithmic_scale`_. +How to make a line chart on a `Logarithmic scale `_. """ # category: line charts import altair as alt diff --git a/altair/examples/pyramid.py b/altair/examples/pyramid.py new file mode 100644 index 000000000..a53b90e05 --- /dev/null +++ b/altair/examples/pyramid.py @@ -0,0 +1,19 @@ +""" +Pyramid Pie Chart +----------------- +Altair reproduction of http://robslink.com/SAS/democd91/pyramid_pie.htm +""" +import altair as alt +import pandas as pd + +category = ['Sky', 'Shady side of a pyramid', 'Sunny side of a pyramid'] +color = ["#416D9D", "#674028", "#DEAC58"] +df = pd.DataFrame({'category': category, 'value': [75, 10, 15]}) + +alt.Chart(df).mark_arc(outerRadius=80).encode( + alt.Theta('value:Q', scale=alt.Scale(range=[2.356, 8.639])), + alt.Color('category:N', + scale=alt.Scale(domain=category, range=color), + legend=alt.Legend(title=None, orient='none', legendX=160, legendY=50)), + order='value:Q' +).properties(width=150, height=150).configure_view(strokeOpacity=0) \ No newline at end of file diff --git a/altair/utils/html.py b/altair/utils/html.py index 301e9e41c..1aa507e9c 100644 --- a/altair/utils/html.py +++ b/altair/utils/html.py @@ -85,6 +85,7 @@ """