I am very new to Python, but have watched some of the tutorials here and have the general idea of how to do what I want, I am just unable to finish it completely.
I am datalogging spherical coordinate data to a CSV file, which I have manually converted to cartesian coordinates to be displayed in 3D. I am able to create a 3D line from my CSV file, following the tutorials on this site, but it pulls everything in at once and generates a line from datalogged point to datalogged point.
What I would like to do is create a 3D line from a fixed point (0,0,0) to a user selectable datalogged point(x,y,z). Could the selectable datalogged point perhaps be on a slide bar, to render the datalogged points over time by moving the slide bar?
You must be logged in to post. Please login or register an account.
There are some examples I have seen where interacting with the matplotlib graph can change it, pretty sure I have seen even slider bars, but I have never looked into it myself.
Check out the following code from matplotlib: http://matplotlib.org/examples/widgets/slider_demo.html
That's got an example slider that you could try to implement, along with some click event handling.
-Harrison 8 years ago
You must be logged in to post. Please login or register an account.
Thanks for the pointer! I have the slidebar up, and am able to have it generate a number. Next I just need to use that number generated to read values from that specific line in my csv file, and display that information.
-camronnie 8 years ago
You must be logged in to post. Please login or register an account.
Would someone look this over and help get me back on track? I'm able to pull x,y,z coordinates based on a specific line input request using pandas, verified by simply printing variables x y and z. That was based on manually calling which line, not using the slide bar as an input.
I am able to see the slide bar in my 3D plot, but do not see anything plotted. I am assuming this is because only one x,y,z point is being pulled, so a line isn't being created. Does anyone know how to hold a static point at 0,0,0 so a line will always be drawn from 0,0,0 to the point being pulled via the slide bar and datafile?
from mpl_toolkits.mplot3d import axes3d import matplotlib.pyplot as plt from matplotlib import style import csv import numpy as np from matplotlib.widgets import Slider, Button, RadioButtons import pandas as pd
You must be logged in to post. Please login or register an account.
Could you post some of your data from the test.txt file? I'll poke around with it.
-Harrison 8 years ago
You must be logged in to post. Please login or register an account.
Sorry it took me a bit to respond, but I actually have the basics working! I should be able to build from here. I'm sure the code is very crude, my primary experience is with Arduino.
from mpl_toolkits.mplot3d import axes3d import matplotlib.pyplot as plt from matplotlib import style import csv import numpy as np from matplotlib.widgets import Slider, Button, RadioButtons import pandas as pd