Skip to content

Refat0011/math-visualization-assignment

Repository files navigation

Math Visualization Assignment

📌 Description

This project is a Python-based mathematical visualization and student score analysis system developed using NumPy and Matplotlib.

The project demonstrates how mathematical functions and datasets can be visualized using different types of graphs and prediction models. It includes function plotting, custom equation visualization, student score analysis, and best-fit line prediction.


🚀 Features

  • Plot multiple mathematical functions in one figure
  • Visualize a custom mathematical equation
  • Generate scatter plots for score comparison
  • Create histograms for score distribution
  • Display student performance using bar charts
  • Predict final scores using a best-fit regression line
  • Automatically save all generated graphs as PNG files

🛠️ Technologies Used

  • Python 3.x
  • NumPy
  • Matplotlib

⚙️ Requirements

  • Python 3.8 or higher
  • Required libraries:
pip install numpy matplotlib

▶️ How to Run

Step 1: Clone or Download the Repository

git clone https://github.com/your-username/math-visualization-assignment.git
cd math-visualization-assignment

OR download ZIP and extract it.


Step 2: Run the Program

python task8.py

📊 Generated Output Files

After running the program, the following graph images will be generated automatically:

function_plot.png
own_equation.png
score_scatter.png
score_histogram.png
score_bar_chart.png
score_prediction.png

📈 Visualization Details

Function Plot

Visualizes:

  • Linear function
  • Quadratic function
  • Sine function
  • Damped cosine function

Custom Equation Plot

Displays a smooth custom mathematical equation using cubic and trigonometric functions.

Scatter Plot

Shows the relationship between midterm and final scores.

Histogram

Displays the distribution of total student scores.

Bar Chart

Compares total scores of all students visually.

Best-Fit Prediction Plot

Uses NumPy polynomial fitting to predict final scores from midterm scores.


💡 Importance of Visualization

Visualization helps us understand mathematical functions and data patterns more clearly. Graphs make relationships, trends, and comparisons easier to analyze and interpret.

The most useful graph in this assignment was the best-fit prediction graph because it demonstrates how mathematical modeling can be used for prediction and analysis.


🔬 Role of NumPy and Matplotlib

NumPy

Used for:

  • Mathematical calculations
  • Array handling
  • Equation generation
  • Linear prediction using np.polyfit()

Matplotlib

Used for:

  • Creating graphs and plots
  • Data visualization
  • Styling charts with labels, legends, and grids

📷 Generated Graphs

Function Visualization

Function Plot


Student Score Bar Chart

Student Score Bar Chart


Prediction Graph

Prediction Graph

👤 Author

Refat


📄 License

This project is licensed under the MIT License.

About

Python project for mathematical function visualization and student score data analysis using NumPy and Matplotlib.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages