[Matplotlib-users] Plot a graph using matplotlib.pyplot
vinicius951
viniciushenrique951 at hotmail.com
Thu Dec 5 14:17:04 EST 2019
Hi, do you remember me? You help me days ago, and i wanna that you help me
again if you don't mind.
The code below is for plotting the graphs on my screen, but the
visualization still not as expected.
The axis-y is composed of words relatively larges, and the figure ends up
cutting the words.
The colors are not yet intuitive to understand.
I would like that you give me some tips, help, guidance on how to improve
the presentation of this result.
Basically, with Pandas, i read a csv file, made up of several columns, among
which I get the colum 'estado_fisico' and ploting in the graphic.
def Condutor_estadofisico():
fig = plt.figure(figsize=(4, 10))
df_condutor = pd.read_csv('df_condutor.csv')
x = df_condutor['estado_fisico'].value_counts().index
y = df_condutor['estado_fisico'].value_counts().values
a = plt.barh(x, y, color=colors, alpha=0.9)
plt.legend(a, x, fontsize=4.8)
for i, v in enumerate(y):
plt.text(v + 3, i + .25, str(v), color='blue', fontweight='bold',
fontsize=6.2)
return fig
<http://matplotlib.1069221.n5.nabble.com/file/t5276/1.png>
<http://matplotlib.1069221.n5.nabble.com/file/t5276/2.png>
--
Sent from: http://matplotlib.1069221.n5.nabble.com/matplotlib-users-f3.html
More information about the Matplotlib-users
mailing list