I am using ggplot to plot a histogram where the x variable is a categorical variable and I want to change the x-axis tick labels. Here is my code:
from pandas import *
from ggplot import *
df = pandas.read_csv('C:\Users\...csv')
def plot_data(df):
plot = ggplot(data_by_group, aes('x', 'y')) +
geom_histogram(stat='bar') + ggtitle('title') +
xlab('x-label') + ylab('y-label')
#x_ticklabels = ['a', 'b', 'c']
return plot
I would like to use the x_ticklabels on the x-axis instead of the numbers from the categorical variable.
Any ideas on how to do this?
Thank you