Thursday, 10 April 2025

Quantum Vortex 3D Pattern using Python

 


import matplotlib.pyplot as plt

import numpy as np

from mpl_toolkits.mplot3d import Axes3D

theta=np.linspace(0,20*np.pi,1000)

z=np.linspace(-2,2,1000)

r=z**2+1

x=r*np.sin(theta)

y=r*np.cos(theta)

fig=plt.figure(figsize=(6,8))

ax=fig.add_subplot(111,projection='3d')

ax.plot(x,y,z,color='cyan',linewidth=2)

ax.set_title('Quantum Vortex Pattern',fontsize=18,color='purple')

ax.set_facecolor('black')

fig.patch.set_facecolor('black')

ax.grid(False)

ax.set_xticks([])

ax.set_yticks([])

ax.set_zticks([])

plt.show()

#source code --> clcoding.com 

Code Explanation:

1. Import Required Libraries

import numpy as np

import matplotlib.pyplot as plt

from mpl_toolkits.mplot3d import Axes3D

Purpose:

numpy → For mathematical calculations like arrays, linspace, trigonometric functions.

 matplotlib.pyplot → For plotting the graph.

 mpl_toolkits.mplot3d → To enable 3D plotting using Matplotlib.

 2. Define the Vortex Parameters

theta = np.linspace(0, 20 * np.pi, 1000) 

z = np.linspace(-2, 2, 1000)            

r = z**2 + 1

Explanation:

theta → Controls the angle of the spiral (0 to 20π means multiple spiral loops).

 z → Controls the vertical height of the plot (-2 to 2 units).

 r → Radius of the spiral at each z height.

(As z increases or decreases, radius changes — gives a vortex or tornado effect).

 3. Generate X, Y, Z Coordinates

x = r * np.sin(theta)

y = r * np.cos(theta)

Purpose:

Parametric equations of a spiral in 3D:

 x depends on sin(theta)

 y depends on cos(theta)

 z is already defined.

 This gives the 3D twisted spiral shape.

 4. Create 3D Plot Figure

fig = plt.figure(figsize=(10, 7))

ax = fig.add_subplot(111, projection='3d')

Explanation:

Create a new figure of size 10x7.

 Add a 3D subplot to draw 3D patterns.

 5. Plot the Quantum Vortex

ax.plot(x, y, z, color='cyan', linewidth=2)

Purpose:

Draw the 3D vortex spiral using the x, y, z points.

 Color: Cyan

 Line width: 2

 6. Styling the Plot

ax.set_title('Quantum Vortex 3D Pattern', fontsize=18, color='purple')

ax.set_facecolor('black')

fig.patch.set_facecolor('black')

ax.grid(False)

Purpose:

Add a custom title to the plot.

 Set background color of the plot & figure to black for a "space" or "quantum" look.

 Disable grid lines for a clean visual.

 7. Remove Axis Ticks

ax.set_xticks([])

ax.set_yticks([])

ax.set_zticks([])

Purpose:

Remove the axis ticks (numbers) for an aesthetic and clean design.

 8. Show the Final Plot

plt.show()

Purpose:

Display the final 3D vortex pattern on the screen.


3D Origami Pattern using Python

 


import matplotlib.pyplot as plt

import numpy as np

x=np.linspace(0,10,100)

y=np.linspace(0,10,100)

X,Y=np.meshgrid(x,y)

Z=np.sin(X)*np.cos(Y)

fig=plt.figure(figsize=(8,6))

ax=fig.add_subplot(111,projection='3d')

ax.plot_surface(X,Y,Z,cmap='plasma',edgecolor='k',linewidth=0.3)

ax.set_title("3D Folded Origami Pattern ")

plt.show()

#source code --> clcoding.com

Code Explanation:

1. Importing Libraries

import numpy as np

import matplotlib.pyplot as plt

numpy (as np): Used for numerical operations and array handling.

 matplotlib.pyplot (as plt): Used for plotting and displaying graphs.

 2. Creating the Grid

x = np.linspace(0, 10, 100)

y = np.linspace(0, 10, 100)

X, Y = np.meshgrid(x, y)

np.linspace(0, 10, 100): Creates 100 values linearly spaced from 0 to 10 for both x and y axes.

 np.meshgrid(x, y): Converts the 1D x and y arrays into 2D coordinate grids (X, Y).

 This is needed to plot a surface where each (x, y) pair will have a height Z.

 3. Defining the Height (Z-values)

Z = np.sin(X) * np.cos(Y)

This creates a wave-like height map:

 sin(X) gives you waves along the x-direction.

 cos(Y) gives waves in the y-direction.

 Multiplying them results in a folded checkerboard-like wave pattern — similar to a Miura fold in origami, where some parts are folded up and others down.

 It visually mimics the alternating mountain-valley folds.

 4. Creating the Plot

fig = plt.figure(figsize=(10, 6))

ax = fig.add_subplot(111, projection='3d')

Creates a figure (fig) with a specific size (10 by 6 inches).

 Adds a 3D subplot (ax) to the figure using projection='3d'.

 5. Plotting the 3D Surface

ax.plot_surface(X, Y, Z, cmap='plasma', edgecolor='k', linewidth=0.3)

plot_surface: Draws a 3D surface plot.

 X, Y, Z: Coordinates of the surface.

 cmap='plasma': Applies a colorful colormap for aesthetics (from yellow to purple).

 edgecolor='k': Edges of the grid are black, which enhances the “folded paper” look.

 linewidth=0.3: Makes the grid edges thin for sharp creases, like origami folds.

 6. Final Touches

ax.set_title("3D Folded Origami Pattern (Miura-inspired)")

plt.show()

Adds a title to the plot.

 plt.show() renders and displays the 3D plot window.


Python Coding Challange - Question With Answer(01100425)

 


Line-by-line explanation:


prod = getProd(4,5,2)
  • This line is trying to call a function named getProd with arguments 4, 5, and 2.

  • However, at this point in the code, getProd is not yet defined, so Python will throw an error.

  • Error: NameError: name 'getProd' is not defined


print(prod)
  • This line will not run because the previous line causes an error.

  • If the function was properly defined before being called, this line would print the result of 4 * 5 * 2 = 40.


def getProd(a, b, c):
  • This defines a function named getProd that takes 3 arguments: a, b, and c.


return a * b * c
  • This returns the product of the three numbers passed to the function.


Summary:

  • The code tries to use the function before it's defined.

  • Python reads code from top to bottom, so it doesn't know what getProd is when it's first called.

  • To fix it, you should define the function before calling it.

Application of Python Libraries for Civil Engineering

https://pythonclcoding.gumroad.com/l/feegvl

Wednesday, 9 April 2025

Python Coding challenge - Day 433| What is the output of the following Python Code?

Code Explanation:

def gen():
This defines a generator function named gen.
Unlike a regular function that returns values once and exits, this function will use yield, making it a generator.
When called, it returns a generator object that can produce a sequence of values over time.

    i = 0
Inside the function, you initialize a variable i to 0.
This will be the starting value of your counter.

    while True:
This creates an infinite loop.
It means the code inside this block will keep repeating forever (unless you break it manually or stop calling next()).
The generator is designed to produce values endlessly.

        yield i
This is the core of a generator.

yield means: “pause here and return the value of i to the caller.”

After yielding, the generator’s state is saved — including the current value of i, and where it was in the code.

        i += 1
After yielding i, we increment i by 1.
So next time the generator resumes, it will yield the next number.
This makes the generator produce 0, 1, 2, 3, ... one at a time.

g = gen()
Now you call the generator function, which returns a generator object.
The function body doesn't run yet — it just prepares the generator to be used.
Variable g now holds that generator object.

print(next(g), next(g), next(g))
You are calling next(g) three times.
Each call resumes the generator, runs until the next yield, and returns the value:
next(g) → i = 0, yields 0, then i becomes 1
next(g) → resumes at i = 1, yields 1, then i becomes 2
next(g) → resumes at i = 2, yields 2, then i becomes 3
These three values are printed on one line, separated by spaces.

Final Output:

0 1 2

 

Python Coding challenge - Day 432| What is the output of the following Python Code?

 


import asyncio

This imports Python's asynchronous I/O library.

The asyncio module provides tools for writing concurrent code using async/await syntax.

You’ll use it to run asynchronous functions (coroutines).


async def a(): return 1

This defines an asynchronous function (coroutine) named a.

The async def syntax marks this as a coroutine.

When called, it returns a coroutine object, not the value 1 immediately.

Inside, it just returns 1.


async def b(): return await a()

This defines another coroutine b.

Inside it, await a() is used, meaning:

It calls the coroutine a() and waits for it to finish.

It pauses execution until a() completes and returns 1.

Then b() returns that result.


async def c(): return await b()

This is a third coroutine c.

It does the same thing: awaits b(), which awaits a(), which returns 1.

So this creates a simple chain of async calls: c() → b() → a() → 1.


print(asyncio.run(c()))

asyncio.run() is used to run the coroutine c() from synchronous code (like a script).

It:

Starts an event loop.

Runs c() until it completes.

Returns the final result.

So here, it executes c() → b() → a() → returns 1.

That 1 is printed.

Final Output:

1


Tuesday, 8 April 2025

Python Coding Challange - Question With Answer(01090425)

 


This is a recursive function. It calculates the sum of all numbers from 1 to num.


 How does recursion work here?

Let's see how sum(5) gets evaluated:

  1. sum(5) → 5 + sum(4)

  2. sum(4) → 4 + sum(3)

  3. sum(3) → 3 + sum(2)

  4. sum(2) → 2 + sum(1)

  5. sum(1) → returns 1 (base case)

Now plug values back in:

  • sum(2) = 2 + 1 = 3

  • sum(3) = 3 + 3 = 6

  • sum(4) = 4 + 6 = 10

  • sum(5) = 5 + 10 = 15


✅ Output:

15

In Simple Words:

This function adds:

5 + 4 + 3 + 2 + 1 = 15


Application of Python in Chemical Engineering

https://pythonclcoding.gumroad.com/l/dlrub

Python Coding Challange - Question With Answer(01080425)

 


Explanation

try block:

  • Python runs the code inside the try block first.

  • print("Hello") executes normally, so it prints:

    Hello
  • Then, raise Exception is used to manually raise an exception. This immediately stops the normal flow and jumps to the except block.

except block:

  • Since an exception occurred, the code inside the except block runs.

  • It prints:


    Python

✅ Final Output:


Hello
Python

This shows how Python handles exceptions:

  1. It tries the code.

  2. If something goes wrong (an exception is raised), it jumps to except and handles it.


100 Python Programs for Beginner with explanation 

https://pythonclcoding.gumroad.com/l/qijrws

Monday, 7 April 2025

Python Coding challenge - Day 427| What is the output of the following Python Code?

 


Code Explanation:

1. Importing Libraries

from scipy import stats
import numpy as np
numpy is used for creating and manipulating arrays.

scipy.stats provides statistical functions — like mean, median, and mode.

2. Defining Data
data = np.array([1, 2, 2, 3, 4, 4, 4, 5])
This is your sample data array. It contains repeated values. Let’s look at the frequencies:

Value Frequency
1 1
2 2
3 1
4
5 1

3. Calculating Mode

mode = stats.mode(data, keepdims=True)
stats.mode() returns the most frequent value in the array (i.e., the mode).

keepdims=True keeps the output in the same dimensional structure (as an array).

As seen above, 4 appears most frequently (3 times), so the mode is 4.

The mode object is a ModeResult, which has:

.mode → the value(s) that appear most frequently

.count → the count(s) of how often the mode appears

4. Printing the Mode
print(mode.mode)

Final Output:

[4]
Because keepdims=True, the result is still a NumPy array — hence [4] instead of just 4.


Python Coding challenge - Day 426| What is the output of the following Python Code?

 



Code Explanation:

1. Import TensorFlow

import tensorflow as tf
You're importing TensorFlow — a deep learning framework used for tensors, models, training, and automatic differentiation.

2. Define Variable x

x = tf.Variable(3.0)
You define a TensorFlow variable x with a float value 3.0.

tf.Variable is used when you want to compute gradients with respect to this variable.

3. Start Recording with GradientTape
with tf.GradientTape() as tape:
    y = x**2
tf.GradientTape() is used to record operations for automatic differentiation.

Inside the with block, TensorFlow tracks all computations involving x.

y = x**2 → this is the function whose gradient you want.

4. Compute Gradient
grad = tape.gradient(y, x)
This line computes the gradient of y with respect to x.

5. Print Result
print(grad)
This prints:
tf.Tensor(6.0, shape=(), dtype=float32)

Final Output:

6.0

Python Coding challenge - Day 425| What is the output of the following Python Code?


 Code Explanation:

1. Importing Libraries

from scipy.linalg import eig
import numpy as np
numpy is used to define arrays and matrices.
scipy.linalg.eig is used to compute eigenvalues and eigenvectors of a square matrix.

2. Define Matrix A
A = np.array([[0, -1],
              [1,  0]])
This is a special 2x2 matrix known as a rotation matrix. It rotates vectors 90° counter-clockwise.

3. Compute Eigenvalues and Eigenvectors
eigenvalues, _ = eig(A)
eig() returns a tuple: (eigenvalues, eigenvectors)

We're only using the eigenvalues part here.

4. Print Eigenvalues
print(eigenvalues)
The output will be:
[0.+1.j 0.-1.j]
These are complex eigenvalues:

0 + 1j → the complex number i

0 - 1j → the complex number −i

What Do These Eigenvalues Mean?
These eigenvalues lie on the unit circle in the complex plane (|λ| = 1).
They indicate that the transformation (matrix A) rotates vectors by 90 degrees.
Since A represents a rotation matrix, it has no real eigenvalues, because there's no real vector that stays on its own line after being rotated 90°.

Final Output:

[1j,-1j]

Learning LangChain: Building AI and LLM Applications with LangChain and LangGraph


 Learning LangChain: Building AI and LLM Applications with LangChain and LangGraph

LangChain is an open-source framework designed to simplify the development of applications using large language models (LLMs). It provides a modular and flexible approach to integrating LLMs into applications, allowing developers to build intelligent, scalable AI-powered solutions. Additionally, LangGraph extends these capabilities by enabling structured workflows and multi-agent interactions.

In this blog, we will explore the fundamentals of LangChain and LangGraph, how they work together, and how you can use them to build AI applications.

Understanding LangChain

LangChain provides a high-level interface for working with LLMs, making it easier to develop applications that utilize natural language processing. The core features of LangChain include:

Prompt Engineering: Efficiently designing prompts to get the best responses from an LLM.

Chains: Connecting multiple components together to form structured workflows.

Memory: Allowing AI applications to retain context over interactions.

Retrieval: Enhancing LLM responses by integrating external knowledge sources.

Agents: Creating AI systems that can autonomously make decisions based on input and data.

Setting Up LangChain

To get started with LangChain, developers need to install the framework and configure it properly. It requires defining a language model, setting up prompt templates, and integrating it into an application workflow. Once set up, LangChain enables seamless interaction with LLMs, providing structured output based on user input.

Introducing LangGraph

LangGraph extends LangChain by providing structured workflows and graph-based execution models. This allows for more sophisticated AI applications that involve multiple steps, decision-making, and agent interactions.

Key Features of LangGraph

Multi-Agent Systems: Facilitating collaboration between multiple LLMs or AI agents.

Graph-Based Execution: Enabling non-linear workflows with branching logic.

Enhanced Control Flow: Allowing developers to specify exact execution paths and dependencies.

Using LangGraph for AI Workflows

LangGraph helps in structuring AI applications by defining workflows in a graph-based manner. It enables step-by-step execution of tasks, allowing AI models to process input efficiently. By incorporating LangGraph, developers can create AI-driven pipelines that follow logical decision paths.

Combining LangChain and LangGraph

When used together, LangChain and LangGraph enable powerful AI applications. Some potential use cases include:

Conversational AI: Chatbots with memory and structured decision-making.

Document Processing: Automated summarization, categorization, and sentiment analysis.

Multi-Agent AI Systems: Complex AI workflows that involve multiple LLMs.

Additional Topics in LangChain and LangGraph

To further explore LangChain and LangGraph, here are some additional key topics:

LangChain for Enterprise Applications: How businesses can integrate LangChain for customer support, analytics, and automation.

Advanced Prompt Engineering Techniques: Optimizing prompt structures for better AI responses.

LangChain and Retrieval-Augmented Generation (RAG): Enhancing AI applications with external knowledge sources.

Multi-Agent Collaboration with LangGraph: Implementing multiple AI agents to work together for problem-solving.

Ethical Considerations in AI Development: Addressing biases, fairness, and transparency when using LLMs.

Scaling AI Applications with LangChain: Strategies for deploying LangChain in production environments.

Real-World Case Studies: Examples of companies leveraging LangChain and LangGraph for innovative applications.

Hard Copy : Learning LangChain: Building AI and LLM Applications with LangChain and LangGraph


Kindle : Learning LangChain: Building AI and LLM Applications with LangChain and LangGraph

Conclusion

LangChain and LangGraph are powerful tools for building AI applications. While LangChain provides modular components for working with LLMs, LangGraph introduces structured workflows to enhance AI capabilities. By leveraging both, developers can create scalable and intelligent AI-driven applications with ease.

Start experimenting today and unlock the full potential of AI development!


Python Coding Challange - Question With Answer(01070425)

 


What happens:

  1. num = 6
    A variable num is created and assigned the value 6.

  2. decrement(num)
    This calls the decrement function and passes the value of num (which is 6) into the function.

  3. Inside the decrement function:

    python
    def decrement(num):
    num -= 2
    • Here, a new local variable num is created inside the function scope (it’s a copy of the one passed in).

    • num -= 2 changes this local copy to 4.

    • But the original num outside the function is not changed because integers are immutable and passed by value (in effect).

  4. print(num)
    This prints the original num, which is still 6.


Output:

6

Summary:

Even though the function decreases num by 2, it only does so inside the function. The original variable remains unchanged because integers are immutable and passed by value in Python functions.


400 Days Python Coding Challenges with Explanation

https://pythonclcoding.gumroad.com/l/sputu

Sunday, 6 April 2025

Wave Interference Pattern using Python

 


import matplotlib.pyplot as plt

import numpy as np

from mpl_toolkits.mplot3d import Axes3D

x=np.linspace(-10,10,300)

y=np.linspace(-10,10,300)

X,Y=np.meshgrid(x,y)

r1=np.sqrt((X+3)**2+(Y+3)**2)

r2=np.sqrt((X-3)**2+(Y-3)**2)

Z=np.sin(r1)+np.sin(r2)

fig=plt.figure(figsize=(10,6))

ax=fig.add_subplot(111,projection='3d')

ax.plot_surface(X,Y,Z,cmap='viridis',edgecolor='none')

ax.set_title("3D Wave Interferance Surface")

plt.show()

#source code --> clcoding.com 

Code Explanation:

1. Import Required Libraries

import numpy as np

import matplotlib.pyplot as plt

from mpl_toolkits.mplot3d import Axes3D

NumPy: Used for numerical calculations, array manipulations, and math functions.

 

Matplotlib: Used to create static, animated, or interactive plots.

 

Axes3D: Enables 3D plotting features in Matplotlib.

 

 2. Define Grid Range for X and Y Axes

x = np.linspace(-10, 10, 300)

y = np.linspace(-10, 10, 300)

X, Y = np.meshgrid(x, y)

np.linspace(...) creates 300 evenly spaced values from -10 to 10.

 

np.meshgrid(...) creates 2D grid coordinates from 1D x and y arrays for surface plotting.

 

 

 3. Calculate Distance from Two Wave Sources

r1 = np.sqrt((X + 3)**2 + (Y + 3)**2)

r2 = np.sqrt((X - 3)**2 + (Y - 3)**2)

r1: Distance from wave source 1 at point (-3, -3).

 

r2: Distance from wave source 2 at point (3, 3).

 

This is based on the Euclidean distance formula.

 

 4. Compute Interference Pattern (Z-axis Height)

Z = np.sin(r1) + np.sin(r2)

Simulates two wave fronts overlapping.

 

Adds sine waves from both sources to get constructive and destructive interference.

 

Result: Ripple-like surface of varying height values.

 

5. Create a 3D Plot Figure

fig = plt.figure(figsize=(10, 6))

ax = fig.add_subplot(111, projection='3d')

fig: Initializes the figure (canvas).

 

figsize: Width = 10 inches, Height = 6 inches.

 

ax: Adds a single 3D subplot for plotting the surface.

 

6. Plot the 3D Surface

ax.plot_surface(X, Y, Z, cmap='viridis', edgecolor='none')

Renders the 3D surface using the X, Y, and Z values.

cmap='viridis': Applies a smooth color gradient.

edgecolor='none': Removes mesh edges for a cleaner look.

 

7. Set Plot Title and Display

ax.set_title("3D Wave Interference Surface")

plt.show()

Adds a title to the plot.

plt.show() displays the plot window with the 3D surface.


Gravitational Wave Simulation Pattern using Python

 


import numpy as np

import matplotlib.pyplot as plt

from mpl_toolkits.mplot3d import Axes3D

x = np.linspace(-5, 5, 100)

y = np.linspace(-5, 5, 100)

X, Y = np.meshgrid(x, y)

frequency=3

wavelength=2

amplitude=1

time=0

Z = amplitude * np.sin(frequency * (X**2 + Y**2)**0.5 - time) * np.exp(-0.2 * (X**2 + Y**2))

fig=plt.figure(figsize=(10,7))

ax=fig.add_subplot(111,projection="3d")

ax.plot_surface(X,Y,Z,cmap="coolwarm",edgecolor="none")

ax.set_xlabel("X Axis")

ax.set_ylabel("Y Axis")

ax.set_zlabel("Space Time Curvature")

ax.set_title("Gravitation tides Wave simulation")

ax.set_xticks([])

ax.set_yticks([])

ax.set_zticks([])

plt.show()

#source code --> clcoding.com 

Code Explanation:

1. Import Required Libraries

 import numpy as np

import matplotlib.pyplot as plt

from mpl_toolkits.mplot3d import Axes3D

NumPy (np): Used for numerical computations and generating grid points.

 Matplotlib (plt): Used for plotting the 3D gravitational wave surface.

 mpl_toolkits.mplot3d: Enables 3D plotting.

 

2. 2Define the Grid for the Simulation

 x = np.linspace(-5, 5, 100)  # X-axis range (-5 to 5) with 100 points

y = np.linspace(-5, 5, 100)  # Y-axis range (-5 to 5) with 100 points

X, Y = np.meshgrid(x, y)     # Create a 2D mesh grid from x and y values

np.linspace(-5, 5, 100): Creates 100 evenly spaced points in the range [-5, 5] for x and y axes.

 np.meshgrid(x, y): Generates a grid of (X, Y) coordinates, forming a 2D plane where the wave will be calculated.

 

3.Define Gravitational Wave Parameters

 frequency = 3  # Number of oscillations per unit distance

wavelength = 2  # Distance between peaks (not directly used here)

amplitude = 1  # Maximum wave height

time = 0  # Static snapshot (can animate later)

frequency: Controls how many oscillations (wave peaks) occur in the simulation.

 wavelength: Represents the distance between peaks (not directly used in this equation).

 amplitude: Defines the height of the wave (maximum space-time distortion).

 time = 0: For a static snapshot; can be animated to show real-time wave evolution.

 

4. Compute the 3D Gravitational Wave Surface

Z = amplitude * np.sin(frequency * (X**2 + Y**2)**0.5 - time) * np.exp(-0.2 * (X**2 + Y**2))

This equation models the gravitational wave pattern:

Wave Component (sin(f * r - t)):

 r = (X² + Y²)^(0.5): Represents the radial distance from the center (like ripples on water).

 sin(frequency * r - time): Creates oscillations (wave-like structure).

 Damping Component (exp(-0.2 * r^2)):

 The exponential decay ensures that waves fade as they move outward.

 Models how gravitational waves weaken over long distances (like real astrophysical waves).

 Multiplication with amplitude: Scales the wave intensity.

 

5.Create the 3D Figure and Axes

fig = plt.figure(figsize=(10, 7))

ax = fig.add_subplot(111, projection="3d")

figsize=(10,7): Sets the figure size for a better view.

 ax = fig.add_subplot(111, projection="3d"): Creates a 3D plot using Matplotlib.

 

6.Plot the Gravitational Wave Surface

 ax.plot_surface(X, Y, Z, cmap="coolwarm", edgecolor="none")

plot_surface(X, Y, Z): Creates a 3D surface plot from the computed values.

 cmap="coolwarm": Uses a blue-red colormap to highlight the wave crests and troughs.

 edgecolor="none": Removes edge lines for a smooth visualization.

 

7. Add Labels and Title

ax.set_xlabel("X Axis")

ax.set_ylabel("Y Axis")

ax.set_zlabel("Space-Time Curvature")

ax.set_title(" Gravitational Tides – 3D Gravitational Wave Simulation")

Labels each axis to indicate spatial directions and wave intensity.

 Title describes the astrophysical concept being visualized.

 

8.Remove Grid Ticks for a Clean Look

ax.set_xticks([])

ax.set_yticks([])

ax.set_zticks([])

Removes axis ticks to make the plot clean and visually appealing.

 
9. Display the Final 3D Plot

 plt.show()

Displays the gravitational wave simulation.


Popular Posts

Categories

100 Python Programs for Beginner (108) AI (41) Android (24) AngularJS (1) Api (2) Assembly Language (2) aws (17) Azure (7) BI (10) book (4) Books (200) C (77) C# (12) C++ (83) Course (67) Coursera (253) Cybersecurity (25) Data Analysis (3) Data Analytics (4) data management (11) Data Science (149) Data Strucures (8) Deep Learning (21) Django (16) Downloads (3) edx (2) Engineering (14) Euron (29) Events (6) Excel (13) Factorial (1) Finance (6) flask (3) flutter (1) FPL (17) Generative AI (11) Google (38) Hadoop (3) HTML Quiz (1) HTML&CSS (47) IBM (30) IoT (1) IS (25) Java (93) Java quiz (1) Leet Code (4) Machine Learning (86) Meta (22) MICHIGAN (5) microsoft (4) Nvidia (4) Pandas (4) PHP (20) Projects (29) pyth (1) Python (1067) Python Coding Challenge (465) Python Quiz (137) Python Tips (5) Questions (2) R (70) React (6) Scripting (3) security (3) Selenium Webdriver (4) Software (17) SQL (42) UX Research (1) web application (8) Web development (4) web scraping (2)

Followers

Python Coding for Kids ( Free Demo for Everyone)