Code for two graphs. Ran this code a couple of times, and for some reason all that's showing up is the histogram. It's also important to mention that I am using Spyder IDE as well, if that makes any difference. Oh....and I've also tried graph|hist... but nothing
import altair as alt
import pandas as pd
#import csv
acs = pd.read_csv('C:/Users/Andrew/anaconda3/mydata/acs2020.csv')
acs.head()
interval = alt.selection_interval()
#build point graph
graph = alt.Chart(acs).mark_point(opacity=1).encode(
x = ('Trade #'),
y = ('Balance'),
color = alt.Color('Item',scale=alt.Scale(scheme='tableau10')),
tooltip = [alt.Tooltip('Type'),
alt.Tooltip('Profit'),
alt.Tooltip('Ticket:N')
]
).properties(
width = 900
)
#build histogram
hist = alt.Chart(acs).mark_bar().encode(
x = 'count()',
y = 'Item',
color = 'Item'
).properties(
width = 800,
height = 80
).add_selection(
interval
)
#show graphs
graph&hist.show()