![]() ![]() 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) Example Get your own Python Server Add labels to the x- and y-axis: import numpy as np import matplotlib.pyplot as plt x np. Interested = df_interested.sort_values(, ascending = False, axis = 0, inplace = True)ĭf_ot(kind = 'bar', figsize = (20,8), width = 0.8, color=) Create Labels for a Plot With Pyplot, you can use the xlabel () and ylabel () functions to set a label for the x- and y-axis. Because the objects output by pandas and plotnine can be read by matplotlib, we have many more options than any one library can provide, offering a consistent environment to make. Here my code: df_interested = pd.read_csv('') The plots created in pandas or plotnine are matplotlib objects, which enables us to use some of the advanced plotting options available in the matplotlib library. 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). 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. |