require 'spice_rub' require 'gnuplotrb' SpiceRub::KernelPool.instance.load_folder("spec/data/kernels") earth = SpiceRub::Body.new(:earth) revolution = 365 * 86400 start = SpiceRub::Time.parse("22 Aug 2016") times = SpiceRub::Time.time_series(start, start + revolution, step: 86400) positions = times.map { |t| earth.position_at(t) } x_coord = positions.map {|p| p[0]} y_coord = positions.map {|p| p[1]} z_coord = positions.map {|p| p[2]} g = GnuplotRB::Splot.new( [[x_coord, y_coord, z_coord]], title: "XYZ Plot of Revolution of The Earth from the Sun", with: :lines)