altair Questions

2

Solved

Suppose i have the data frame below: I checked the documentation but it's only based on a single column. Reproducible code: x = np.random.normal(100,5,100) data = pd.DataFrame(x) epsilon = 10...
Braynard asked 12/3, 2020 at 7:37

3

Solved

If I use the vega dataset "disasters" and make a straightforward chart, I get some weird values for year. In Altair the code is: import altair as alt from vega_datasets import data dis=data.disa...
Tenet asked 9/3, 2019 at 22:8

2

Solved

I am trying to plot image data in altair, specifically trying to replicate face recognition example in this link from Jake VDP's book - https://jakevdp.github.io/PythonDataScienceHandbook/05.07-sup...
Cacodyl asked 1/2, 2020 at 16:43

2

Solved

Recently I am learning both Plotly express and Altair/Vega-Lite for interactive plotting. Both of them are quite impressive and I am wondering what their strengths and weaknesses are. Especially fo...
Through asked 21/1, 2020 at 16:29

1

Solved

I'm getting a TypeError: 'UndefinedType' object is not callable when running the following Altair code. import altair as alt from vega_datasets import data cars = data.cars() alt.Chart(cars).mark_...
Alleenallegation asked 14/2, 2023 at 15:34

1

I'm trying to reproduce this chart using Altair as much as I can. https://fivethirtyeight.com/wp-content/uploads/2014/04/hickey-bechdel-11.png?w=575 I'm stuck at getting the black line dividing pa...
Chain asked 10/9, 2019 at 22:23

3

Solved

Is there a way to insert a line break when displaying longer labels in Altair? d = {'source': ['short label', 'a longer label that needs a line break', 'short label', 'a longer label that needs a ...
Platy asked 4/6, 2020 at 21:55

2

Solved

Using the iris dataset we can create a simple faceted chart: import altair as alt from vega_datasets import data iris = data.iris.url alt.Chart(iris, title='Main Title').mark_bar().encode( x='pe...
Acclimate asked 29/10, 2019 at 20:1

2

Solved

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='Ratin...
Forsterite asked 5/5, 2017 at 5:47

1

Solved

I am trying to create a grouped bar chart in altair like in the answer to this question here. The particular interesting part is the "beautification: chart = Chart(df).mark_bar().encode( colu...
Epicotyl asked 2/5, 2022 at 8:44

3

When specifying a tooltip for a line chart, the tooltip only appears when hovering over points along a line, but not when hovering anywhere else along a line. This is especially problematic when us...
Portent asked 13/11, 2018 at 19:7

2

For some reason, the Y-axis while plotting with altair seems to be inverted (would expect values to go from lower (bottom) to higher (top) of the plot). Also, I would like to be able to change the ...
Accent asked 13/4, 2018 at 12:36

1

Solved

I am trying to create a bar chart with year data on x-axis. It works but the year marker on x-xais are all in vertical direction and I want to make them more readable - either horizontal or 45 degr...
Vanhoose asked 4/2, 2022 at 14:42

2

Solved

Is is possible to format the values within a tooltip for a boxplot? From this Vega documentation, it appears so, but I can't quite figure out how to do it with Altair for python from vega_datasets ...
Urissa asked 13/3, 2021 at 15:1

2

Solved

How can I order my bar chart so that it is in the order of greatest to least value? I tried the below code, but it isn't giving me the expected result. I would like the bars ordered 'b', 'a', 'c' ...
Valetudinary asked 18/10, 2018 at 15:37

3

Solved

I have a Streamlit dashboard which lets me interactively explore a t-SNE embedding using an Altair plot. I am trying to figure out how to access the metadata of the selected datum so that I can vis...
Botts asked 28/10, 2020 at 3:4

1

Solved

I would like to position an altair legend top-center. Getting it to the top is simple enough by passing legend=alt.Legend(title=None, orient="top"). I also gather that this is possible in...
Spurt asked 2/8, 2021 at 16:16

3

Solved

I would like to use the excellent altair library to create dashboards. Is there a way to create the dashboards and not show any code? I see some really nice examples here: https://altair-viz.github...
Leninism asked 14/4, 2018 at 16:50

3

Solved

How can I find the HEX representation of Altair default color palette? Every plotting tool has its strengths & weaknesses and I typically end up generating visualizations consist of Seaborn + A...
Delwin asked 3/1, 2019 at 3:18

2

Solved

How can I change the color of only some x or y-labels? For example, in the example below, I would like the y-ticks 4,5,6 and 7 to have red color, while the rest remain black.
Turfman asked 18/3, 2021 at 4:41

6

Solved

In ggplot2, it's easy to create a faceted plot with facets that span both rows and columns. Is there a "slick" way to do this in altair? facet documentation It's possible to have facets plot in a ...
Eyla asked 3/5, 2018 at 21:18

2

Solved

I'm loving Altair for creating choropleth maps! My biggest problem, however, is I cannot figure out how to change the size of the legend. I've read through the documentation and tried several thing...
Sturgis asked 31/3, 2019 at 17:23

3

It seems like you can't add a subtitle yet to a title on a graph made using the Altair Python library. I love Altair, but according to the threads I've found Altair doesn't have a subtitling capab...
Briton asked 28/7, 2019 at 19:42

1

Solved

For the example below I want to use green color scheme for exports and red for imports. When I separately create the charts everything is good, they get the color scheme I assign them. However, whe...
Transit asked 8/2, 2021 at 17:7

3

Solved

I am rendering Altair plots in Jupyter notebook (not JupyterLab) using: alt.renderers.enable('notebook') And everything works fine, however the plots are often small relative to the width of my ...
Lacerated asked 28/8, 2019 at 14:59

© 2022 - 2024 — McMap. All rights reserved.