Static Geodesic Plotting (Scatter Plots)

This module contains the basic classes for static plottings in 2-dimensions for scatter and line:

Color

  • Attractor :

    User can give the color to attractor of his/her choice. It can be passed while making the object of geodesics_static class. Default color of attractor is “black”.

    self.attractor_color = attractor_color
    plt.scatter(0, 0, color=self.attractor_color)
    
  • Geodesic :

    User can give the color to the orbit of the particle moving around the attractor of his/her choice. It can be passed while making the object of geodesics_scatter class. Default color is “Oranges”.

    self.cmap_color = cmap_color
    plt.scatter(pos_x, pos_y, s=1, c=time, cmap=self.cmap_color)
    

This module contains the methods for static geodesic plotting using scatter plots.

class einsteinpy.plotting.senile.geodesics_scatter.ScatterGeodesicPlotter(time=<Quantity 0. s>, attractor_color='black', cmap_color='Oranges')

Class for plotting static matplotlib plots.

Constructor.

Parameters
  • time (Quantity) – Time of start, defaults to 0 seconds.

  • attractor_color (string, optional) – Color which is used to denote the attractor. Defaults to black.

  • cmap_color (string, optional) – Color used in function plot.

plot(geodesic)
Parameters
  • coords (SphericalDifferential) – Position and velocity components of particle in Spherical Coordinates.

  • end_lambda (float, optional) – Lambda where iteartions will stop.

  • step_size (float, optional) – Step size for the ODE.

animate(geodesic, interval=50)

Function to generate animated plots of geodesics.

Parameters
  • geodesic (Geodesic) – Geodesic of the body

  • interval (int, optional) – Control the time between frames. Add time in milliseconds.