Update app.py
Browse files
app.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
-
import
|
| 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,
|
| 81 |
-
|
| 82 |
-
|
| 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):
|