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

scale_x_log

scale_x_log applies a logarithmic scale to your x-axis. Its parameters are:

  • base - base value logarithm. defaults to 10
In [7]:
ggplot(diamonds, aes(x='price', y='carat')) + \
    geom_point() + \
    scale_x_log()
Out[7]:
<ggplot: (292637265)>
In [3]:
ggplot(pigeons, aes(x='speed')) + \
    geom_histogram() + \
    scale_x_log(base=2)
Out[3]:
<ggplot: (284496621)>
In [4]:
ggplot(diamonds, aes(x='price')) + \
    geom_histogram() + \
    scale_x_log()
Out[4]:
<ggplot: (285426089)>
In [6]:
ggplot(diamonds, aes(x='price')) + \
    geom_histogram() + \
    scale_x_log(base=100)
Out[6]:
<ggplot: (285785261)>
In [ ]: