I am just struggling with the X axis labeling. Plt.show()The bar chart gets displayed the way I want. Sns.despine(top=True, right=True, left=True, bottom=False) Plt.title('Pourcentage of respondents interest in Data Science Areas', size = 16) Interested = df_interested.sort_values(, ascending = False, axis = 0, inplace = True)ĭf_ot(kind = 'bar', figsize = (20,8), width = 0.8, color=) Here my code: df_interested = pd.read_csv('') Also if I do: print label.gettext () nothing is printed. However, if try: ttext ('Foo') the tick label is not modified. edit: with an example of marking an arbitrary subset of points, as requested in the comments: import numpy as np import matplotlib.pyplot as plt xs np.linspace(-np.pi, np.pi, 30) ys np.sin(xs) markerson 12, 17, 18, 19 plt.plot(xs, ys, '-gD', markeverymarkerson, label'line with select markers') plt.legend() plt. I would like to replace / rename them with text of the first column of my data (labels should be: Data Analysis, Machine Learning, Data Visualization, Big Data, Deep Learning, Data journalist). label () 2.label tfontsize (size) trotation ('vertical') the font size and the orientation of the tick label is changed. Right now I get numbers as labels (1,5,3,0,4,2)for the x axis. Here the link to the data I have been using: Data for bar chart I have been blocked for a while with the following issue: how do I rename/replace the labels on the X axis of my bar chart in Matplotlib? I have started Python programming classes last month to become a data analyst.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |