ScottScroggins commited on
Commit
6fc3c5d
·
verified ·
1 Parent(s): 896c0c7

adjust fig size

Browse files
Files changed (1) hide show
  1. app.py +3 -4
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,3))
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=(5,4))
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)