Skip to content

Commit

Permalink
tableplot_datavis_intro - WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
daslu committed Dec 25, 2024
1 parent ec337cc commit 0bad1f7
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions notebooks/noj_book/tableplot_datavis_intro.clj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
;; # Intro to data visualization with Tableplot
;; # Intro to data visualization with Tableplot - DRAFT 🛠

;; This tutorial will guide us through an exploration of the classic Iris dataset using the [Tableplot](https://scicloj.github.io/tableplot) library in Clojure. We will demonstrate how to use Tableplot's Plotly API to create various visualizations, while explaining the core ideas and functionality of the API.

Expand All @@ -20,7 +20,7 @@
;; - Explore the relationships between different variables in the dataset.
;; - Demonstrate how to customize plots and use different features of the API.

;; ## Loading the Iris Dataset
;; ## Looking into the Iris Dataset

;; First, let's look into the Iris dataset we have read
;; [in the datasets chapter](./noj_book.datasets).
Expand All @@ -43,7 +43,7 @@ datasets/iris
(plotly/layer-point
{:=x :sepal-length
:=y :sepal-width
:=mark-size 10}))
:=mark-size 7}))

;; This plot shows the distribution of sepal length and width for the flowers in the dataset.

Expand All @@ -56,7 +56,7 @@ datasets/iris
{:=x :sepal-length
:=y :sepal-width
:=color :species
:=mark-size 10}))
:=mark-size 7}))

;; Now, each species is represented by a different color, making it easier to see any patterns or differences between them.

Expand All @@ -69,7 +69,7 @@ datasets/iris
{:=x :petal-length
:=y :petal-width
:=color :species
:=mark-size 10}))
:=mark-size 7}))

;; This plot shows a clearer separation between species based on petal measurements compared to sepal measurements.

Expand Down Expand Up @@ -140,7 +140,7 @@ datasets/iris
:=y :sepal-width
:=color :species})
(plotly/layer-point
{:=mark-size 10})
{:=mark-size 7})
(plotly/layer-smooth))

;; This plot shows a scatter plot of sepal measurements with trend lines added for each species.
Expand All @@ -149,15 +149,15 @@ datasets/iris

;; Tableplot allows for customization of plot aesthetics.

;; ### Changing Marker Symbols
;; ### Changing Marker Sizes

(-> datasets/iris
(plotly/layer-point
{:=x :sepal-length
:=y :sepal-width
:=color :species
:=symbol :species
:=mark-size 10}))
:=mark-size 15}))

;; ### Adjusting Opacity

Expand All @@ -166,12 +166,12 @@ datasets/iris
{:=x :sepal-length
:=y :sepal-width
:=color :species
:=mark-size 10
:=mark-size 15
:=mark-opacity 0.6}))

;; ## Surface Plot (3D Visualization)
;; ## 3d Scatter Plot

;; We can create a surface plot to visualize relationships in three dimensions.
;; We can create a 3d scatter plot to visualize relationships in three dimensions.

(-> datasets/iris
(plotly/layer-point
Expand Down Expand Up @@ -242,6 +242,8 @@ datasets/iris

;; ## References

;; - [Tableplot documentation](https://scicloj.github.io/tableplot/)
;; - [Tableplot's reference for its Plotly API](https://scicloj.github.io/tableplot/tableplot_book.plotly_reference.html)
;; - [Tableplot GitHub Repository](https://github.com/scicloj/tableplot)
;; - [Plotly.js Documentation](https://plotly.com/javascript/)
;; - [Tablecloth Documentation](https://scicloj.github.io/tablecloth/)
Expand Down

0 comments on commit 0bad1f7

Please sign in to comment.