Reputation: 1751
I want to visualize non-negative data (e.g. heights or weights). Here's an example:
import pandas as pd
import altair as alt
data = pd.DataFrame({'a': list('CCCDDDEEE'),
'b': [2, 7, 4, 1, 2, 6, 8, 4, 7]})
alt.Chart(data).mark_point().encode(
x='a',
y='b'
).interactive().show()
I can interactively pan the y-axis of the chart (not possible in the static image above), but it doesn't make sense that I can go below 0. Is it possible to fix the y-axis to positive values somehow?
Upvotes: 2
Views: 286
Reputation: 86463
No, Vega-Lite & Altair don't provide any way to limit interactive axes to a particular range of values.
Upvotes: 2