Skip to content

Conversation

@SamLau95
Copy link
Contributor

Before, calling

Table([np.arange(0, 10, .1), np.arange(0, 1, .01)], ['x', 'y']).plot('x')

Would show xticks of 0, 0.1, 0.2, etc. instead of 0, 2, 4, ...
This was beacuse we assumed that the horizontal axis values as passed in
the ticks variable were integers. Instead, we should just ask the axis
for the ticks it used to plot the data.

To test:

a = Table([np.arange(0, 10, .1), np.arange(0, 1, .01)], ['x', 'y'])
a.plot('x')

b = Table([np.arange(0, 20, .1), np.arange(0, 2, .01)], ['x', 'y'])
b.plot('x')

screenshot 2015-10-27 18 09 24

Note that the x labels are still incorrect (the 'y' should be on the vertical axis). I left it as a TODO for now but it'd be good to take care of this.

Before, calling

    Table([np.arange(0, 10, .1), np.arange(0, 1, .01)], ['x', 'y']).plot('x')

Would show xticks of 0, 0.1, 0.2, etc. instead of 0, 2, 4, ...
This was beacuse we assumed that the horizontal axis values as passed in
the `ticks` variable were integers. Instead, we should just ask the axis
for the ticks it used to plot the data.

To test:

```python

a = Table([np.arange(0, 10, .1), np.arange(0, 1, .01)], ['x', 'y'])
a.plot('x')

b = Table([np.arange(0, 20, .1), np.arange(0, 2, .01)], ['x', 'y'])
b.plot('x')
SamLau95 added a commit that referenced this pull request Oct 28, 2015
Fix bug in xticks for Table.plot()
@SamLau95 SamLau95 merged commit 22ebf26 into master Oct 28, 2015
@SamLau95 SamLau95 deleted the fix-plot-ticks branch October 28, 2015 01:11
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

Successfully merging this pull request may close these issues.

2 participants