Skip to content

simple x-y plots #1527

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

Closed
zachcp opened this issue Jun 25, 2012 · 2 comments
Closed

simple x-y plots #1527

zachcp opened this issue Jun 25, 2012 · 2 comments
Labels
Milestone

Comments

@zachcp
Copy link

zachcp commented Jun 25, 2012

this might be obvious to others but I couldn't find a way to do a simple X-Y plot where two columns of values correspond to X and Y locations. If this is already implemented I would be happy to write an example for the documentation.

@lodagro
Copy link
Contributor

lodagro commented Jun 25, 2012

This is currently not possible, see also #857
Workaround is to set the column you want to plot against as index, see below for a sine plot example.

In [109]: x = np.arange(-pi, pi, .01)

In [110]: y = np.sin(x)

In [111]: df = pandas.DataFrame({'X': x, 'Y': y})

In [112]: df.set_index('X').plot()

@ghost ghost assigned changhiskhan Jul 13, 2012
@changhiskhan
Copy link
Contributor

You can now do df.plot(x='X', y='Y') to plot one column versus another

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants