SmeetPatel commited on
Commit
b92c756
·
verified ·
1 Parent(s): 2018262

set x-scale

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -48,18 +48,18 @@ Future Improvements:
48
  # This scatter plot explores the relationship between the year a building was constructed and its square footage.
49
  # Points are color-coded based on the building's operational status, with tooltips providing additional details.
50
  # Remove rows where 'Year Constructed' is missing (NaN)
51
- filtered_data = data.dropna(subset=['Year Constructed'])
52
- filtered_data = data[data['Year Constructed'] != 0]
53
 
54
  # Visualization 2: Relationship Between Year Constructed and Square Footage
55
  # This scatter plot explores the relationship between the year a building was constructed and its square footage.
56
  scatter_plot = (
57
- alt.Chart(filtered_data)
58
  .mark_circle(size=60)
59
  .encode(
60
  x=alt.X(
61
  "Year Constructed:Q",
62
- title="Year Constructed",),
 
63
  y=alt.Y("Square Footage:Q", title="Square Footage"),
64
  color=alt.Color("Bldg Status:N", title="Building Status"),
65
  tooltip=["Agency Name", "Location Name", "Year Constructed", "Square Footage", "Bldg Status"]
 
48
  # This scatter plot explores the relationship between the year a building was constructed and its square footage.
49
  # Points are color-coded based on the building's operational status, with tooltips providing additional details.
50
  # Remove rows where 'Year Constructed' is missing (NaN)
51
+
 
52
 
53
  # Visualization 2: Relationship Between Year Constructed and Square Footage
54
  # This scatter plot explores the relationship between the year a building was constructed and its square footage.
55
  scatter_plot = (
56
+ alt.Chart(data)
57
  .mark_circle(size=60)
58
  .encode(
59
  x=alt.X(
60
  "Year Constructed:Q",
61
+ title="Year Constructed",
62
+ scale=alt.Scale(domain=[1700, data['Year Constructed'].max()])),
63
  y=alt.Y("Square Footage:Q", title="Square Footage"),
64
  color=alt.Color("Bldg Status:N", title="Building Status"),
65
  tooltip=["Agency Name", "Location Name", "Year Constructed", "Square Footage", "Bldg Status"]