Skip to content

Commit 7c451af

Browse files
Merge jupyterbook-chapter1 into main
Resolves merge conflict in .gitignore by combining both versions
2 parents 622d527 + 316d64b commit 7c451af

File tree

199 files changed

+4455
-31
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

199 files changed

+4455
-31
lines changed

.DS_Store

2 KB
Binary file not shown.

.gitignore

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,45 @@
1+
# Python
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
*.so
6+
.Python
7+
env/
8+
venv/
9+
.env
10+
11+
# Jupyter
12+
.ipynb_checkpoints/
13+
*.ipynb_checkpoints
14+
15+
# Jupyter Book build files
16+
jupyterbook/_build/
17+
jupyterbook/.jupyter_cache/
18+
119
# LaTeX build artifacts
220
*.aux
321
*.log
22+
*.out
423
*.toc
524
*.lof
625
*.lot
726
*.fls
8-
*.out
27+
*.fdb_latexmk
28+
*.synctex.gz
929
*.bbl
1030
*.blg
1131
*.lol
12-
*.fdb_latexmk
13-
*.synctex.gz
14-
15-
# Python artifacts
16-
__pycache__/
17-
*.py[cod]
1832

19-
# macOS Finder metadata
33+
# OS files
2034
.DS_Store
35+
Thumbs.db
2136

22-
# JupyterBook build artifacts
23-
jupyterbook/_build/
37+
# IDE
38+
.vscode/
39+
.idea/
40+
*.swp
41+
*.swo
42+
43+
# Other
44+
*.bak
45+
*.tmp

CLAUDE.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4+
5+
## Project Overview
6+
7+
This is the repository for "Matplotlib for Storytellers", a Python data visualization book that teaches frustrated matplotlib users how to craft good data visuals. The project contains:
8+
9+
- LaTeX source files for the book (main.tex and supporting files in tex/)
10+
- Python scripts generating matplotlib figures (python/)
11+
- Generated figure outputs (figures/)
12+
- Demo Jupyter notebooks (Demos/)
13+
- Data files for examples (Data/)
14+
15+
## Key Commands
16+
17+
### Building the Book
18+
```bash
19+
# Compile the LaTeX book
20+
pdflatex main.tex
21+
# Run multiple times if needed for references/TOC
22+
```
23+
24+
### Running Python Scripts
25+
```bash
26+
# Generate figures - scripts save to figures/ directory
27+
cd python/
28+
python <script-name>.py
29+
```
30+
31+
### Common Dependencies
32+
The project uses these Python libraries:
33+
- matplotlib
34+
- numpy
35+
- pandas
36+
- scipy
37+
- scikit-learn (sklearn)
38+
- ternary (optional, for ternary plots)
39+
40+
## Architecture Notes
41+
42+
1. **Figure Generation**: Python scripts in `python/` generate PDF figures saved to `figures/` subdirectories (mathplots/, poetryplots/, proseplots/, specialplots/)
43+
44+
2. **Book Structure**: The main LaTeX file `main.tex` includes chapters from `tex/` subdirectories:
45+
- prose/ - Core matplotlib concepts
46+
- poetry/ - Advanced visualizations
47+
- math/ - Mathematical interlude
48+
- special/ - Special topics (MDS, stats, ternary plots)
49+
50+
3. **Style Files**:
51+
- Custom matplotlib styles in `stylelib/`
52+
- LaTeX style definitions in `tex/customcolors.sty` and `tex/mplstyle.sty`
53+
54+
4. **Helper Functions**: Some scripts use helper modules like `nyt-helper-data.py`, `rps-br-helper.py`, and `speedo-functions.py`
55+
56+
## Working with Figures
57+
58+
When modifying or creating figures:
59+
1. Python scripts should save outputs to the appropriate `figures/` subdirectory
60+
2. Use consistent naming between .py files and their .pdf outputs
61+
3. Many scripts demonstrate specific matplotlib techniques mentioned in the book text
62+
63+
## Jupyter Book Conversion Guidelines
64+
65+
When converting LaTeX content to Jupyter Book format:
66+
67+
1. **Content Fidelity**: Keep the Jupyter Book content as close as possible to the LaTeX content. The primary goal is preserving the original text, code examples, and educational material.
68+
69+
2. **Acceptable Changes**:
70+
- Convert LaTeX syntax to Markdown (equations, formatting, etc.)
71+
- Adjust image paths and convert PDF figures to PNG format
72+
- Use Markdown-specific features for better web readability
73+
- Convert LaTeX cross-references to Markdown links
74+
75+
3. **Do NOT**:
76+
- Abbreviate or summarize content
77+
- Remove code examples or explanations
78+
- Change the pedagogical flow or structure
79+
- Add new content not present in the original LaTeX
80+
81+
4. **Figure Conversion**: Convert all PDF figures to PNG at 300 DPI for web compatibility while maintaining visual quality.

0 commit comments

Comments
 (0)