bearcart icon indicating copy to clipboard operation
bearcart copied to clipboard

String xticks

Open nipunbatra opened this issue 11 years ago • 0 comments

http://code.shutterstock.com/rickshaw/examples/x_axis.html gives an example on how strings can be set as xticks.

So for a df/series like:


In [50]: s = pd.Series(np.random.randn(5), index=['a', 'b', 'c', 'd', 'e'])

In [51]: s
Out[51]: 
a   -1.291530
b   -0.158646
c    0.713441
d    0.637185
e    1.581175
dtype: float64

We could do the following:

  1. See that index is string
  2. Create temp index as range(len(index))
  3. Create a mapping b/w temp index and original string index
  4. Use mapping to update x ticks as shown in the example linked above

nipunbatra avatar Feb 22 '14 15:02 nipunbatra