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

Importing data from CSV files #46

Closed
dmiklic opened this issue Jun 18, 2017 · 3 comments
Closed

Importing data from CSV files #46

dmiklic opened this issue Jun 18, 2017 · 3 comments

Comments

@dmiklic
Copy link

dmiklic commented Jun 18, 2017

First of all, thanks a lot for a great tool!

So far, I have been using PlotJuggler with rosbags and it has worked flawlessly. Now I'm trying to use it with .csv files and I can't quite figure out how the importing works. I'm using version 1.0.4 installed from the ROS Kinetic apt package ros-kinetic-plotjuggler.

For example, I create a .csv file in Pandas using the following commands:

import pandas as pd
import matplotlib as plt
df = pd.DataFrame(np.random.randn(6,4), index=[1,2,3,4,5,6], columns=list('ABCD'))
df.to_csv('test.csv')

the output is this file (the extension has been changed to .txt because GitHub does not support attaching .csv files to issues). When loading the data into PlotJuggler, I get the following warning:

Selected time in not strictly  monotonic. Do you want to abort?
(Clicking "NO" you continue loading)

When clicking No I can see the data in the left pane, however, when trying to plot the data against the index vector, i.e., right-dragging the index vector to the plot pane and then left-dragging the data columns, this is the result I get:
plotjuggler_037
Btw. I did maximize both the vertical and the horizontal zoom. When maximizing the vertical zoom, the following gets printed to the console from which I started PlotJuggler:

invalid X0/X1 range in PlotWidget::maximumRangeY
invalid X0/X1 range in PlotWidget::maximumRangeY
invalid X0/X1 range in PlotWidget::maximumRangeY
invalid X0/X1 range in PlotWidget::maximumRangeY

I expect to see this plot:
df_plot
which is what I get by:

df.plot()
plt.show()

Am I missing something obvious?

@dmiklic dmiklic changed the title CSV file handling Importing data from CSV files Jun 18, 2017
@facontidavide
Copy link
Owner

I will take a look at it.

Cheers

facontidavide added a commit that referenced this issue Jun 19, 2017
@facontidavide
Copy link
Owner

Fixed. There was a bug and also a small issue related to the fact that your first column doesn't have a name.
I modified the code to insert a name like Column# when needed

@dmiklic
Copy link
Author

dmiklic commented Jun 19, 2017

Wow, that was quick! Thanks a lot, problem solved :)

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

2 participants