github-actions[bot] commited on
Commit
8808c8a
·
1 Parent(s): 035a20c

Deploy from GitHub Actions

Browse files
Files changed (2) hide show
  1. analysis.py +5 -12
  2. ui/pages/sector_compare.py +0 -1
analysis.py CHANGED
@@ -3065,7 +3065,9 @@ def plot_sector_box_charts(
3065
 
3066
  bp = ax.boxplot(
3067
  [
3068
- sector_data[sector_data["Reporting_Year"] == year]["Org_Result_Value"]
 
 
3069
  for year in years
3070
  ],
3071
  labels=years, # type: ignore
@@ -3101,17 +3103,8 @@ def plot_sector_box_charts(
3101
  # Customize tick parameters
3102
  ax.tick_params(axis="both", which="both", length=0, colors=GREY40)
3103
 
3104
- # Update x-axis tick handling - removed rotation
3105
- if len(years) > 8:
3106
- # Show roughly every nth tick to get 8 or fewer ticks
3107
- n = len(years) // 8 + 1
3108
- visible_ticks = range(0, len(years), n)
3109
- visible_years = years[::n]
3110
- ax.set_xticks(visible_ticks)
3111
- ax.set_xticklabels(visible_years, ha="center", weight=500, color=GREY40)
3112
- else:
3113
- ax.set_xticks(range(len(years)))
3114
- ax.set_xticklabels(years, ha="center", weight=500, color=GREY40)
3115
 
3116
  # Add overall title
3117
  fig.suptitle(
 
3065
 
3066
  bp = ax.boxplot(
3067
  [
3068
+ sector_data[sector_data["Reporting_Year"] == year][
3069
+ "Org_Result_Value"
3070
+ ].dropna()
3071
  for year in years
3072
  ],
3073
  labels=years, # type: ignore
 
3103
  # Customize tick parameters
3104
  ax.tick_params(axis="both", which="both", length=0, colors=GREY40)
3105
 
3106
+ ax.set_xticks(range(len(years)))
3107
+ ax.set_xticklabels(years, ha="center", weight=500, color=GREY40)
 
 
 
 
 
 
 
 
 
3108
 
3109
  # Add overall title
3110
  fig.suptitle(
ui/pages/sector_compare.py CHANGED
@@ -88,7 +88,6 @@ try:
88
  st.pyplot(fig)
89
  elif chart_type == "Box and Whisker":
90
  # Add box plots
91
- st.subheader("Distribution by Sector and Year")
92
  fig, param_data, plot_data = plot_sector_box_charts(
93
  filtered_raw_df, selected_parameter
94
  )
 
88
  st.pyplot(fig)
89
  elif chart_type == "Box and Whisker":
90
  # Add box plots
 
91
  fig, param_data, plot_data = plot_sector_box_charts(
92
  filtered_raw_df, selected_parameter
93
  )