In [1]:
%matplotlib inline
from ggplot import *

scale_x_discrete

scale_x_discrete scale a discrete x-axis. Its parameters are:

  • name - axis label
  • breaks - x tick breaks
  • labels - x tick labels

In [2]:
ggplot(diamonds, aes(x='cut')) + \
    geom_bar() + \
    scale_x_discrete("Cut (Quality)")


Out[2]:
<ggplot: (284492717)>

In [ ]: