|
5 | 5 | "metadata": {}, |
6 | 6 | "source": [ |
7 | 7 | "# 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." |
9 | 43 | ] |
10 | 44 | }, |
11 | 45 | { |
|
117 | 151 | } |
118 | 152 | }, |
119 | 153 | "source": [ |
120 | | - "### TODO: SpatialPandas" |
| 154 | + "### Spatialpandas" |
121 | 155 | ] |
122 | 156 | }, |
123 | 157 | { |
124 | 158 | "cell_type": "markdown", |
125 | 159 | "metadata": {}, |
126 | 160 | "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." |
128 | 164 | ] |
129 | 165 | }, |
130 | 166 | { |
|
151 | 187 | "\n", |
152 | 188 | "We still support Matplotlib as a backend option in our visualization functionality, which will be covered in the next chapter. \n", |
153 | 189 | "\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." |
155 | 191 | ] |
156 | 192 | }, |
157 | 193 | { |
|
163 | 199 | } |
164 | 200 | }, |
165 | 201 | "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 | + ":::" |
168 | 213 | ] |
169 | 214 | }, |
170 | 215 | { |
|
176 | 221 | } |
177 | 222 | }, |
178 | 223 | "source": [ |
179 | | - "### TODO: Cartopy" |
| 224 | + "### Cartopy" |
180 | 225 | ] |
181 | 226 | }, |
182 | 227 | { |
|
188 | 233 | } |
189 | 234 | }, |
190 | 235 | "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." |
192 | 239 | ] |
193 | 240 | } |
194 | 241 | ], |
|
0 commit comments