|
6 | 6 | "display_name": "Python 3", |
7 | 7 | "language": "python", |
8 | 8 | "name": "python3" |
9 | | - }, |
10 | | - "language_info": { |
11 | | - "name": "python", |
12 | | - "version": "3.12.0" |
13 | 9 | } |
14 | 10 | }, |
15 | 11 | "cells": [ |
|
46 | 42 | " 'group': ['A', 'A', 'B', 'B', 'B']\n", |
47 | 43 | "})\n", |
48 | 44 | "\n", |
49 | | - "# Simple scatter plot\n", |
50 | | - "ggplot(df, aes(x='x', y='y')) + geom_point()\n", |
51 | | - "\n", |
52 | | - "# With color mapping and theme\n", |
53 | | - "ggplot(df, aes(x='x', y='y', color='group')) + geom_point() + theme_minimal()\n", |
54 | | - "\n", |
55 | | - "# Faceted plot\n", |
56 | | - "ggplot(df, aes(x='x', y='y')) + geom_point() + facet_wrap('group')" |
| 45 | + "# Simple scatter plot with color mapping\n", |
| 46 | + "ggplot(df, aes(x='x', y='y', color='group')) + geom_point(size=10) + theme_minimal()" |
57 | 47 | ] |
58 | 48 | }, |
59 | 49 | { |
|
81 | 71 | "\n", |
82 | 72 | "Explore examples organized by visualization type:\n", |
83 | 73 | "\n", |
84 | | - "- **[Basic Charts](gallery/basic.md)** - Scatter, line, bar, histograms, box plots\n", |
85 | | - "- **[Statistical](gallery/statistical.md)** - Smoothing, density, error bars, summaries\n", |
86 | | - "- **[Time Series](gallery/timeseries.md)** - Date axes, range plots, candlesticks, OHLC\n", |
87 | | - "- **[Geographic Maps](gallery/maps.md)** - Choropleths, projections, point maps\n", |
88 | | - "- **[3D Visualizations](gallery/3d.md)** - Scatter, surfaces, wireframes\n", |
89 | | - "- **[Network Graphs](gallery/networks.md)** - Edge bundling, sea routes\n", |
90 | | - "- **[Multi-Panel (Facets)](gallery/facets.md)** - Small multiples, facet_wrap, facet_grid\n", |
91 | | - "- **[Theming](gallery/theming.md)** - Custom themes, publication-ready styling\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", |
92 | 82 | "\n", |
93 | 83 | "## Coming from R?\n", |
94 | 84 | "\n", |
95 | 85 | "ggplotly aims for API compatibility with ggplot2. Most code translates directly:\n", |
96 | 86 | "\n", |
97 | | - "=== \"R (ggplot2)\"\n", |
98 | | - "\n", |
99 | | - " ```r\n", |
100 | | - " ggplot(mpg, aes(x = displ, y = hwy, color = class)) +\n", |
101 | | - " geom_point() +\n", |
102 | | - " theme_minimal() +\n", |
103 | | - " labs(title = \"Fuel Efficiency\")\n", |
104 | | - " ```\n", |
105 | | - "\n", |
106 | | - "=== \"Python (ggplotly)\"\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", |
107 | 94 | "\n", |
108 | | - " ```python\n", |
109 | | - " ggplot(mpg, aes(x='displ', y='hwy', color='class')) + \\\n", |
110 | | - " geom_point() + \\\n", |
111 | | - " theme_minimal() + \\\n", |
112 | | - " labs(title='Fuel Efficiency')\n", |
113 | | - " ```\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", |
114 | 102 | "\n", |
115 | 103 | "The main differences:\n", |
116 | 104 | "\n", |
|
0 commit comments