Skip to content

Commit

Permalink
added legends to plots
Browse files Browse the repository at this point in the history
  • Loading branch information
daslu committed Dec 30, 2024
1 parent 1cb3e59 commit bbfe515
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions notebooks/noj_book/linear_regression_intro.clj
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ simple-linear-data-model
;; Tableplot makes this convenient:

(-> simple-linear-data
plotly/layer-point
plotly/layer-smooth)
(plotly/layer-point {:=name "data"})
(plotly/layer-smooth {:=name "prediction"}))

;; Alternatively, we can build the regression line explicitly.
;; We'll obtain predictions and then plot them:
Expand All @@ -162,8 +162,9 @@ simple-linear-data-model
(tc/map-columns :prediction
[:x]
simple-linear-data-model)
plotly/layer-point
(plotly/layer-smooth {:=y :prediction}))
(plotly/layer-point {:=name "data"})
(plotly/layer-smooth {:=y :prediction
:=name "prediction"}))

;; ## Multiple linear regression

Expand Down

0 comments on commit bbfe515

Please sign in to comment.