# Plot 3D surface in Hydro

Hi everyone,

I'm trying to find how to plot 3D data that represents a surface, over time. It should basically look like a grid surface that moves, in a 3d plot. I know this should be a simple task, does anyone have any ideas?

PS: an equivalent of what I am trying to achieve is like the surf() function in MATLAB.

Thank you, everyone.

edit retag close merge delete

Just to clarify: rxplot as well as rqt_plot are both only plotting single numeric values over time. So neither of them will fit your needs.

( 2014-03-26 07:42:44 -0500 )edit

yep, I realized that after looking into it a little more. That was a bad example. I will edit my question, thanks :)

( 2014-03-26 10:54:35 -0500 )edit

Sort by ยป oldest newest most voted

You can write a C++ or python ROS node that constructs and publishes an rviz marker: http://wiki.ros.org/rviz/DisplayTypes... . POINTS or TRIANGLE_LIST marker types would probably work.

If you want something more like matlab, but don't want to use matlab for some reason, you could try using the 3d plotting in the matplotlib python package: http://matplotlib.org/1.3.1/mpl_toolk...

more

Thank you! We're almost there.. RViz seems convenient, but do you know if there's any way I can plot my data to show like this wireframe plot: http://matplotlib.org/1.3.1/mpl_toolkits/mplot3d/tutorial.html#wireframe-plots ?

( 2014-03-26 06:46:08 -0500 )edit

To get that kind of plot in rviz you'll have to write some code. Shouldn't be too hard to write C++ or python to generate a grid of points in the XY plane, evaluate your function to get Z at each point, and make a LINE_LIST rviz Marker that displays the surface. You'll have to write that code though

( 2014-03-26 23:15:21 -0500 )edit

Thanks jbinney, i've went with RVIZ for now.

( 2014-03-27 07:27:35 -0500 )edit