Skip to content

Commit cd61698

Browse files
committed
running
1 parent 36b531e commit cd61698

File tree

5 files changed

+70
-11
lines changed

5 files changed

+70
-11
lines changed

docs/api/coords.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ Coordinate systems control how data coordinates are mapped to the plane of the g
88
options:
99
show_root_heading: true
1010

11+
::: ggplotly.coords.coord_fixed.coord_fixed
12+
options:
13+
show_root_heading: true
14+
1115
::: ggplotly.coords.coord_flip.coord_flip
1216
options:
1317
show_root_heading: true

docs/api/geoms.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ Geometric objects (geoms) are the visual elements used to represent data in a pl
6868
options:
6969
show_root_heading: true
7070

71+
::: ggplotly.geoms.geom_rect.geom_rect
72+
options:
73+
show_root_heading: true
74+
7175
## Statistical Geoms
7276

7377
::: ggplotly.geoms.geom_smooth.geom_smooth
@@ -88,6 +92,10 @@ Geometric objects (geoms) are the visual elements used to represent data in a pl
8892
options:
8993
show_root_heading: true
9094

95+
::: ggplotly.geoms.geom_label.geom_label
96+
options:
97+
show_root_heading: true
98+
9199
## Reference Lines
92100

93101
::: ggplotly.geoms.geom_hline.geom_hline

docs/api/scales.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,16 @@ Scales control how data values are mapped to visual properties like position, co
2222
options:
2323
show_root_heading: true
2424

25+
## Reversed Scales
26+
27+
::: ggplotly.scales.scale_x_reverse.scale_x_reverse
28+
options:
29+
show_root_heading: true
30+
31+
::: ggplotly.scales.scale_y_reverse.scale_y_reverse
32+
options:
33+
show_root_heading: true
34+
2535
## Date and Time Scales
2636

2737
::: ggplotly.scales.scale_x_date.scale_x_date

docs/guide/coordinates.ipynb

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,26 @@
6666
{
6767
"cell_type": "markdown",
6868
"metadata": {},
69-
"source": [
70-
"**xlim/ylim vs coord_cartesian:** `xlim()` and `ylim()` filter the data before plotting. `coord_cartesian()` zooms the view without removing data points. This matters for statistical calculations like `geom_smooth`.\n",
71-
"\n",
72-
"## coord_flip\n",
73-
"\n",
74-
"Flip x and y axes."
75-
]
69+
"source": "**xlim/ylim vs coord_cartesian:** `xlim()` and `ylim()` filter the data before plotting. `coord_cartesian()` zooms the view without removing data points. This matters for statistical calculations like `geom_smooth`.\n\n## coord_fixed\n\nFixed aspect ratio coordinates. Essential for maps and any plot where x and y must have equal scaling."
70+
},
71+
{
72+
"cell_type": "code",
73+
"source": "# Square data should appear as a square with ratio=1\nsquare_df = pd.DataFrame({'x': [0, 1, 1, 0, 0], 'y': [0, 0, 1, 1, 0]})\nggplot(square_df, aes(x='x', y='y')) + geom_path(size=2) + geom_point(size=10) + coord_fixed()",
74+
"metadata": {},
75+
"execution_count": null,
76+
"outputs": []
77+
},
78+
{
79+
"cell_type": "code",
80+
"source": "# With ratio=2, the square appears as a tall rectangle (y is stretched)\nggplot(square_df, aes(x='x', y='y')) + geom_path(size=2) + geom_point(size=10) + coord_fixed(ratio=2)",
81+
"metadata": {},
82+
"execution_count": null,
83+
"outputs": []
84+
},
85+
{
86+
"cell_type": "markdown",
87+
"source": "## coord_flip\n\nFlip x and y axes. Useful for horizontal bar charts and boxplots.",
88+
"metadata": {}
7689
},
7790
{
7891
"cell_type": "code",
@@ -104,11 +117,11 @@
104117
]
105118
},
106119
{
107-
"cell_type": "code",
120+
"cell_type": "markdown",
108121
"execution_count": null,
109122
"metadata": {},
110123
"outputs": [],
111-
"source": "# Pie chart\npie_df = pd.DataFrame({\n 'category': ['A', 'B', 'C', 'D'],\n 'value': [25, 30, 20, 25]\n})\npie_df['x'] = 1 # Constant x for stacked bar -> pie conversion\n\nggplot(pie_df, aes(x='x', y='value', fill='category')) + \\\n geom_bar(stat='identity', width=1) + \\\n coord_polar(theta='y')"
124+
"source": "### coord_polar Parameters\n\n```python\ncoord_polar(\n theta='x', # Variable mapped to angle ('x' or 'y')\n start=0, # Starting angle in radians\n direction=1 # 1 = clockwise, -1 = counter-clockwise\n)\n```\n\n## coord_sf\n\nFor geographic/spatial data with proper map projections. Requires geopandas.\n\n```python\nimport geopandas as gpd\n\n# Load geographic data\nworld = gpd.read_file(gpd.datasets.get_path('naturalearth_lowres'))\n\n# Plot with projection\nggplot(world) + geom_sf() + coord_sf(crs='EPSG:4326')\n```\n\n### Available Projections\n\n- `'mercator'` - Web Mercator (Google Maps style)\n- `'albers usa'` - Albers USA (good for US maps)\n- `'orthographic'` - Globe view\n- `'natural earth'` - Natural Earth projection\n- `'robinson'` - Robinson projection\n\n## Coordinate Reference\n\n| Function | Description |\n|----------|-------------|\n| `coord_cartesian` | Default Cartesian, zoom without clipping |\n| `coord_fixed` | Fixed aspect ratio (ratio=1 for equal scaling) |\n| `coord_flip` | Flip x and y axes |\n| `coord_polar` | Polar coordinates |\n| `coord_sf` | Geographic projections |"
112125
},
113126
{
114127
"cell_type": "markdown",

docs/guide/geoms.ipynb

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{
44
"cell_type": "markdown",
55
"metadata": {},
6-
"source": "# Geoms\n\nGeoms (geometric objects) are the visual elements that represent your data. ggplotly provides 44 geoms for different visualization types."
6+
"source": "# Geoms\n\nGeoms (geometric objects) are the visual elements that represent your data. ggplotly provides 46 geoms for different visualization types."
77
},
88
{
99
"cell_type": "code",
@@ -316,6 +316,18 @@
316316
"ggplot(ribbon_df, aes(x='date', ymin='lower', ymax='upper')) + geom_ribbon(alpha=0.3)"
317317
]
318318
},
319+
{
320+
"cell_type": "markdown",
321+
"source": "### geom_rect\n\nRectangles defined by xmin, xmax, ymin, ymax.",
322+
"metadata": {}
323+
},
324+
{
325+
"cell_type": "code",
326+
"source": "# Rectangle data\nrect_df = pd.DataFrame({\n 'xmin': [0, 2, 4],\n 'xmax': [1, 3, 5],\n 'ymin': [0, 1, 0.5],\n 'ymax': [2, 3, 2.5],\n 'category': ['A', 'B', 'C']\n})\n\nggplot(rect_df, aes(xmin='xmin', xmax='xmax', ymin='ymin', ymax='ymax', fill='category')) + geom_rect(alpha=0.7)",
327+
"metadata": {},
328+
"execution_count": null,
329+
"outputs": []
330+
},
319331
{
320332
"cell_type": "markdown",
321333
"metadata": {},
@@ -366,6 +378,18 @@
366378
"ggplot(bar_df, aes(x='category', y='count', label='count')) + geom_col() + geom_text()"
367379
]
368380
},
381+
{
382+
"cell_type": "markdown",
383+
"source": "### geom_label\n\nText labels with a background box.",
384+
"metadata": {}
385+
},
386+
{
387+
"cell_type": "code",
388+
"source": "ggplot(bar_df, aes(x='category', y='count', label='count')) + geom_col() + geom_label()",
389+
"metadata": {},
390+
"execution_count": null,
391+
"outputs": []
392+
},
369393
{
370394
"cell_type": "markdown",
371395
"metadata": {},
@@ -559,7 +583,7 @@
559583
{
560584
"cell_type": "markdown",
561585
"metadata": {},
562-
"source": "## Complete Geom List\n\n| Geom | Description |\n|------|-------------|\n| `geom_point` | Scatter plots |\n| `geom_line` | Line plots (sorted by x) |\n| `geom_lines` | Multi-series line plots |\n| `geom_path` | Path plots (data order) |\n| `geom_bar` | Bar charts |\n| `geom_col` | Column charts |\n| `geom_histogram` | Histograms |\n| `geom_boxplot` | Box plots |\n| `geom_violin` | Violin plots |\n| `geom_density` | Density plots |\n| `geom_area` | Area plots |\n| `geom_ribbon` | Ribbon plots |\n| `geom_smooth` | Smoothed lines |\n| `geom_tile` | Heatmaps |\n| `geom_text` | Text labels |\n| `geom_errorbar` | Error bars |\n| `geom_segment` | Line segments |\n| `geom_step` | Step plots |\n| `geom_rug` | Rug plots |\n| `geom_jitter` | Jittered points |\n| `geom_vline` | Vertical lines |\n| `geom_hline` | Horizontal lines |\n| `geom_abline` | Diagonal lines |\n| `geom_contour` | Contour lines |\n| `geom_contour_filled` | Filled contours |\n| `geom_map` | Choropleth maps |\n| `geom_sf` | Simple features |\n| `geom_range` | Range plots |\n| `geom_edgebundle` | Edge bundling |\n| `geom_searoute` | Sea routes |\n| `geom_fanchart` | Fan charts for uncertainty |\n| `geom_point_3d` | 3D points |\n| `geom_surface` | 3D surfaces |\n| `geom_wireframe` | 3D wireframes |\n| `geom_candlestick` | Candlestick charts |\n| `geom_ohlc` | OHLC charts |\n| `geom_waterfall` | Waterfall charts |\n| `geom_sankey` | Sankey flow diagrams |\n| `geom_stl` | STL decomposition plots |\n| `geom_acf` | Autocorrelation plots |\n| `geom_pacf` | Partial autocorrelation plots |\n| `geom_norm` | Normal distribution overlay |\n| `geom_qq` | Q-Q plots |\n| `geom_qq_line` | Q-Q reference line |"
586+
"source": "## Complete Geom List\n\n| Geom | Description |\n|------|-------------|\n| `geom_point` | Scatter plots |\n| `geom_line` | Line plots (sorted by x) |\n| `geom_lines` | Multi-series line plots |\n| `geom_path` | Path plots (data order) |\n| `geom_bar` | Bar charts |\n| `geom_col` | Column charts |\n| `geom_histogram` | Histograms |\n| `geom_boxplot` | Box plots |\n| `geom_violin` | Violin plots |\n| `geom_density` | Density plots |\n| `geom_area` | Area plots |\n| `geom_ribbon` | Ribbon plots |\n| `geom_rect` | Rectangles |\n| `geom_smooth` | Smoothed lines |\n| `geom_tile` | Heatmaps |\n| `geom_text` | Text labels |\n| `geom_label` | Text labels with background |\n| `geom_errorbar` | Error bars |\n| `geom_segment` | Line segments |\n| `geom_step` | Step plots |\n| `geom_rug` | Rug plots |\n| `geom_jitter` | Jittered points |\n| `geom_vline` | Vertical lines |\n| `geom_hline` | Horizontal lines |\n| `geom_abline` | Diagonal lines |\n| `geom_contour` | Contour lines |\n| `geom_contour_filled` | Filled contours |\n| `geom_map` | Choropleth maps |\n| `geom_sf` | Simple features |\n| `geom_range` | Range plots |\n| `geom_edgebundle` | Edge bundling |\n| `geom_searoute` | Sea routes |\n| `geom_fanchart` | Fan charts for uncertainty |\n| `geom_point_3d` | 3D points |\n| `geom_surface` | 3D surfaces |\n| `geom_wireframe` | 3D wireframes |\n| `geom_candlestick` | Candlestick charts |\n| `geom_ohlc` | OHLC charts |\n| `geom_waterfall` | Waterfall charts |\n| `geom_sankey` | Sankey flow diagrams |\n| `geom_stl` | STL decomposition plots |\n| `geom_acf` | Autocorrelation plots |\n| `geom_pacf` | Partial autocorrelation plots |\n| `geom_norm` | Normal distribution overlay |\n| `geom_qq` | Q-Q plots |\n| `geom_qq_line` | Q-Q reference line |"
563587
}
564588
],
565589
"metadata": {

0 commit comments

Comments
 (0)