CSB261 commited on
Commit
5751319
1 Parent(s): 538c3eb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -7
app.py CHANGED
@@ -1,5 +1,5 @@
1
  import gradio as gr
2
- import matplotlib.pyplot as plt
3
 
4
  class MBTIAnalyzer:
5
  def __init__(self):
@@ -77,12 +77,9 @@ class MBTIAnalyzer:
77
  labels = list(percentages.keys())
78
  sizes = list(percentages.values())
79
 
80
- fig, ax = plt.subplots()
81
- ax.barh(labels, sizes, color='skyblue')
82
- ax.set_xlim(0, 100)
83
- ax.set_xlabel('Percentage (%)')
84
- ax.set_title('MBTI Result Distribution')
85
-
86
  return fig
87
 
88
  def mbti_interface(*answers):
 
1
  import gradio as gr
2
+ import plotly.express as px
3
 
4
  class MBTIAnalyzer:
5
  def __init__(self):
 
77
  labels = list(percentages.keys())
78
  sizes = list(percentages.values())
79
 
80
+ fig = px.bar(x=labels, y=sizes, labels={'x': 'Trait', 'y': 'Percentage (%)'},
81
+ title="MBTI Result Distribution")
82
+ fig.update_layout(yaxis_range=[0, 100])
 
 
 
83
  return fig
84
 
85
  def mbti_interface(*answers):