home > kero > Documentation

Given a Network object whose members three-dimensional coordinates in space are specified by *grid_lattice_points*, which can be reshaped into a grid form specified by *grid_shape*. Also, given that the Network object has been evolved in time with the field data stored as *field_history *in the proper format,. Then this function plots a 3D quiver showing three of the components of a one of the fields in the *field_history*.

kero.multib.nDnet.py class SpecialGallery: def quiver3D_lattice3D(self, fig, ax, no_of_steps_to_animate, grid_lattice_points, field_history, field_name_to_plot, field_index_to_plot=[0,1,2], field_name_label=["X","Y","Z"], grid_shape=None, time_between_steps_in_ms=1, gif_filename='quiver.gif', show_real_time=True, view_angle_elevation=90, view_angle_azimuth=90, xlim=None, ylim=None, zlim=None, arrow_length_scale=None, ): return

**Arguments/Return**

fig | <class ‘matplotlib.figure.Figure’> |

ax | Any matplotlib plotting axes, for example an object from <class matplotlib.axes._subplots.AxesSubplot> |

no_of_steps_to_animate | Integer. Number of steps out of the entire length of simulation to animate, starting from time step 0. The entire length is specified as Tset in Network_processor object. |

grid_lattice_points | Dictionary – key: (string) a member of network. When initialized, it is to have the same key as member_set. – values: tuples showing the key’s coordinates in space, typically (x,y,z) or 3D |

field_history | List of dictionary, [field1, field2,…] where each fieldk is a dictionary: – key: (string) field name – value: dictionary + key: (string) network member + values: [[a1,a2,…], [p1, p2, …]] where each ak is an action and each pk the probability of the occurrence of the action ak at a time step. |

field_name_to_plot | String. The name of field to be plotted into the quiver. This will be the key of set_of_fields of Network object. |

field_index_to_plot | List of integers, [i, j, k]. For multi-dimensional fields, select 3 components to be displayed in the quiver plot. For example, if the network is attached with vector field [P, Q, R, S] and we are interested to look at the evolution of P, Q, S w.r.t. time, then choose [0, 1, 3]. The indices are zero-based.
Default=[0,1,2] |

field_name_label | List of strings [label_X, label_Y, label_Z], each a label for an axis in this three dimensional plot.
Default =[“X”,”Y”,”Z”] |

grid_shape | List of integers, X. This is the input of reshape argument to the function tuple_to_grid(grid_lattice_points.,reshape=X). For example, if the grid used is two-dimensional, it can take the shape X=[m,n] for integers m, n. If it is a one-dimensional chain, it can be set to X=[N,1] for integer N or set to None.
If set to None, it will be set to [N,1] where N is the length of grid_lattice_points. Default=None |

time_between_steps_in_ms | Integer, number of milliseconds between frame in quiver plot.
Default=1 |

gif_filename | String. Name of quiver plot image to be saved.
Default=’quiver.gif’ |

show_real_time | Boolean. If True, before saving the image, animation is shown.
Default=True |

view_angle_elevation | Float. Elevation angle from which to view three-dimensional quiver plot.
Default=90 |

view_angle_azimuth | Float. Azimuth angle from which to view three-dimensional quiver plot.
Default=90 |

xlim | List of floats, [xmin, xmax]. The range of x values to be shown in the quiver plot.
Default=None |

ylim | List of floats, [ymin, ymax]. The range of y values to be shown in the quiver plot.
Default=None |

zlim | List of floats, [zmin, zmax]. The range of z values to be shown in the quiver plot.
Default=None |

arrow_length_scale | Float. This is a multiplier to which the lengths of all quiver arrows are multiplied. If set to None, then it is set to 1.0, i.e. the arrow lengths are plotted as they are.
Default=None |

**Example Usage 1**

See here. The quiver plot is the following.

*kero version: 0.5.1 and above*