Skip to content

Commit 286e6b6

Browse files
committed
Add design diagram and update text in plot-api and plotting-libraries NBs
1 parent 52c2244 commit 286e6b6

File tree

3 files changed

+185
-30
lines changed

3 files changed

+185
-30
lines changed

notebooks/02-methods/01-plotting-libraries.ipynb

Lines changed: 55 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,41 @@
55
"metadata": {},
66
"source": [
77
"# Plotting Libraries\n",
8-
"---"
8+
"---\n",
9+
"\n",
10+
"We will introduce functionality from two visualization libraries and how they are being utilized by UXarray for unstructured grids visualization purposes. \n",
11+
"\n",
12+
"Before diving deep into these, looking into the current snapshot of the UXarray visualization design through a simple Unified Modelling Language (UML)-like diagram could be helpful to better understand UXarray's relation with such libraries. "
13+
]
14+
},
15+
{
16+
"cell_type": "markdown",
17+
"metadata": {},
18+
"source": [
19+
":::{note}\n",
20+
"The following design diagram is actually provided in the [Plotting API](../03-uxarray-vis/01-plot-api.ipynb) section along with key takeaways about it. We highly recommend to check them out as well.\n",
21+
":::"
22+
]
23+
},
24+
{
25+
"cell_type": "markdown",
26+
"metadata": {},
27+
"source": [
28+
"## UXarray Plotting API Design"
29+
]
30+
},
31+
{
32+
"cell_type": "markdown",
33+
"metadata": {},
34+
"source": [
35+
"<img src=\"../images/plotting_api/uxarray-plot-api-design.png\" alt=\"UXarray Plotting API Design\" width=\"800\"/>"
36+
]
37+
},
38+
{
39+
"cell_type": "markdown",
40+
"metadata": {},
41+
"source": [
42+
"No, let us look into the visulization libraries that UXarray relies upon or provides some interface with."
943
]
1044
},
1145
{
@@ -117,14 +151,16 @@
117151
}
118152
},
119153
"source": [
120-
"### TODO: SpatialPandas"
154+
"### Spatialpandas"
121155
]
122156
},
123157
{
124158
"cell_type": "markdown",
125159
"metadata": {},
126160
"source": [
127-
"Coming soon!"
161+
"Spatialpandas is a package that provides Pandas extension arrays for spatial/geometric operations. This package has an element called `GeoDataFrame`, which can be used directly by packages from the HoloViz stack such as hvPlot, Datashader, Holoviews, and Geoviews. Therefore, UXarray provides Grid conversions to `GeoDataFrame` to allow the user to perform visualizations direclty in HoloViz packages rather than needing to use our UXarray plotting functions. \n",
162+
"\n",
163+
"Because this cookbook's main goal is to showcase UXarray's own visulization capabilities, we will not detail this conversion here but provide a link to a [UXarray usage example](https://uxarray.readthedocs.io/en/latest/examples/005-to-geodataframe-for-holoviz.html) that demonstrates this."
128164
]
129165
},
130166
{
@@ -151,7 +187,7 @@
151187
"\n",
152188
"We still support Matplotlib as a backend option in our visualization functionality, which will be covered in the next chapter. \n",
153189
"\n",
154-
"We also provide conversion functions from UXarray to Matplotlib data structures such as collections, which can be utilized for visualization directly in Matplotlib after the conversion."
190+
"Moreover, just like conversion to `Spatialpandas.GeoDataFrame`, we provide conversion functions from UXarray to Matplotlib data structures such as collections, which can be utilized for visualizations directly in Matplotlib after the conversion."
155191
]
156192
},
157193
{
@@ -163,8 +199,17 @@
163199
}
164200
},
165201
"source": [
166-
"### TODO: Collections \n",
167-
"Coming soon! TODO: https://matplotlib.org/stable/api/collections_api.html"
202+
"### Collections \n",
203+
"Detailed information about Matplotlib's Collections API can be found [here](https://matplotlib.org/stable/api/collections_api.html). In Uxarray, conversions to `LineCollection` and `PolyCollection` are provided for visualizing Grid Geometries and data variables, respectively. "
204+
]
205+
},
206+
{
207+
"cell_type": "markdown",
208+
"metadata": {},
209+
"source": [
210+
":::{warning}\n",
211+
"While these conversion functions have already been released, we have observed some issues with the resulting Matplotlib plots after the exceution of these functions, and the bug-fixing of that is WIP. Hence, we don't have an officially released documentation/example about these functions yet.\n",
212+
":::"
168213
]
169214
},
170215
{
@@ -176,7 +221,7 @@
176221
}
177222
},
178223
"source": [
179-
"### TODO: Cartopy"
224+
"### Cartopy"
180225
]
181226
},
182227
{
@@ -188,7 +233,9 @@
188233
}
189234
},
190235
"source": [
191-
"Coming soon!"
236+
"Cartopy is originally a Python library for cartographic visualizations with Matplotlib; however, they provide a number of features such as `crs`, i.e. Coordinate Reference Systems (a.k.a. projections), that are significant for cartographic visualizations.\n",
237+
"\n",
238+
"While UXarray does not rely upon Cartopy, we support projections through our visualization functions with the help of `Cartopy.crs`. The use of such projections in the UXarray functions will be showcased in the next chapter; thus, let us stop at this point."
192239
]
193240
}
194241
],

0 commit comments

Comments
 (0)