Skip to content

Commit 5debad0

Browse files
committed
updated nb
1 parent 3c8232d commit 5debad0

3 files changed

Lines changed: 1365 additions & 23 deletions

File tree

DP1/300_Science_Demos/311_Interactive_data_visualization/311_1_Single_interactive_plots.ipynb

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"tags": []
1313
},
1414
"source": [
15-
"# 311.1. Interactive data visualization for single interactive plots \n",
15+
"# 311.1. Single interactive plots \n",
1616
"\n",
1717
"<div style=\"max-width:300px; float: left; margin-right: 1em\">\n",
1818
"\n",
@@ -34,7 +34,7 @@
3434
"id": "3a5eb145-e5e9-401e-8bb9-c83126d3a5af",
3535
"metadata": {},
3636
"source": [
37-
"**Learning objective:** Interactive catalog data visualizations for single interactive plots.\n",
37+
"**Learning objective:** Interactive catalog data visualizations for single plots.\n",
3838
"\n",
3939
"**LSST data products:** `Object` table\n",
4040
"\n",
@@ -522,7 +522,7 @@
522522
"id": "3f9b40eb-3b60-443a-830b-0254f294954b",
523523
"metadata": {},
524524
"source": [
525-
"### 3.1. Single plots\n",
525+
"### 3.1. Scatter plot\n",
526526
"\n",
527527
"The basic core primitives of HoloViews are [Elements](http://holoviews.org/Reference_Manual/holoviews.element.html) (`hv.Element`). \n",
528528
"Elements are simple wrappers for data which provide a semantically \n",
@@ -563,6 +563,14 @@
563563
"The `data20K` set contains many columns. If no columns are specified explicitly, the first 2 columns are taken for x and y respectively by the [Scatter Element](https://holoviews.org/reference/elements/bokeh/Scatter.html)."
564564
]
565565
},
566+
{
567+
"cell_type": "markdown",
568+
"id": "95a219b6-b881-44b0-b595-2e22db43b0cf",
569+
"metadata": {},
570+
"source": [
571+
"### 3.2. Hover tool"
572+
]
573+
},
566574
{
567575
"cell_type": "markdown",
568576
"id": "81578561-b7f2-4ecf-883c-c31bab35fa5b",
@@ -649,14 +657,22 @@
649657
"id": "c5a5694d-f490-4e54-ab5c-efdcdadef049",
650658
"metadata": {},
651659
"source": [
652-
"> Figure 2: Same as Fig 1, but plotted with purple points and selected columns.\n",
660+
"> Figure 2: Same as Fig 1, but plotted with purple points, and a hover tool showing the selected columns.\n",
653661
"\n",
654662
"Hover the mouse over the plot above and see only the selected columns' data are displayed.\n",
655663
"\n",
656664
"It might be necessary to zoom in until points are distinguishable in order to notice how\n",
657665
"the hover tool box contents list only three properties per point."
658666
]
659667
},
668+
{
669+
"cell_type": "markdown",
670+
"id": "b1ba2b77-d2e6-4721-a994-5a5dc25b1fd4",
671+
"metadata": {},
672+
"source": [
673+
"### 3.3. Histogram"
674+
]
675+
},
660676
{
661677
"cell_type": "markdown",
662678
"id": "6a831208-22a9-469c-9516-ed0b717ba9de",

DP1/300_Science_Demos/311_Interactive_data_visualization/311_2_Paired_interactive_plots.ipynb

Lines changed: 1338 additions & 0 deletions
Large diffs are not rendered by default.

DP1/300_Science_Demos/311_Interactive_data_visualization/311_3_Large_datasets.ipynb

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"tags": []
1313
},
1414
"source": [
15-
"# 311.3. Interactive data visualization for large datasets\n",
15+
"# 311.3. Large datasets visualization\n",
1616
"\n",
1717
"<div style=\"max-width:300px; float: left; margin-right: 1em\">\n",
1818
"\n",
@@ -556,7 +556,7 @@
556556
"the bin sizes while panning and zooming. \n",
557557
"\n",
558558
"Zoom in all the way to see individual points (i.e., bins contain either zero or one count).\n",
559-
"Soom in far enough and find that the individual points are represented by extremely small\n",
559+
"Zoom in far enough and find that the individual points are represented by extremely small\n",
560560
"pixels in datashader that are difficult to see.\n",
561561
"A solution is to [dynspread](https://datashader.org/api.html#datashader.transfer_functions.dynspread) \n",
562562
"instead of datashade, which will preserve a finite size of the plotted points."
@@ -625,7 +625,7 @@
625625
"id": "6a9209cd-b1c9-45ae-a96a-5476106ce69a",
626626
"metadata": {},
627627
"source": [
628-
"### 3.2. Plotting thousands of data points\n",
628+
"### 3.2. Plotting a small set of data points\n",
629629
"\n",
630630
"Plot a color-colour diagram using Bokeh with a customized hover tool."
631631
]
@@ -787,11 +787,11 @@
787787
"id": "750fa9b4-8482-459e-a903-71a038c848dc",
788788
"metadata": {},
789789
"source": [
790-
"### 3.3. Plotting millions of data points\n",
790+
"### 3.3. Plotting a large set of data points\n",
791791
"\n",
792792
"The datasest of ~20K points used above is actually too small to demonstrate the power of datashader. \n",
793793
"\n",
794-
"Below, visualize the full >1 million object dataset returned by the query.\n",
794+
"Below, visualize the full >200k object dataset returned by the query.\n",
795795
"\n",
796796
"Create a Points Element for the data."
797797
]
@@ -913,7 +913,7 @@
913913
" & (points.data.y > box.bounds[1]) \\\n",
914914
" & (points.data.x < box.bounds[2]) \\\n",
915915
" & (points.data.y < box.bounds[3])\n",
916-
"print('The selection box contains %i data points'%(np.sum(selection)))"
916+
"print('The selection box contains {} data points'.format(np.sum(selection)))"
917917
]
918918
},
919919
{
@@ -1021,9 +1021,7 @@
10211021
"source": [
10221022
"> Figure 4: At right, Dec vs. RA as a 2-dimensional density map with a purple-green-yellow colormap. At left, a histogram (blue bar chart) of the fraction of objects in bins of r-band magnitude.\n",
10231023
"\n",
1024-
"Try changing the box selection and watch as the histogram is recomputed and displayed. \n",
1025-
"\n",
1026-
"Finally, delete the job."
1024+
"Try changing the box selection and watch as the histogram is recomputed and displayed. "
10271025
]
10281026
},
10291027
{
@@ -1034,16 +1032,6 @@
10341032
"tags": []
10351033
},
10361034
"outputs": [],
1037-
"source": [
1038-
"job.delete()"
1039-
]
1040-
},
1041-
{
1042-
"cell_type": "code",
1043-
"execution_count": null,
1044-
"id": "6f9a82f5-7319-4c72-8cb4-1b0e35b15050",
1045-
"metadata": {},
1046-
"outputs": [],
10471035
"source": []
10481036
}
10491037
],

0 commit comments

Comments
 (0)