Skip to main content
How are we doing? Please help us improve Stack Overflow. Take our short survey

Questions tagged [altair]

Altair is a declarative statistical visualization library for Python, based on Vega-Lite. It provides a high-level API for creating complex visualizations with minimal code. Please include code and sample data in your question.

1 vote
2 answers
1k views

Add data labels to vega-lite bar chart

I have a rather simple bar chart, created with the Python altair library, based on a Pandas DataFrame. The code to generate the chart is: Chart(df).configure(background='white').mark_bar().encode( ...
DocZerø's user avatar
  • 8,437
8 votes
1 answer
9k views

How to do annotations with Altair

I am trying to write some text inside the figure to highlight something in my plot (equivalent to 'annotate' in matplotlib). Any idea? Thanks
Yiti's user avatar
  • 281
14 votes
2 answers
17k views

How to create a grouped bar chart in Altair?

How does one create a grouped bar chart in Altair? I'm trying the following but it is just producing two graphs side by side. Chart(data).mark_bar().encode( column='Gender', x='Genre', y='...
Kris's user avatar
  • 341
3 votes
1 answer
696 views

Python+Altair (Vega-Lite): Web server

I want to visualize some graphs on web pages using Python 2.7.12 and Altair 1.2.0. Using their examples it is easy and straightforward: from altair import * from altair import Chart, load_dataset # ...
Alex Poca's user avatar
  • 2,516
3 votes
2 answers
1k views

saving figures in python altair

I am trying to save altair figures in html any graphic format (png, svg). HTML. The figures in html are not displayed. A blank page PNG. The documentations says I need canvas package and provides a ...
Dima Lituiev's user avatar
9 votes
1 answer
2k views

How to shade a region with Altair

I am trying to shade different regions in my plot created with Altair (like axvspan in matplotlib) but can't find a way to do it. Chart(data).mark_line(color='r').encode( x=X('Voltage'), y=Y(...
Yiti's user avatar
  • 281
2 votes
1 answer
2k views

python altair line chart cut off by count

I am currently trying to cut off a line chart in Altair. My code so far is: Chart(orient_frame).mark_line().encode( x = X('year:O'), y = Y('count(type:N)', scale=Scale(domain=(0,2500)), ...
habet's user avatar
  • 146
2 votes
2 answers
1k views

[Python+Altair (Vega-lite)]: Streamgraph from excel-like Pandas' Dataframe

I have a Pandas' Dataframe I would like to visualize using Altair, but it looks like the library syntax is yet above my skills: Time WL1 WL2 WL3 WL4 0 2017-04-05 ...
Alex Poca's user avatar
  • 2,516
4 votes
1 answer
269 views

Vegalite daily line chart wobble

I've run into an issue with vegalite whereby charts exhibit a 'wobbling line' when the line should be straight, and dates are not equally spaced. Can anyone verify that this is a bug, or am I making ...
RobinL's user avatar
  • 11.4k
2 votes
2 answers
3k views

Cumulative count with altair

I'm trying to plot data with a date as the X axis and several cumulative counts as Ys. I have a set of items such as: id1 date1 user1 id2 date2 user1 id3 date3 user2 With this example, I'd want the ...
Sildar's user avatar
  • 302
8 votes
1 answer
6k views

Overlaying vertical lines onto a plot in Altair

I have a data frame df which looks like this: +---+------------+-----------+--------+ | | date | violation | pounds | +---+------------+-----------+--------+ | 0 | 2010-05-13 | N | ...
gogurt's user avatar
  • 831

15 30 50 per page
1
88 89 90 91
92