adjust fig size
Browse files
app.py
CHANGED
@@ -308,7 +308,7 @@ def calculate_bar(user_county,user_parents,user_children,user_income,user_housin
|
|
308 |
new_df = new_df.sort_values('remaining_money',ascending=False).reset_index(drop=True)
|
309 |
#New code:
|
310 |
new_df = new_df[:result_count]
|
311 |
-
fig = Figure(figsize=(result_count,
|
312 |
ax = fig.add_subplot(111)
|
313 |
ax = new_df.median_monthly_family_income.plot.bar(width=0.4, position=1, ax=ax, color='mediumseagreen')
|
314 |
ax = new_df[['housing', 'food','transportation','healthcare','childcare','other_necessities','taxes']].plot.bar(stacked=True, width=0.4, position=0, ax=ax, cmap='Accent', alpha=.75)
|
@@ -321,7 +321,7 @@ def calculate_bar(user_county,user_parents,user_children,user_income,user_housin
|
|
321 |
return fig
|
322 |
|
323 |
def nothing_fig():
|
324 |
-
fig = Figure(figsize=(
|
325 |
ax = fig.add_subplot(111)
|
326 |
return fig
|
327 |
|
@@ -374,8 +374,7 @@ main3 = pn.Card(
|
|
374 |
main4 = pn.Card(
|
375 |
bar_result,
|
376 |
title='Most Affordable Counties, bar chart',
|
377 |
-
styles={'background':'WhiteSmoke'}
|
378 |
-
collapsed=True
|
379 |
)
|
380 |
template.main.append(
|
381 |
pn.Column(main1,main2,main3,main4)
|
|
|
308 |
new_df = new_df.sort_values('remaining_money',ascending=False).reset_index(drop=True)
|
309 |
#New code:
|
310 |
new_df = new_df[:result_count]
|
311 |
+
fig = Figure(figsize=(result_count,2.5))
|
312 |
ax = fig.add_subplot(111)
|
313 |
ax = new_df.median_monthly_family_income.plot.bar(width=0.4, position=1, ax=ax, color='mediumseagreen')
|
314 |
ax = new_df[['housing', 'food','transportation','healthcare','childcare','other_necessities','taxes']].plot.bar(stacked=True, width=0.4, position=0, ax=ax, cmap='Accent', alpha=.75)
|
|
|
321 |
return fig
|
322 |
|
323 |
def nothing_fig():
|
324 |
+
fig = Figure(figsize=(2,2))
|
325 |
ax = fig.add_subplot(111)
|
326 |
return fig
|
327 |
|
|
|
374 |
main4 = pn.Card(
|
375 |
bar_result,
|
376 |
title='Most Affordable Counties, bar chart',
|
377 |
+
styles={'background':'WhiteSmoke'}
|
|
|
378 |
)
|
379 |
template.main.append(
|
380 |
pn.Column(main1,main2,main3,main4)
|