import plotly.graphobjects as go Updated Data categories = ['Training Set', 'Test Set']…
- User
import plotly.graph_objects as go
Updated Data
categories = ['Training Set', 'Test Set'] real_totals = [889 + 854 + 0, 0 + 0 + 3362] # Real: Client renamed spoof_totals = [855 + 893 + 0, 0 + 0 + 5761] # Spoof: Imposter renamed
Create grouped bar chart
fig = go.Figure(data=[ go.Bar(name='Real', x=categories, y=real_totals, marker_color='blue'), go.Bar(name='Spoof', x=categories, y=spoof_totals, marker_color='red') ])
Update layout
fig.update_layout( title='Total Samples in Training and Test Sets by Real vs Spoof', xaxis_title='Dataset', yaxis_title='Number of Samples', barmode='group', yaxis=dict(range=[0, max(real_totals + spoof_totals) + 1000]) )
fig.show()
make font larger
- Assistant
To make the font larger in your Plotly figure, you can update the font properties in the layout using the
fontparameter. Here's how you can modify your existing code to increase the font size for the title, axis titles, and tick labels:python