Skip to content

Commit cc3066b

Browse files
committed
draw
1 parent 4f4a560 commit cc3066b

File tree

10 files changed

+2568
-4446
lines changed

10 files changed

+2568
-4446
lines changed

docs/gallery/3d.ipynb

Lines changed: 209 additions & 360 deletions
Large diffs are not rendered by default.

docs/gallery/basic.ipynb

Lines changed: 492 additions & 735 deletions
Large diffs are not rendered by default.

docs/gallery/facets.ipynb

Lines changed: 294 additions & 531 deletions
Large diffs are not rendered by default.

docs/gallery/maps.ipynb

Lines changed: 175 additions & 435 deletions
Large diffs are not rendered by default.

docs/gallery/networks.ipynb

Lines changed: 139 additions & 326 deletions
Large diffs are not rendered by default.

docs/gallery/statistical.ipynb

Lines changed: 316 additions & 539 deletions
Large diffs are not rendered by default.

docs/gallery/theming.ipynb

Lines changed: 364 additions & 672 deletions
Large diffs are not rendered by default.

docs/gallery/timeseries.ipynb

Lines changed: 240 additions & 488 deletions
Large diffs are not rendered by default.

docs/getting-started.ipynb

Lines changed: 243 additions & 252 deletions
Large diffs are not rendered by default.

docs/index.ipynb

Lines changed: 96 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -1,111 +1,99 @@
11
{
2-
"nbformat": 4,
3-
"nbformat_minor": 5,
4-
"metadata": {
5-
"kernelspec": {
6-
"display_name": "Python 3",
7-
"language": "python",
8-
"name": "python3"
9-
}
2+
"nbformat": 4,
3+
"nbformat_minor": 5,
4+
"metadata": {
5+
"kernelspec": {
6+
"display_name": "Python 3",
7+
"language": "python",
8+
"name": "python3"
9+
}
10+
},
11+
"cells": [
12+
{
13+
"cell_type": "markdown",
14+
"metadata": {},
15+
"source": [
16+
"# ggplotly\n",
17+
"\n",
18+
"A data visualization library for Python that combines the **grammar of graphics** from ggplot2 with the **interactivity** of Plotly.\n",
19+
"\n",
20+
"## Why ggplotly?\n",
21+
"\n",
22+
"- **Familiar syntax** - If you know ggplot2 from R, you'll feel right at home\n",
23+
"- **Interactive plots** - Powered by Plotly for zooming, panning, and hover tooltips\n",
24+
"- **Jupyter-friendly** - Plots render automatically in notebooks\n",
25+
"- **Comprehensive** - 90+ ggplot2-equivalent functions\n",
26+
"\n",
27+
"## Quick Example"
28+
]
1029
},
11-
"cells": [
12-
{
13-
"cell_type": "markdown",
14-
"metadata": {},
15-
"source": [
16-
"# ggplotly\n",
17-
"\n",
18-
"A data visualization library for Python that combines the **grammar of graphics** from ggplot2 with the **interactivity** of Plotly.\n",
19-
"\n",
20-
"## Why ggplotly?\n",
21-
"\n",
22-
"- **Familiar syntax** - If you know ggplot2 from R, you'll feel right at home\n",
23-
"- **Interactive plots** - Powered by Plotly for zooming, panning, and hover tooltips\n",
24-
"- **Jupyter-friendly** - Plots render automatically in notebooks\n",
25-
"- **Comprehensive** - 90+ ggplot2-equivalent functions\n",
26-
"\n",
27-
"## Quick Example"
28-
]
29-
},
30-
{
31-
"cell_type": "code",
32-
"execution_count": null,
33-
"metadata": {},
34-
"outputs": [],
35-
"source": [
36-
"from ggplotly import *\n",
37-
"import pandas as pd\n",
38-
"\n",
39-
"df = pd.DataFrame({\n",
40-
" 'x': [1, 2, 3, 4, 5],\n",
41-
" 'y': [1, 4, 9, 16, 25],\n",
42-
" 'group': ['A', 'A', 'B', 'B', 'B']\n",
43-
"})\n",
44-
"\n",
45-
"# Simple scatter plot with color mapping\n",
46-
"ggplot(df, aes(x='x', y='y', color='group')) + geom_point(size=10) + theme_minimal()"
47-
]
48-
},
49-
{
50-
"cell_type": "markdown",
51-
"metadata": {},
52-
"source": [
53-
"## Installation\n",
54-
"\n",
55-
"```bash\n",
56-
"pip install ggplotly\n",
57-
"```\n",
58-
"\n",
59-
"## What's Included\n",
60-
"\n",
61-
"| Category | Count | Examples |\n",
62-
"|----------|-------|----------|\n",
63-
"| **Geoms** | 34 | `geom_point`, `geom_line`, `geom_bar`, `geom_boxplot`, `geom_map` |\n",
64-
"| **Scales** | 17 | `scale_color_manual`, `scale_fill_gradient`, `scale_x_log10` |\n",
65-
"| **Themes** | 9 | `theme_minimal`, `theme_dark`, `theme_bbc`, `theme_nytimes` |\n",
66-
"| **Stats** | 7 | `stat_smooth`, `stat_count`, `stat_density` |\n",
67-
"| **Coords** | 4 | `coord_flip`, `coord_polar`, `coord_sf` |\n",
68-
"| **Facets** | 2 | `facet_wrap`, `facet_grid` |\n",
69-
"\n",
70-
"## Gallery\n",
71-
"\n",
72-
"Explore examples organized by visualization type:\n",
73-
"\n",
74-
"- **[Basic Charts](gallery/basic.ipynb)** - Scatter, line, bar, histograms, box plots\n",
75-
"- **[Statistical](gallery/statistical.ipynb)** - Smoothing, density, error bars, summaries\n",
76-
"- **[Time Series](gallery/timeseries.ipynb)** - Date axes, range plots, candlesticks, OHLC\n",
77-
"- **[Geographic Maps](gallery/maps.ipynb)** - Choropleths, projections, point maps\n",
78-
"- **[3D Visualizations](gallery/3d.ipynb)** - Scatter, surfaces, wireframes\n",
79-
"- **[Network Graphs](gallery/networks.ipynb)** - Edge bundling, sea routes\n",
80-
"- **[Multi-Panel (Facets)](gallery/facets.ipynb)** - Small multiples, facet_wrap, facet_grid\n",
81-
"- **[Theming](gallery/theming.ipynb)** - Custom themes, publication-ready styling\n",
82-
"\n",
83-
"## Coming from R?\n",
84-
"\n",
85-
"ggplotly aims for API compatibility with ggplot2. Most code translates directly:\n",
86-
"\n",
87-
"**R (ggplot2):**\n",
88-
"```r\n",
89-
"ggplot(mpg, aes(x = displ, y = hwy, color = class)) +\n",
90-
" geom_point() +\n",
91-
" theme_minimal() +\n",
92-
" labs(title = \"Fuel Efficiency\")\n",
93-
"```\n",
94-
"\n",
95-
"**Python (ggplotly):**\n",
96-
"```python\n",
97-
"ggplot(mpg, aes(x='displ', y='hwy', color='class')) + \\\n",
98-
" geom_point() + \\\n",
99-
" theme_minimal() + \\\n",
100-
" labs(title='Fuel Efficiency')\n",
101-
"```\n",
102-
"\n",
103-
"The main differences:\n",
104-
"\n",
105-
"- Column names are strings: `x='column'` not `x = column`\n",
106-
"- Use `\\` or parentheses for line continuation\n",
107-
"- Import with `from ggplotly import *`"
108-
]
109-
}
110-
]
30+
{
31+
"cell_type": "code",
32+
"execution_count": null,
33+
"metadata": {},
34+
"outputs": [],
35+
"source": "from ggplotly import *\nimport pandas as pd\n\ndf = pd.DataFrame({\n 'x': [1, 2, 3, 4, 5],\n 'y': [1, 4, 9, 16, 25],\n 'group': ['A', 'A', 'B', 'B', 'B']\n})\n\n# Simple scatter plot with color mapping\n(ggplot(df, aes(x='x', y='y', color='group')) + geom_point(size=10) + theme_minimal()).draw()"
36+
},
37+
{
38+
"cell_type": "markdown",
39+
"metadata": {},
40+
"source": [
41+
"## Installation\n",
42+
"\n",
43+
"```bash\n",
44+
"pip install ggplotly\n",
45+
"```\n",
46+
"\n",
47+
"## What's Included\n",
48+
"\n",
49+
"| Category | Count | Examples |\n",
50+
"|----------|-------|----------|\n",
51+
"| **Geoms** | 34 | `geom_point`, `geom_line`, `geom_bar`, `geom_boxplot`, `geom_map` |\n",
52+
"| **Scales** | 17 | `scale_color_manual`, `scale_fill_gradient`, `scale_x_log10` |\n",
53+
"| **Themes** | 9 | `theme_minimal`, `theme_dark`, `theme_bbc`, `theme_nytimes` |\n",
54+
"| **Stats** | 7 | `stat_smooth`, `stat_count`, `stat_density` |\n",
55+
"| **Coords** | 4 | `coord_flip`, `coord_polar`, `coord_sf` |\n",
56+
"| **Facets** | 2 | `facet_wrap`, `facet_grid` |\n",
57+
"\n",
58+
"## Gallery\n",
59+
"\n",
60+
"Explore examples organized by visualization type:\n",
61+
"\n",
62+
"- **[Basic Charts](gallery/basic.ipynb)** - Scatter, line, bar, histograms, box plots\n",
63+
"- **[Statistical](gallery/statistical.ipynb)** - Smoothing, density, error bars, summaries\n",
64+
"- **[Time Series](gallery/timeseries.ipynb)** - Date axes, range plots, candlesticks, OHLC\n",
65+
"- **[Geographic Maps](gallery/maps.ipynb)** - Choropleths, projections, point maps\n",
66+
"- **[3D Visualizations](gallery/3d.ipynb)** - Scatter, surfaces, wireframes\n",
67+
"- **[Network Graphs](gallery/networks.ipynb)** - Edge bundling, sea routes\n",
68+
"- **[Multi-Panel (Facets)](gallery/facets.ipynb)** - Small multiples, facet_wrap, facet_grid\n",
69+
"- **[Theming](gallery/theming.ipynb)** - Custom themes, publication-ready styling\n",
70+
"\n",
71+
"## Coming from R?\n",
72+
"\n",
73+
"ggplotly aims for API compatibility with ggplot2. Most code translates directly:\n",
74+
"\n",
75+
"**R (ggplot2):**\n",
76+
"```r\n",
77+
"ggplot(mpg, aes(x = displ, y = hwy, color = class)) +\n",
78+
" geom_point() +\n",
79+
" theme_minimal() +\n",
80+
" labs(title = \"Fuel Efficiency\")\n",
81+
"```\n",
82+
"\n",
83+
"**Python (ggplotly):**\n",
84+
"```python\n",
85+
"ggplot(mpg, aes(x='displ', y='hwy', color='class')) + \\\n",
86+
" geom_point() + \\\n",
87+
" theme_minimal() + \\\n",
88+
" labs(title='Fuel Efficiency')\n",
89+
"```\n",
90+
"\n",
91+
"The main differences:\n",
92+
"\n",
93+
"- Column names are strings: `x='column'` not `x = column`\n",
94+
"- Use `\\` or parentheses for line continuation\n",
95+
"- Import with `from ggplotly import *`"
96+
]
97+
}
98+
]
11199
}

0 commit comments

Comments
 (0)