I use the latest version of Spyder to code. I made a simple graph with this code:
import pandas as pd
import sys
import os
import plotly.express as px
filepath = input('Enter filepath: ')
assert os.path.exists(filepath), "I did not find the file at, " + str(filepath)
f = open(filepath, 'r+')
print("Hooray we found your file!")
f.close()
file = pd.read_csv(filepath, encoding='latin1', delimiter=',')
fig = px.histogram(file, x='Idade', color='Categoria')
print(fig)
#Idade means age and Categoria will show who has canceled services or not ('Cliente' and 'Cancelado', I'm sure you know what each means). The idea is that the graph has to show the ratio of cancellation of services between different ages. Ex: in a group of people of 20 years of age, 50 cancelled but 120 still remain clients.
But when I try to run it, spyder shows me this weird... I don't even know what to call this
Figure({
'data': [{'alignmentgroup': 'True',
'hovertemplate': 'Categoria=Cliente<br>Idade=%{x}<br>index=%{y}<extra></extra>',
'legendgroup': 'Cliente',
'marker': {'color': '#636efa'},
'name': 'Cliente',
'offsetgroup': 'Cliente',
'orientation': 'h',
'showlegend': True,
'textposition': 'auto',
'type': 'bar',
'x': array([45, 49, 51, ..., 54, 56, 50], dtype=int64),
'xaxis': 'x',
'y': array([ 0, 1, 2, ..., 10120, 10121, 10122], dtype=int64),
'yaxis': 'y'},
{'alignmentgroup': 'True',
'hovertemplate': 'Categoria=Cancelado<br>Idade=%{x}<br>index=%{y}<extra></extra>',
'legendgroup': 'Cancelado',
'marker': {'color': '#EF553B'},
'name': 'Cancelado',
'offsetgroup': 'Cancelado',
'orientation': 'h',
'showlegend': True,
'textposition': 'auto',
'type': 'bar',
'x': array([62, 66, 54, ..., 44, 30, 43], dtype=int64),
'xaxis': 'x',
'y': array([ 21, 39, 51, ..., 10124, 10125, 10126], dtype=int64),
'yaxis': 'y'}],
'layout': {'barmode': 'relative',
'legend': {'title': {'text': 'Categoria'}, 'tracegroupgap': 0},
'margin': {'t': 60},
'template': '...',
'xaxis': {'anchor': 'y', 'domain': [0.0, 1.0], 'title': {'text': 'Idade'}},
'yaxis': {'anchor': 'x', 'domain': [0.0, 1.0], 'title': {'text': 'index'}}}
})
How do I get an actual image insted of this? btw I can't use jupyter or google colabs since I have to make an executable program that generate said images as jpeg or whatever