tables_and_plots¶
- class Plot_General[source]¶
Base class for all plot objects providing common styling and configuration parameters.
This class serves as a foundation for various plot types in the string cosmology package, centralizing visual properties such as colors, opacity, decorators, and stroke settings. All plot-specific classes inherit from this to ensure consistent appearance across different visualization types.
- Parameters:
func_main_color (ParsableManimColor, default=GREEN) – Primary function curve color.
func_2_color (ParsableManimColor, default=RED) – Secondary function curve color.
func_3_color (ParsableManimColor, default=BLUE) – Tertiary function curve color.
text_color (ParsableManimColor, default=WHITE) – Color for text labels and annotations.
axis_opacity (float, default=0.5) – Opacity level for axis lines.
axis_stroke (float, default=1) – Stroke width for axis lines.
decorator_presence (str, default="box") – Style of decorator around the plot. Options include:
"box"for a surrounding rectangle, or"no"for plain presentation.decorator_color (ParsableManimColor, default=WHITE) – Color of the decorator frame.
decorator_stroke_w (float, default=1) – Stroke width of the decorator frame.
corner_rad (float, default=0) – Base radius for rounded corners on decorators.
corner_rad_direction (list, default=[0, 0, 0, 0]) – List specifying which corners to round [UL, UR, DR, DL]. Each element is multiplied by corner_rad to determine final radius.
fill_opa (float, default=0.1) – Fill opacity for decorator backgrounds.
stroke_w (float, default=1) – General stroke width for plot elements.
stroke_opa (float, default=1) – Stroke opacity for plot elements.
tightness (float, default=0.3) – Buffer distance between plot content and decorator frame.
kwargs – Additional keyword arguments passed to
Group.
Note
To scale any graph with respect to its center, use:
graph.scale(3, about_point=graph.ax_ins.c2p(0, 0, 0))See also
Plot_Tension
Example usage:
from manim import * from manim_string_cosmo import * class PlotExample(Scene): def construct(self): # Create a custom plot with specific colors plot = Plot_General( func_main_color=BLUE, text_color=YELLOW, decorator_presence="box", corner_rad=0.1, corner_rad_direction=[1, 1, 1, 1] ) self.add(plot)
- class Plot_Induced_Potential[source]¶
This is a class to represent a 4D cosmo potential for the nucleated brane from the 10D.
See Plot_General Class for more information.
Note
Note that the axis and labels of these are the 0-th element of the group when you call it.
Example usage:
class Example_Plot_Induced_Potential(Scene): def construct(self): plot_pot = Plot_Induced_Potential() plot_pot.scale(0.3, about_point=plot_pot.ax_4D_cosmos.get_origin()) plot_pot.to_corner(LEFT) self.add(plot_pot[0]) self.play(plot_pot.show_potential()) self.play(plot_pot.show_jc()) self.play(plot_pot.nucleate_brane()) self.wait() self.play(plot_pot.accelerate()) self.play(plot_pot.bounce()) self.play(plot_pot.add_cc_and_expand()) self.play(FadeOut(plot_pot)) self.play(Wait())
- accelerate(rt: float = 0.5, rf: float = <function linear>) Animation[source]¶
Takes the brane to the minimum of the potential.
- Parameters:
rt (float) – Run time of the animation.
rf (float) – Rate function of the animation.
- Returns:
Animation object that moves the brane to potential minimum.
- Return type:
Animation
- add_cc_and_expand(rt: float = 6, rf: float = <function linear>) Succession[source]¶
Shows the modified potential to add the presence of the cosmological constant and then expand the bubble forever.
- Parameters:
rt (float) – Run time of the animation.
rf (float) – Rate function of the animation.
- Returns:
Animation sequence showing potential transition and asymptotic expansion.
- Return type:
Succession
- bounce(rt: float = 4, rf: float = <function linear>) Succession[source]¶
Makes the system bounce in the potential.
- Parameters:
rt (float) – Run time of the animation.
rf (float) – Rate function of the animation.
- Returns:
Animation sequence creating oscillatory motion in the potential well.
- Return type:
Succession
- nucleate_brane(rt: float = 0.5, rf: float = <function linear>) Succession[source]¶
Moves the position in the potential to the outer horizon.
- Parameters:
rt (float) – Run time of the animation.
rf (float) – Rate function of the animation.
- Returns:
Animation sequence that fades in the position marker and moves it to nucleation point.
- Return type:
Succession
- show_jc(rt: float = 2, rf: float = <function linear>) Animation[source]¶
Shows the potential with extra barrier of the angular momentum.
- Parameters:
rt (float) – Run time of the animation.
rf (float) – Rate function of the animation.
- Returns:
Animation object showing the junction condition potential.
- Return type:
Animation
- class Plot_Instanton[source]¶
Create a visual representation of an instanton potential with false and true minima.
This class inherits from
Plot_Generaland produces a plot showing a double-well potential landscape characteristic of instanton configurations in quantum field theory. The plot includes labeled minima (V+ and V-) and an interactive field position indicator that can be animated to demonstrate tunneling processes.- Parameters:
kwargs – Keyword arguments passed to
Plot_Generalfor styling configuration.
Note
The axis and labels are stored as the 0-th element of the group when accessed.
To scale the graph with respect to its center:
plot.scale(3, about_point=plot.ax_ins.c2p(0, 0, 0))See also
Plot_General- Base class providing styling parametersPlot_Quantum- Related quantum mechanical plot
Example usage:
from manim import * from manim_string_cosmo import * class InstantonExample(Scene): def construct(self): # Create instanton plot in bottom-left corner p_ins = Plot_Instanton().to_corner(DL) # Add the plot axes and potential self.add(p_ins[0]) # Animate field position appearing self.play(p_ins.fade_in_field_position()) # Demonstrate tunneling/decay process self.play(p_ins.decay())
- decay(rt: float = 0.5, rf: float = <function linear>) Animation[source]¶
Animate the tunneling/decay process from false vacuum to true vacuum.
This method creates an animation showing the field position transitioning from the false vacuum (V+) to the true vacuum (V-), representing quantum tunneling through the potential barrier.
- Parameters:
rt (float, default=0.5) – Animation runtime in seconds.
rf (function, default=linear) – Rate function controlling animation timing.
- Returns:
Animation describing the tunneling process in the potential.
- Return type:
Animation
Example:
plot = Plot_Instanton() # Quick decay animation self.play(plot.decay(rt=0.3, rf=rush_into)) # Smooth, slower decay self.play(plot.decay(rt=2.0, rf=smooth))
- fade_in_field_position(rt: float = 0.5, rf: float = <function linear>) Animation[source]¶
Animate the field position indicator fading into view.
This method creates a fade-in animation for the dot representing the current field position in the potential landscape.
- Parameters:
rt (float, default=0.5) – Animation runtime in seconds.
rf (function, default=linear) – Rate function controlling animation timing (e.g.,
linear,smooth).
- Returns:
Animation showing the field position indicator fading in.
- Return type:
Animation
Example:
plot = Plot_Instanton() self.play(plot.fade_in_field_position(rt=1.0, rf=smooth))
- class Plot_Lambda_Tension[source]¶
This class represents the tension of the nucleated brane with respect to the different values of the AdS scales inside and outside. See Plot_General Class.
Note
The 0-th element correspond to the axis and labels.
Example:
from manim import * from manim_string_cosmo import * class Example_Plot_Tension(Scene): def construct(self): p_tension= Plot_Lambda_Tension() p_tension.scale(0.3, about_point= p_tension.ax_tension_DB.get_origin()).to_corner(LEFT) self.play(FadeIn(p_tension[0])) self.play(p_tension.create_function())
- class Plot_Quantum[source]¶
This class returns the simplest quantum cosmology potential to discuss the two different boundary conditions of this framework.
See Plot_General Class for more information.
Note
The axis and potential are the 0-th element of the class.
Example usage:
from manim import * from manim_string_cosmo import * class Example_Plot_Q(Scene): def construct(self): gq = Plot_Quantum().scale(0.4).to_corner(DL) self.add(gq[0]) self.play(gq.create_wave_functions())
- create_wave_functions(rt: float = 2, rf: float = <function linear>) Succession[source]¶
Write both wavefunctions for the discussion and its legend.
- Parameters:
rt (float) – Run time of the animation.
rf (float) – Rate function of the animation.
- Returns:
Animation sequence writing all wavefunction elements.
- Return type:
Succession
- class Table_Bh_Embedding[source]¶
Class to represent a table of the coordinates of the embedding of the dark bubble.
See Table_General Class for more information. It can display the whole table (type=”together”) or divided (type=”split”). It has three methods (animations).
- Parameters:
type (str) – Display mode for the table. Defaults to “together”.
chosen_position (list) – The relative position of the compact dimensions with respect to uncompact dimensions. Defaults to RIGHT.
Note
Two display types are available:
“together”: Display all 9 spatial directions in the same row.
“split”: Display compact and non-compact dimensions in two different tables.
from manim import * from manim_string_cosmo import * class Example_Table_Bh_Embedding(Scene): def construct(self): together = Table_Bh_Embedding(type="together") together.scale_to_fit_width(config.frame_width - 1).shift(UP) split = Table_Bh_Embedding(type="split", chosen_position=RIGHT) split.scale_to_fit_width(config.frame_width - 1).next_to(together, DOWN, buff=0.2) self.add(together, split) self.play(AnimationGroup(together.move_all(), split.move_non_compact(), split.move_compact()))
- move_all(rt: float = 3, rf: float = <function linear>) AnimationGroup[source]¶
Move the brane through all coordinates.
- Parameters:
rt (float) – Run time of the animation.
rf (float) – Rate function of the animation.
- Returns:
Animation group moving the brane through all spatial coordinates.
- Return type:
AnimationGroup
- move_compact(rt: float = 3, rf: float = <function linear>) AnimationGroup[source]¶
Move the brane through the compact dimensions.
- Parameters:
rt (float) – Run time of the animation.
rf (float) – Rate function of the animation.
- Returns:
Animation group moving the brane through all compact dimensions.
- Return type:
AnimationGroup
- move_non_compact(rt: float = 3, rf: float = <function linear>) Animation[source]¶
Move the brane through the AdS throat.
- Parameters:
rt (float) – Run time of the animation.
rf (float) – Rate function of the animation.
- Returns:
Animation to move the brane along the AdS throat path.
- Return type:
Animation
- class Table_Energy_Scales[source]¶
Class to display the table of energy scales of the dark bubble embedding. See Table_General Class.
- class Table_General[source]¶
Base class for all table objects providing common formatting and styling parameters.
This class centralizes common input parameters for table creation in the string cosmology library, ensuring consistent styling across different table types through inheritance. It handles text colors, highlighting options, decorators, and corner styling.
- Parameters:
text_color (ParsableManimColor, default=WHITE) – Primary color for table text content.
hlight_1_color (ParsableManimColor, default=GREEN) – Primary highlight color for emphasizing specific cells.
hlight_2_color (ParsableManimColor, default=RED) – Secondary highlight color for cell emphasis.
hlight_3_color (ParsableManimColor, default=BLUE) – Tertiary highlight color for cell emphasis.
decorator_color (ParsableManimColor, default=WHITE) – Color of the table border/frame decorator.
decorator_stroke_w (float, default=1) – Stroke width of the decorator frame.
corner_rad (float, default=0) – Base radius for rounded corners on table cells and decorators.
corner_rad_direction (list, default=[0, 0, 0, 0]) – List specifying which corners to round [UL, UR, DR, DL]. Each element is multiplied by corner_rad to determine final corner radius.
stroke_w (float, default=1) – General stroke width for table lines.
stroke_opa (float, default=1) – Stroke opacity for table borders and dividers.
fill_opa (float, default=0.3) – Fill opacity for highlighted cells and backgrounds.
kwargs – Additional keyword arguments passed to
VMobject.
See also
Table_SummaryTable_BH_Embedding
Example usage:
from manim import * from manim_string_cosmo import * class TableExample(Scene): def construct(self): # Create tables and arrange them table_group = VGroup( Table_Summary_Induce(), Table_Energy_Scales() ).arrange(RIGHT) table_group.scale_to_fit_width(config.frame_width - 1) self.add(table_group)