Spaces:
Running
Running
import matplotlib.pyplot as plt | |
import io | |
from PIL import Image | |
def update_dashboard_plot(log_data): | |
# Sample data visualization | |
labels = ["Solution 1", "Solution 2"] | |
values = [log_data.count("1"), log_data.count("2")] | |
fig, ax = plt.subplots() | |
ax.bar(labels, values) | |
ax.set_title("Feedback Summary") | |
buf = io.BytesIO() | |
plt.savefig(buf, format='png') | |
buf.seek(0) | |
plt.close(fig) | |
return Image.open(buf) | |