Skip to content

Commit 08e1d5f

Browse files
committed
Update nextgen docs
1 parent 4cbffa9 commit 08e1d5f

5 files changed

Lines changed: 83 additions & 34 deletions

File tree

doc/nextgen/api.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ Plot interface
2222
Plot.facet
2323
Plot.pair
2424
Plot.configure
25+
Plot.limit
26+
Plot.label
2527
Plot.on
2628
Plot.plot
2729
Plot.save
@@ -36,6 +38,7 @@ Marks
3638

3739
Area
3840
Bar
41+
Bars
3942
Dot
4043
Line
4144
Lines

doc/nextgen/conf.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,16 @@
6161

6262
html_theme_options = {
6363
"show_prev_next": False,
64-
"page_sidebar_items": [],
64+
# "page_sidebar_items": [],
6565
}
6666

6767
html_context = {
6868
# other contexts
6969
"default_mode": "light"
7070
}
7171

72+
html_show_sourcelink = False
73+
7274
# Add any paths that contain custom static files (such as style sheets) here,
7375
# relative to this directory. They are copied after the builtin static files,
7476
# so a file named "default.css" will overwrite the builtin "default.css".
@@ -77,10 +79,13 @@
7779
html_logo = "_static/logo.svg"
7880

7981
html_sidebars = {
80-
# "**": [],
81-
"demo": ["page-toc"]
82+
"index": [],
83+
"demo": ["page-toc.html"],
8284
}
8385

86+
html_context= {
87+
"default_mode": "light",
88+
}
8489

8590
# -- Intersphinx ------------------------------------------------
8691

doc/nextgen/demo.ipynb

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@
637637
"metadata": {},
638638
"outputs": [],
639639
"source": [
640-
"so.Plot(planets, x=\"distance\").add(so.Bar(), so.Hist()).scale(x=\"log\")"
640+
"so.Plot(planets, x=\"distance\").add(so.Bars(), so.Hist()).scale(x=\"log\")"
641641
]
642642
},
643643
{
@@ -660,7 +660,7 @@
660660
" planets, x=\"distance\",\n",
661661
" color=(planets[\"number\"] > 1).rename(\"multiple\")\n",
662662
" )\n",
663-
" .add(so.Bar(), so.Hist(), so.Dodge())\n",
663+
" .add(so.Bars(), so.Hist(), so.Dodge())\n",
664664
" .scale(x=\"log\", color=so.Nominal())\n",
665665
")"
666666
]
@@ -821,6 +821,34 @@
821821
"Importantly, there's no distinction between \"axes-level\" and \"figure-level\" here. Any kind of plot can be faceted or paired by adding a method call to the `Plot` definition, without changing anything else about how you are creating the figure."
822822
]
823823
},
824+
{
825+
"cell_type": "markdown",
826+
"id": "9933b5fa-5b1a-4e05-a4d3-b2142e5337ef",
827+
"metadata": {},
828+
"source": [
829+
"------\n",
830+
"\n",
831+
"## Customization\n",
832+
"\n",
833+
"This API is less developed than other aspects of the new interface, but it will be possible to customize various aspects of the plot through the seaborn interface, without dropping down to matplotlib:"
834+
]
835+
},
836+
{
837+
"cell_type": "code",
838+
"execution_count": null,
839+
"id": "61c2e0e2-1df5-466d-a17e-0bc64d21f9f9",
840+
"metadata": {},
841+
"outputs": [],
842+
"source": [
843+
"(\n",
844+
" so.Plot(tips, \"day\", \"total_bill\", color=\"sex\")\n",
845+
" .add(so.Bar(), so.Agg(), so.Dodge())\n",
846+
" .scale(y=so.Continuous().label(like=\"${x:.0f}\"))\n",
847+
" .label(x=str.capitalize, y=\"Total bill\", color=None)\n",
848+
" .limit(y=(0, 28))\n",
849+
")"
850+
]
851+
},
824852
{
825853
"cell_type": "markdown",
826854
"id": "d1eff6ab-84dd-4b32-9923-3d29fb43a209",

doc/nextgen/index.ipynb

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,21 @@
4040
"id": "c76dbb00-20ee-4508-bca3-76a4763e5640",
4141
"metadata": {},
4242
"source": [
43-
"## Testing the alpha release\n",
43+
"## Testing the pre-release\n",
4444
"\n",
45-
"If you're interested, please install the alpha and kick the tires. It is very far from complete, so expect some rough edges and instability! But feedback will be very helpful in pushing this towards a more stable broad release:\n",
45+
"If you're interested, please install the pre-release and kick the tires. It is still a work in progress, so expect some rough edges and instability! But feedback will be very helpful in pushing this towards a more stable broad release:\n",
4646
"\n",
47-
" pip install https://github.com/mwaskom/seaborn/archive/refs/tags/v0.12.0a0.tar.gz\n",
47+
" pip install --pre seaborn"
48+
]
49+
},
50+
{
51+
"cell_type": "markdown",
52+
"id": "f194cc12-856a-4261-8717-462c290c9e51",
53+
"metadata": {},
54+
"source": [
55+
"## Preview components\n",
4856
"\n",
49-
"The documentation is still a work in progress, but there's a reasonably thorough demo of the main parts, and some basic API documentation for the existing classes."
57+
"The formal documentation is still a work-in-progress, so this preview serves as an introduction and reference for testing. There's a reasonably thorough demo of the main components and some basic API documentation for the existing classes:"
5058
]
5159
},
5260
{
@@ -57,8 +65,8 @@
5765
".. toctree::\n",
5866
" :maxdepth: 1\n",
5967
"\n",
60-
" demo\n",
61-
" api"
68+
" Demonstration <demo>\n",
69+
" API Overview <api>"
6270
]
6371
},
6472
{
@@ -76,7 +84,7 @@
7684
"\n",
7785
"So the new interface is designed to provide a more comprehensive experience, such that all of the steps involved in the creation of a reasonably-customized plot can be accomplished in the same way. And the compositional nature of the objects provides much more flexibility than currently exists in seaborn with a similar level of abstraction: this lets you focus on *what* you want to show rather than *how* to show it.\n",
7886
"\n",
79-
"One will note that the result looks a bit (a lot?) like ggplot. That's not unintentional, but the goal is also *not* to \"port ggplot2 to Python\". (If that's what you're looking for, check out the very nice [plotnine](https://plotnine.readthedocs.io/en/stable/) package). There is an immense amount of wisdom in the grammar of graphics and in its particular implementation as ggplot2. But, as languages, R and Python are just too different for idioms from one to feel natural when translated literally into the other. So while I have taken much inspiration from ggplot (along with vega-lite, d3, and other great libraries), I've also made plenty of choices differently, for better or for worse."
87+
"One will note that the result looks a bit (a lot?) like ggplot. That's not unintentional: while the original seaborn interface was never explicitly intended to implement a grammar of graphics, the redesign is. But the goal is also *not* to \"port ggplot2 to Python\". (If that's what you're looking for, check out the very nice [plotnine](https://plotnine.readthedocs.io/en/stable/) package). I do think that ggplot2 gets a lot right, especially its approach to layering. But, as languages, R and Python are just too different for idioms from one to feel natural when translated literally into the other. So while I have taken much inspiration from ggplot (along with vega-lite, d3, and other great libraries), I've also made plenty of choices differently, for better or for worse."
8088
]
8189
},
8290
{

doc/nextgen/index.rst

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -37,27 +37,31 @@ with the new interface:
3737

3838

3939

40-
Testing the alpha release
41-
-------------------------
40+
Testing the pre-release
41+
-----------------------
4242

43-
If you’re interested, please install the alpha and kick the tires. It is
44-
very far from complete, so expect some rough edges and instability! But
45-
feedback will be very helpful in pushing this towards a more stable
46-
broad release:
43+
If you’re interested, please install the pre-release and kick the tires.
44+
It is still a work in progress, so expect some rough edges and
45+
instability! But feedback will be very helpful in pushing this towards a
46+
more stable broad release:
4747

4848
::
4949

50-
pip install https://github.com/mwaskom/seaborn/archive/refs/tags/v0.12.0a0.tar.gz
50+
pip install --pre seaborn
5151

52-
The documentation is still a work in progress, but there’s a reasonably
53-
thorough demo of the main parts, and some basic API documentation for
54-
the existing classes.
52+
Preview components
53+
------------------
54+
55+
The formal documentation is still a work-in-progress, so this preview
56+
serves as an introduction and reference for testing. There’s a
57+
reasonably thorough demo of the main components and some basic API
58+
documentation for the existing classes:
5559

5660
.. toctree::
5761
:maxdepth: 1
5862

59-
demo
60-
api
63+
Demonstration <demo>
64+
API Overview <api>
6165

6266
Background and goals
6367
--------------------
@@ -91,14 +95,15 @@ currently exists in seaborn with a similar level of abstraction: this
9195
lets you focus on *what* you want to show rather than *how* to show it.
9296

9397
One will note that the result looks a bit (a lot?) like ggplot. That’s
94-
not unintentional, but the goal is also *not* to “port ggplot2 to
95-
Python”. (If that’s what you’re looking for, check out the very nice
96-
`plotnine <https://plotnine.readthedocs.io/en/stable/>`__ package).
97-
There is an immense amount of wisdom in the grammar of graphics and in
98-
its particular implementation as ggplot2. But, as languages, R and
99-
Python are just too different for idioms from one to feel natural when
100-
translated literally into the other. So while I have taken much
101-
inspiration from ggplot (along with vega-lite, d3, and other great
102-
libraries), I’ve also made plenty of choices differently, for better or
103-
for worse.
98+
not unintentional: while the original seaborn interface was never
99+
explicitly intended to implement a grammar of graphics, the redesign is.
100+
But the goal is also *not* to “port ggplot2 to Python”. (If that’s what
101+
you’re looking for, check out the very nice
102+
`plotnine <https://plotnine.readthedocs.io/en/stable/>`__ package). I do
103+
think that ggplot2 gets a lot right, especially its approach to
104+
layering. But, as languages, R and Python are just too different for
105+
idioms from one to feel natural when translated literally into the
106+
other. So while I have taken much inspiration from ggplot (along with
107+
vega-lite, d3, and other great libraries), I’ve also made plenty of
108+
choices differently, for better or for worse.
104109

0 commit comments

Comments
 (0)