Skip to content

README.md final update #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

181 changes: 181 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
# 📊 Data Visualization with Matplotlib and Plotly

<!-- 📛 Project Badges -->
![Last Commit](https://img.shields.io/github/last-commit/DigiFenix777/python-crash-course-data-visualization-project)
![Top Language](https://img.shields.io/github/languages/top/DigiFenix777/python-crash-course-data-visualization-project)
![Repo Size](https://img.shields.io/github/repo-size/DigiFenix777/python-crash-course-data-visualization-project)
![Issues](https://img.shields.io/github/issues/DigiFenix777/python-crash-course-data-visualization-project)
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)


## 🔑 Executive Summary
This project explores **Python-powered data visualization** through Matplotlib and Plotly, focusing on both **static and interactive charts**. While the examples center on mathematics and simulations (cubes, random walks, dice rolls), the same visualization techniques directly apply to **cybersecurity workflows**, such as:

- Charting **attack frequency trends** over time.
- Mapping **geographic spread of incidents**.
- Creating interactive **dashboards for SOC and compliance reporting**.
- Communicating **risk insights to executives and auditors** with clarity.

👉 For recruiters and hiring managers: this project demonstrates my ability to transform raw data into **meaningful, visual insights**—a critical competency for cybersecurity analysis, reporting, and decision-making.

---

## 📌 Overview

This project covers end-to-end **data visualization practices** using Matplotlib (static plots) and Plotly (interactive plots). Key topics include:

- Plotting simple line and scatter graphs.
- Customizing styles, labels, colors, and tick marks.
- Using **colormaps** for clarity in large datasets.
- Saving plots automatically for portfolio inclusion.
- Simulating and visualizing **random walks**.
- Building **interactive dice roll simulations** with Plotly.

---

## 🧠 Skills & Concepts

- **Matplotlib basics** (line plots, scatter plots, colormaps).
- **Plotly Express** for interactive charting.
- Styling and scaling plots for readability.
- Object-oriented design with custom classes (`RandomWalk`, `Die`).
- Automating workflows with refactoring and list comprehensions.
- Professional Git/GitHub practices (branching, version control, repo hygiene).

---

## 🗂️ Repository Structure

```plaintext
data-visualization-project/
├── data/ # Input datasets or simulation outputs (empty)
├── html/ # Exported Die Roll plots in HTML format
│ ├── dice_visual_2d8.html
│ └── dice_visual_d6d10.html
├── images/portfolio/ # Exported static and interactive plots
│ ├── cubes_plot.png
│ ├── mod_random_walk_inferno.png
│ ├── mod_random_walk_purples.png
│ ├── random_walk_magma.png
│ ├── squares_plot.png
│ └── dice_multiplication.png
├── src/ # Python scripts for lessons & exercises
│ ├── dice_visual.py
│ ├── dice_visual_2d8.py
│ ├── dice_visual_3d6.py
│ ├── dice_visual_d6d10.py
│ ├── dice_visual_multiply_2d6.py
│ ├── die.py
│ ├── die_visual.py
│ ├── main.py
│ ├── mod_rw_visual.py
│ ├── modified_random_walk.py
│ ├── molecular_motion.py
│ ├── molecular_visual.py
│ ├── mpl_squares.py
│ ├── random_walk.py
│ ├── rw_plotly.py
│ ├── rw_visual.py
│ ├── scatter_cubes.py
│ ├── scatter_squares.py
│ └── main.py
├── tests/
├── .gitattributes
├── .gitignore
├── LICENSE
├── README.md
└── requirements.txt
```
## 🚀 How to Run

Clone this repo and move into the folder:
```bash
git clone git@github.com:your-username/project-data-visualization.git
cd project-data-visualization
```

(Optional) Create a virtual environment:
```bash
python3 -m venv .venv
source .venv/bin/activate
```

Install dependencies:
```bash
pip install -r requirements.txt
```

Run any exercise script, for example:
```bash
python src/scatter_cubes.py
```
## 🔎 Skills Spotlight


This project highlights:
- Python scripting for data visualization.
- Matplotlib & Plotly for both static and interactive charts.
- Designing simulations with object-oriented programming.
- Applying clean repo structure and GitHub portfolio practices.
- Building transferable skills for cybersecurity dashboards and incident reports.


---


## 📝 Lessons Learned

- Importance of styling and scaling plots for readability and accuracy.
- How random walks simulate unpredictable patterns (mirroring attacker behavior in networks).
- How dice simulations parallel probability and risk assessment in cybersecurity.
- Why reproducibility (requirements, clear structure, README) matters for collaboration and audits.
- How visualization bridges raw technical data and executive decision-making.

---


## 📊 Exercises Implemented

- **15-1: Cubes** → Plotted cubic numbers (5 & 5,000 points).
- **15-2: Colored Cubes** → Applied a colormap to cubes plot.
- **15-3: Molecular Motion** → Simulated pollen grain motion with line plots.
- **15-4: Modified Random Walks** → Adjusted parameters to explore behavior.
- **15-5: Refactoring** → Simplified fill_walk() for readability and maintainability.
- **15-6: Two D8s** → Simulated and plotted results of rolling two 8-sided dice.
- **15-7: Three Dice** → Simulated rolling three D6 dice (min=3, max=18).
- **15-8: Multiplication** → Visualized results of multiplying two dice rolls.
- **15-9: Die Comprehensions** → Used list comprehensions to simplify dice simulations.

---


## 🌍 Data Sources

Synthetic datasets generated in exercises (random walks, dice rolls).

Exercises and examples adapted from Python Crash Course, 3rd Edition by Eric Matthes (No Starch Press).


---


## 📚 Attribution

Based on exercises from:
Matthes, E. (2023). Python Crash Course (3rd ed.). No Starch Press.
Book website

---


## 🧩 License

Distributed under the MIT License.
See LICENSE for details.

---
3,885 changes: 3,885 additions & 0 deletions html/dice_visual_2d8.html

Large diffs are not rendered by default.

Binary file added images/portfolio/cubes_plot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/portfolio/mod_random_walk_inferno.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/portfolio/mod_random_walk_purples.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/portfolio/random_walk_magma.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/portfolio/squares_plot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/dice_visual_2d10_list_comp.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@
# Further customize chart.
fig.update_layout(xaxis_dtick=1)

fig.show()
# fig.show()
# fig.write_html('../html/dice_visual_2d8.html', '')
2 changes: 1 addition & 1 deletion src/mod_rw_visual.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Exercise 15.4 Modified Random Walks
# Exercise 15-5 Modified Random Walks
import matplotlib.pyplot as plt

from modified_random_walk import ModRandomWalk
Expand Down
2 changes: 1 addition & 1 deletion src/modified_random_walk.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Exercise 15-4 Modified Random Walks
# Exercise 15-4, 15-5 Modified Random Walks
from random import choice


Expand Down
4 changes: 2 additions & 2 deletions src/molecular_motion.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
ax.get_yaxis().set_visible(False)

# Print plot to screen
# plt.show()
plt.show()
# Save plot to file.
plt.savefig('15-3_molecular_motion.png', bbox_inches='tight')
# plt.savefig('15-3_molecular_motion.png', bbox_inches='tight')

keep_running = input("Make another walk? (y/n): ")
if keep_running == 'n':
Expand Down
4 changes: 2 additions & 2 deletions src/scatter_cubes.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@
ax.axis([0, 6_000, 0, 140_000_000_000])
ax.ticklabel_format(style='plain')

# plt.show()
plt.savefig('cubes_plot.png', bbox_inches='tight')
plt.show()
# plt.savefig('cubes_plot.png', bbox_inches='tight')