@@ -16,13 +16,26 @@ language_info:
1616
1717+++ {"slideshow": {"slide_type": ""}, "tags": [ ] }
1818
19- # folium (and embeds)
19+ # x-refs
20+
21+ playing with labeled cells, embed, figure ...
22+
23+ trying with cells that produce:
24+
25+ - a 2d plot
26+ - a pandas df
27+ - a folium map
2028
2129+++
2230
2331## matplotlib output
2432
25- +++
33+ ``` {code-cell} ipython3
34+ import numpy as np
35+ import matplotlib.pyplot as plt
36+ ```
37+
38+ +++ {"jp-MarkdownHeadingCollapsed": true}
2639
2740### the source cell
2841
@@ -31,9 +44,6 @@ we put a label `the-labeled-plot` on the following code cell
3144``` {code-cell} ipython3
3245#| label: the-labeled-plot
3346
34- import numpy as np
35- import matplotlib.pyplot as plt
36-
3747X = np.linspace(0, 2*np.pi)
3848Y = np.sin(X)
3949
@@ -43,11 +53,77 @@ plt.plot(X, Y);
4353
4454### referencing ` the-labeled-plot `
4555
46- - with a `  ` ![ ] ( #the-labeled-plot )
47- - same without the ! [ ] ( #the-labeled-plot )
48- - with an ` embed ` directive
49- ``` {embed} #the-labeled-plot
50- ```
56+ +++
57+
58+ ---
59+
60+ +++
61+
62+ #### WITHOUT -- the exclamation mark
63+
64+ we write this
65+ ` [some visible text](#the-labeled-plot) `
66+ [ some visible text] ( #the-labeled-plot )
67+
68+ +++
69+
70+ ---
71+
72+ +++
73+
74+ #### WITH -- an exclamation mark
75+ we write this
76+ `  ` (text in brackets doesn't seem to be used)
77+ ![ ] ( #the-labeled-plot )
78+
79+ +++
80+
81+ ---
82+
83+ +++
84+
85+ #### EMBED instead
86+
87+ now we use an ` embed ` directive - with a sharp ` # ` in front of the label
88+
89+ ``` {embed} #the-labeled-plot
90+ ```
91+
92+ +++
93+
94+ ---
95+
96+ +++
97+
98+ #### FIGURE instead
99+
100+ now we use an ` figure ` directive - same thing, with a sharp ` # ` in front of the label
101+
102+ ``` {figure} #the-labeled-plot
103+ some figure text goes here
104+ ```
105+
106+ +++
107+
108+ ---
109+ ---
110+
111+ +++
112+
113+ ## pandas df
114+
115+ ``` {code-cell} ipython3
116+ import seaborn as sns
117+ ```
118+
119+ ``` {code-cell} ipython3
120+ #| label: the-labeled-map
121+
122+ titanic = sns.load_dataset("titanic")
123+ titanic.head(2)
124+ ```
125+
126+ hover on [ this text to view the dataframe] ( #the-labeled-map )
51127
52128+++
53129
@@ -84,14 +160,6 @@ def paris_map():
84160paris_map()
85161```
86162
87- ### the embedded result with an ` {embed} ` directive
88-
89- once this is done we can show the cell output
90- ``` {embed} #the-labeled-map
91- ```
92-
93- +++
94-
95- ### same but with a ` ![]() `
163+ ### referencing the map
96164
97- ![ alternative text ] ( #the-labeled-map )
165+ [ this should show a map ? ] ( #the-labeled-map )
0 commit comments