Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

String xticks #9

Open
nipunbatra opened this issue Feb 22, 2014 · 0 comments
Open

String xticks #9

nipunbatra opened this issue Feb 22, 2014 · 0 comments

Comments

@nipunbatra
Copy link
Contributor

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant