-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patha_case_for_genart.qmd
1677 lines (1155 loc) · 43.1 KB
/
a_case_for_genart.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
---
title: "It's All About Perspective"
subtitle: "Making A Case for Generative Art"
author: "Meghan Harris, MPH"
institute: "Posit::conf(2023)"
date: "09-20-2023"
date-format: "MMMM Do, YYYY | YYYY-MM-DD"
format:
revealjs:
slide-number: true
width: 1690
height: 1080
margin: .2
editor: source
linkcolor: "#ffffff"
highlight-style: github
code-copy: true
code-overflow: scroll
code-block-bg: true
transition: fade
css: "scripts/style.css"
title-slide-attributes:
data-background-image: "images/background.png"
data-background-size: "stretch"
data-background-position: "center"
data-background-color: "#1a1a1a"
data-notes: "Hello, Im Meghan Harris, I'm a data scientist at the Prostate Cancer Clinical Trials Consortium, and I'm also a generative artist that's here to introduce you all to generative art and a different approach to learning data science. Before I do that, I have to say, I feel like I'm only standing here today because I stopped working 10 months ago. I didn't quit my job or anything, but as you can see here..."
transition: fade
---
## {background-color="#1a1a1a" background-image="images/intro_back.png" background-size="cover"}
<center>
![A snapchat picture of me showing my baby bump at 37 weeks](images/whale_bump.jpg){width="700"}
</center>
::: notes
- I was very pregnant and ready to pop.
- I gave birth to a beautiful baby.
- Went on maternity leave for 6 months and I know it sounds fake, but...
:::
## {background-color="#1a1a1a" background-image="images/intro_back.png" background-size="cover"}
<center>
![A shot of me coding in R Studio while watching a baby monitor](images/unreal.jpg){width="1000"}
</center>
::: notes
- I actually found time to code on leave.
- But I had a rule for myself
- to only code if it was for fun stuff like art...
:::
## {background-color="#1a1a1a" background-image="images/intro_back.png" background-size="cover"}
<center>
![Some artwork I made on maternity leave](images/roundup.png){.false width="1300"}
</center>
::: notes
- By the end of my leave
- I was amazed at how coding art like this
- helped with the practical data science skills I needed when I returned to work
- I want to give a tiny glimpse into how that was possible
:::
## {background-color="#1a1a1a" background-image="images/background1.png" background-size="cover"}
<br> <br> <br> <br> <br> <br> <br> <br> <br>
<center>
<h1>Disclaimer</h1>
</center>
::: notes
- I want to give a disclaimer
- it's OK if you don't know how to make generative art.
- It's OK if you don't even like art.
- It's OK if you don't know much about data science.
- My hope is that you treat this talk like a "choose-your-own-adventure".
- Just like those old goosebumps books...
- I'm not the only old person in here who remembers those right?
- They kinda looked like this...
:::
## {background-color="#7a2929"}
::: columns
::: {.column width="50%"}
![](images/ga1.png)
:::
::: {.column width="50%"}
![](images/ga2.png)
:::
[ @KazeKomboArt]{style="float:right"}
:::
::: notes
So whether you're here for the art {pause}
:::
## {background-color="#7a2929"}
::: columns
::: {.column width="50%"}
![](images/ds1.png)
:::
::: {.column width="50%"}
![](images/ds2.png)
:::
:::
[ @KazeKomboArt]{style="float:right"}
::: notes
or the data science... {pause}
:::
## {background-color="#7a2929"}
<center>![](images/learn1.png){width="50%"}</center>
[ @KazeKomboArt]{style="float:right"}
::: notes
...or just learning, {pause}
- I'm hoping there will be something for you to take away from this today.
- Aren't these pictures awesome?! - My awesome husband made these characters for me!
- I love them
- So let's get started....
:::
## What are we Talking About Today? {.black background-color="#1a1a1a" background-image="images/map1.png" background-size="cover"}
::: {#bullet}
- <h4><span>What is Generative Art?</span></h4>
:::
::: notes
So, a quick run-down of our time today...
:::
## What are we Talking About Today? {.black background-color="#1a1a1a" background-image="images/map2.png" background-size="cover"}
::: {#bullet}
- <h4><span>What is Generative Art?</span></h4>
- <h4><span>How Can we Make Generative Art in R or Python?</span></h4>
:::
## What are we Talking About Today? {.black background-color="#1a1a1a" background-image="images/map3.png" background-size="cover"}
::: {#bullet}
- <h4><span>What is Generative Art?</span></h4>
- <h4><span>How Can we Make Generative Art in R or Python?</span></h4>
- <h4><span>Benefits of Creating Generative Art</span></h4>
:::
## What are we Talking About Today? {.black background-color="#1a1a1a" background-image="images/map4.png" background-size="cover"}
::: {#bullet}
- <h4><span>What is Generative Art?</span></h4>
- <h4><span>How Can we Make Generative Art in R or Python?</span></h4>
- <h4><span>Benefits of Creating Generative Art</span></h4>
- <h4><span>What is Data Science?</span></h4>
:::
## What are we Talking About Today? {.black background-color="#1a1a1a" background-image="images/map5.png" background-size="cover"}
::: {#bullet}
- <h4><span>What is Generative Art?</span></h4>
- <h4><span>How Can we Make Generative Art in R or Python?</span></h4>
- <h4><span>Benefits of Creating Generative Art</span></h4>
- <h4><span>What is Data Science?</span></h4>
- <h4><span>Examples of How Generative Art Translates into Data Science</span></h4>
:::
## What are we Talking About Today? {.black background-color="#1a1a1a" background-image="images/map6.png" background-size="cover"}
::: {#bullet}
- <h4><span>What is Generative Art?</span></h4>
- <h4><span>How Can we Make Generative Art in R or Python?</span></h4>
- <h4><span>Benefits of Creating Generative Art</span></h4>
- <h4><span>What is Data Science?</span></h4>
- <h4><span>Examples of How Generative Art Translates into Data Science</span></h4>
- <h4><span>Final Thoughts</span></h4>
:::
## {background-color="#1a1a1a" background-image="images/background2.png" background-size="cover"}
<br> <br> <br> <br> <br> <br> <br> <br> <br>
<center>
<h1>What is Generative Art?</h1>
</center>
::: notes
So I want to pose a question to you all, you don't have to answer me out loud, but just think for a second, what do ***you*** think generative art is?
- Is it opening up a digital sketchpad and physically drawing on a screen?
- Or creating outputs from AI art platforms like Dall-E or Lensa?
I couldn't find an official definition for you all, so I'm making one right here, right now.
:::
## What is Generative Art? {.purple background-color="#6c4161"}
<br> <br>
In this room today, Generative Art is defined as:
<br> <br>
> **Artwork created through a program in any language or interface.**
<br><br>
::: {.fragment}
> <center>**As long as a program executes the generation of the art...<br>...it can be considered generative art.**</center>
:::
::: notes
Now this is vague and general, and yes. that's on Purpose<br>
- Because I can guarantee you, that there are multiple definitions of generative art floating around in this room right now.
- I'm also assuming that at least 1 of you is thinking of AI art.
- And I just want to say We are not talking about AI art today
- and i do have two statements regarding that...
:::
## What is Generative Art? {.purple background-color="#6c4161"}
<br><br>
<center>
> While all AI Art is generative art... <br>
<br>
::: fragment
> ...All generative art **IS NOT** AI art
:::
<br>
::: fragment
&
<br>
> While some generative art is randomly calculated by the computer... <br>
:::
<br>
::: fragment
> ...Some generative art is intentional and deliberately calculated by a human
:::
</center>
::: notes
What do I mean by that?<br>
Hopefully I can show you when we talk about<br>
How we can make it in R or Python<br>
:::
## {background-color="#1a1a1a" background-image="images/background3.png" background-size="cover"}
<br> <br> <br> <br> <br> <br> <br> <br> <br>
<center>
<h1>How Can we Make Generative Art<br>in R or Python?</h1>
</center>
::: notes
- Safe to say we have some "data" people in here and that some of you have probably created data visualizations with R or Python.
- If you know how to make visuals in R or Python, you're already so close to making generative art... (NEXT ->)
:::
## How Can we Make Generative Art in R or Python? {.mutedblue background-color="#4e5483"}
<br> <br> <br>
<center>
::: {#bluequote}
> Making generative art might not be as hard as you think...
>
> You just need ✨data✨ and to
>
> [Think outside the grid](https://thetidytrekker.com/post/thinking-outside-the-grid/thinking-outside-the-grid.html) 📊 of your favorite graphical software/package
:::
</center>
::: notes
"MIGHT NOT BE AS HARD AS YOU THINK" (Read the damn slide girl)
Now...
- I'm going to be real with ya'll, I don't have enough time here to truly explain in depth how to make complicated art with code
- I mean, Posit, Jenny, Hadley, ya'll got my e-mail, I can help with the art workshop next year if ya'll want, I'm just saying, but for right now
- All of the code examples for the art you'll see today is on this talk's github repo
- so you all can listen to me attempt to give a crash course right now,
- but after the dust is settled and you're back home, know that these resources are available to you to digest later.
- Because we are about to Zoom
:::
## How Can we Make Generative Art in R or Python? {.mutedblue background-color="#4e5483"}
<br><br>
<center>
<h3>Some "Primitive" Graphical Tools🛠</h3>
</center>
<br> <br>
::: columns
::: {.column width="50%"}
<center>**R Packages** ![](images/r_logo.png)</center>
<center>
- [`ggplot2`](https://ggplot2.tidyverse.org/)
- Base R w/ `plot()` or [`grid`](https://www.stat.auckland.ac.nz/~paul/grid/grid.html)
- [`r2D3`](https://rstudio.github.io/r2d3/)
- [`lattice`](http://lattice.r-forge.r-project.org/)
</center>
:::
::: {.column width="50%"}
<center>**Python Libraries** ![](images/python_logo.png)</center>
<center>
- [`plotnine`](https://plotnine.readthedocs.io/en/stable/)
- [`pillow` (PIL)](https://pypi.org/project/Pillow/)
- [`matplotlib`](https://matplotlib.org/)
- [`turtle`](https://docs.python.org/3/library/turtle.html)
</center>
:::
:::
<br><br>
<center>*If it lets you plot data, it will let you make art...*</center>
::: notes
- When first creating art
- It's helpful: picking a data visualization tool that you're comfortable with
- For me, that's ggplot2 in R
- But you can choose whatever language and graphical tool you'd like.
- The main point is: if a tool lets you plot data, it will let you make art.
- The challenge comes in: when you need to understand how data translates into a visual.
- Without fail, whenever I do a talk like this, there's always somebody who says...
:::
## How Can we Make Generative Art in R or Python? {.mutedblue background-color="#4e5483"}
<br><br>
<center>
::: {#bluequote}
> "I don't understand how you get the data to put into \[ *insert your graphical tool of choice here* \]"
:::
<br><br><br>
![](images/confused.gif){width="50%"}
</center>
::: notes
And I get it. It can be tricky, so let's stop for a minute and Imagine that we want to draw a line on a piece paper, like, in the real world...
:::
## How Can we Make Generative Art in R or Python? {.mutedblue background-color="#4e5483"}
<br> <br>
<center>![](images/line_ex.gif){.false}</center>
::: notes
- If someone is physically able to pick up a pen and use it
- We might assume it's easy for them to draw a single line on a paper
- We can argue that maybe a perfectly straight line might be hard right?...
:::
## How Can we Make Generative Art in R or Python? {.mutedblue background-color="#4e5483"}
<center>![](images/graph_ex.gif){.false width="60%"}</center>
::: notes
- So let's use graph paper instead
- Now this may be way easier for people b/c we have a visual guide of grid lines,
- But if you stop and think...where have we probably seen a grid like this before?
- Possibly in your favorite visualization tools
- for me, it's ggplot2.
- The grid lines reminds me of the coordinate system all ggplots are created on...
:::
## How Can we Make Generative Art in R or Python? {.mutedblue background-color="#4e5483"}
<center>![](images/graph_ex2.gif){.false width="60%"}</center>
::: notes
- So knowing this..
- we can set values to every mark we make on the paper...
- Just like a coordinate system in your favorite graphical tool would.
- We have 4 coordinate points in this line, each with an x and y value
- Where we have 4 values from 1 to 4 on the X axis horizontally
- and a constant value of 1 on the y axis repeated 4 times to make a straight horizontal line.
- Now this may seem overly simple, but this is all it takes to create generative art.
- The trick here is that you need to understand the relationship between the visuals you want, the data you need and the coordinate system you set.
- Let's look at this in more detail in Python..
:::
## How Can we Make Generative Art in R or Python? {.mutedblue background-color="#4e5483"}
::: {style="padding-bottom: 20px;"}
<u>**A Simple Example *(In Python)***</u>
:::
::: columns
::: {.column width="55%"}
```{python, echo = TRUE, eval = FALSE, `code-line-numbers`="2-4"}
#====================================================#
# Library Load-in-------------------------------------
from plotnine import *
import pandas as pd
# Image Options---------------------------------------
#Set the color
orange_hex = "#FFBB58"
#Set the width
chonk = 10
# Data Creation----------------------------------------
line = pd.DataFrame({"x" : list(range(0,5)),
"y" : 1,
"color" : orange_hex,
"size" : chonk})
# Plot Creation----------------------------------------
orange_line = (ggplot(line, aes("x", "y"))+
geom_path(color = line.loc[:,"color"],
size = line.loc[:,"size"])+
coord_equal(ylim = (0,3), xlim = (0,4)))
#View the plot
print(orange_line)
```
:::
::: {.column width="45%"}
<br><br>
<center>![](images/python_ex1.png){width="100%"}</center>
:::
:::
::: notes
- There can be different approaches to our last example, but here's one way in python.
- Now don't get too bogged down in the specifics of the code,
- We just want to focus on the process here
- First you load in your libraries you need
:::
## How Can we Make Generative Art in R or Python? {.mutedblue background-color="#4e5483"}
::: {style="padding-bottom: 20px;"}
<u>**A Simple Example *(In Python)***</u>
:::
::: columns
::: {.column width="55%"}
```{python, echo = TRUE, eval = FALSE, `code-line-numbers`="6-11"}
#====================================================#
# Library Load-in-------------------------------------
from plotnine import *
import pandas as pd
# Image Options---------------------------------------
#Set the color
orange_hex = "#FFBB58"
#Set the width
chonk = 10
# Data Creation----------------------------------------
line = pd.DataFrame({"x" : list(range(0,5)),
"y" : 1,
"color" : orange_hex,
"size" : chonk})
# Plot Creation----------------------------------------
orange_line = (ggplot(line, aes("x", "y"))+
geom_path(color = line.loc[:,"color"],
size = line.loc[:,"size"])+
coord_equal(ylim = (0,3), xlim = (0,4)))
#View the plot
print(orange_line)
```
:::
::: {.column width="45%"}
<br><br>
<center>![](images/python_ex1.png){width="100%"}</center>
:::
:::
::: notes
- then you can do some prep for your data.
- Here, we're storing values in objects for the color and size of our line
:::
## How Can we Make Generative Art in R or Python? {.mutedblue background-color="#4e5483"}
::: {style="padding-bottom: 20px;"}
<u>**A Simple Example *(In Python)***</u>
:::
::: columns
::: {.column width="55%"}
```{python, echo = TRUE, eval = FALSE, `code-line-numbers`="13-17"}
#====================================================#
# Library Load-in-------------------------------------
from plotnine import *
import pandas as pd
# Image Options---------------------------------------
#Set the color
orange_hex = "#FFBB58"
#Set the width
chonk = 10
# Data Creation----------------------------------------
line = pd.DataFrame({"x" : list(range(0,5)),
"y" : 1,
"color" : orange_hex,
"size" : chonk})
# Plot Creation----------------------------------------
orange_line = (ggplot(line, aes("x", "y"))+
geom_path(color = line.loc[:,"color"],
size = line.loc[:,"size"])+
coord_equal(ylim = (0,3), xlim = (0,4)))
#View the plot
print(orange_line)
```
:::
::: {.column width="45%"}
<br><br>
<center>![](images/python_ex1.png){width="100%"}</center>
:::
:::
::: notes
- Next, the Most important step is creating the data frame
- here its a pandas dataframe with x and y coordinates, and values for our color and size of our line
:::
## How Can we Make Generative Art in R or Python? {.mutedblue background-color="#4e5483"}
::: {style="padding-bottom: 20px;"}
<u>**A Simple Example *(In Python)***</u>
:::
::: columns
::: {.column width="55%"}
```{python, echo = TRUE, eval = FALSE, `code-line-numbers`="19-26"}
#====================================================#
# Library Load-in-------------------------------------
from plotnine import *
import pandas as pd
# Image Options---------------------------------------
#Set the color
orange_hex = "#FFBB58"
#Set the width
chonk = 10
# Data Creation----------------------------------------
line = pd.DataFrame({"x" : list(range(0,5)),
"y" : 1,
"color" : orange_hex,
"size" : chonk})
# Plot Creation----------------------------------------
orange_line = (ggplot(line, aes("x", "y"))+
geom_path(color = line.loc[:,"color"],
size = line.loc[:,"size"])+
coord_equal(ylim = (0,3), xlim = (0,4)))
#View the plot
print(orange_line)
```
:::
::: {.column width="45%"}
<br><br>
<center>![](images/python_ex1.png){width="100%"}</center>
:::
:::
::: notes
- Finally, we feed this dataframe into the set of ggplot fxs at the bottom to create the plot
- And after we print it, we get the image on the right
- This was a simple example, so let's step it up a bit in R
:::
## How Can we Make Generative Art in R or Python? {.mutedblue background-color="#4e5483"}
::: {style="padding-bottom: 20px;"}
<u>**A More Complicated Example *(In R)***</u>
:::
::: columns
::: {.column width="60%"}
```{r, echo = TRUE, eval = FALSE, `code-line-numbers`="1-14,17-18,23-24"}
# Library Load-ins---------------------------------
library(ggplot2); library(dplyr); library(artpack)
# Let's make: a "cityscape" with a sky, moon, and buildings
# Data for the sky---------------------
df_sky <-
tibble(x = 0,
xend = 4,
y = seq(0,3, length = 100),
yend = y,
color = art_pals("sunnyside", 100),
linewidth = 10
)
# Plot Creation-----------------------
df_sky |>
ggplot(aes(x, y, xend = xend, yend = yend)) +
theme_void() +
coord_cartesian(expand = FALSE,
xlim = c(0,4),
ylim = c(0,3)) +
geom_segment(color = df_sky$color,
linewidth = df_sky$linewidth)
#...
```
:::
::: {.column width="40%"}
<br><br>
<center>![](images/sky_ggplot.png){width="100%"}</center>
:::
:::
::: notes
- Again, we're not focusing on the code, per se,
- but we just want to observe the general relationship going on between the data and the visual
- Again, we start with your packages (say them)
- and an idea of what to make - cityscape, sky, moon, and buildings
- First I decide to make the sky in the background, so..
- I make a data frame with numbers that when mapped on the ggplot will look like horizontal lines filling the page
- i also add variables for the color and size of the lines
- and when this data frame is plotted with the geom_segment fx we've added to our ggplot, we get this beautiful gradient on the right.
:::
## How Can we Make Generative Art in R or Python? {.mutedblue background-color="#4e5483"}
::: {style="padding-bottom: 20px;"}
<u>**A More Complicated Example *(In R)***</u>
:::
::: columns
::: {.column width="60%"}
```{r, echo = TRUE, eval = FALSE, `code-line-numbers`="1-8,10,18-24"}
# Data for the moon----------------------------------------------
df_moon <- tibble(
x = 2,
y = 1.5,
size = 100,
fill = "#f0e4bb",
color = "#000000"
)
# Plot Creation--------------------------------------------------
df_sky |>
ggplot(aes(x,y, xend = xend, yend = yend)) +
theme_void() +
coord_cartesian(xlim = c(0,4), ylim = c(0,3),
expand = FALSE) +
geom_segment(color = df_sky$color,
linewidth = df_sky$linewidth) +
geom_point(data = df_moon, aes(x,y),
color = df_moon$color,
fill = df_moon$fill,
size = df_moon$size,
shape = 21,
stroke = .5,
inherit.aes = FALSE)
#...
```
:::
::: {.column width="40%"}
<br><br>
<center>![](images/moon_ggplot.png){width="100%"}</center>
:::
:::
::: notes
- Next, let's say we want to have a BIG, simple moon.
- so again, we make another data frame that only has data for one single point..
- It also has a big numeric value for it's size and some color options
- We then add this dataframe into the plot with the geom_point fx at the bottom
- and that creates our image on the right
:::
## How Can we Make Generative Art in R or Python? {.mutedblue background-color="#4e5483"}
::: {style="padding-bottom: 20px;"}
<u>**A More Complicated Example *(In R)***</u>
:::
::: columns
::: {.column width="60%"}
```{r, echo = TRUE, eval = FALSE, `code-line-numbers`="1-9,25-28"}
# Data for the buildings--------------------------------
df_buildings <- tibble(
x = 0:4,
xend = x,
y = 0,
yend = sample(seq(.5,2, l = 10), 5, replace = TRUE),
color = "#000000",linewidth = 60
)
# Plot Creation------------------------------------------
df_sky |>
ggplot(aes(x,y, xend = xend, yend = yend)) +
theme_void() +
coord_cartesian(xlim = c(0,4), ylim = c(0,3),
expand = FALSE) +
geom_segment(color = df_sky$color,
linewidth = df_sky$linewidth) +
geom_point(data = df_moon, aes(x,y),
color = df_moon$color,
fill = df_moon$fill,
size = df_moon$size,
shape = 21,
stroke = .5,
inherit.aes = FALSE) +
geom_segment(data = df_buildings,
color = df_buildings$color,
linewidth = df_buildings$linewidth)
```
:::
::: {.column width="40%"}
<br><br>
<center>![](images/buildings_ggplot.png){width="100%"}</center>
:::
:::
::: notes
- Finally, we make one last data frame for some basic buildings
- This time the dataframe with have numbers that will plot chunky vertical lines
- we can also get a lil' spicy and throw in a sample function to randomize the heights of our buildings.
- and Like all the other layers, we tack it on to the ggplot with geom_segment fx shown at the bottom
- and then we get the image on right, Now, I know that was really quick, but the main thing I was you to take from this is that...
:::
## How Can we Make Generative Art in R or Python? {.mutedblue background-color="#4e5483"}
<br> <br>
<center>
::: {#bluequote}
> The concept of translating data into visuals is the same no matter how simple or complex a piece is...
:::
<br> <br>
::: fragment
::: {#bluequote}
> The **hard** part is usually the programming or the math🤢
:::
:::
</center>
::: notes
- If you hate math like I do, that's OK, you can still make art.
- I also hope you all took note of how "intentional" alot of the process can be
- While there's some artists out there that rely heavily on automated systems, or finetuning AI prompts
- There are some of us out here spending hours exploring and creating art with code in this manner.
So now that everyone is up to speed about what generative art is, and you have some idea of how it can be made, let's quickly touch on some of the benefits of making art like this
:::
## {background-color="#1a1a1a" background-image="images/background4.png" background-size="cover"}
<br> <br> <br> <br> <br> <br>
<center>
<h1>Benefits of Creating<br>Generative Art</h1>
</center>
::: notes
- Theres lots of benefits to making art like this.
- The Most important for me is how fun and therapeutic it can be.
- Another big one though is just "learning" in general. And it got me to thinking about something...
:::
## Benefits of Creating Generative Art {.turq background-color="#3a7188"}
::: columns
::: {.column width="50%"}
<center>![](images/idea.gif){.false width="100%"}</center>
:::
::: {.column width="50%"}
<br><br>
<center>
::: {#turqquote}
> People may learn better when they are doing something they enjoy 🤯
:::
</center>
<br><br>
<center>
::: fragment
::: {#turqquote}
> If you enjoy creating art...you might learn some things 🤔
:::
:::
</center>
:::
:::
::: notes
- I have an idea that.. first next click
after - I'm not trying to be funny, I can't just stand up here and say this is a proven fact.<br><br>
- the best I can do is give you personal examples of my experience with creating generative art...
:::
## Benefits of Creating Generative Art {.turq background-color="#3a7188"}
::: {style="padding-bottom: 20px;"}
<h3> The Obvious 🎨 </h3>
- Improved Data Visualization Skills
<center>![](images/first_tt){width="80%"}</center>
:::
::: notes
- An example I love to use.. my tidy Tuesday submissions..<br>
- weekly data viz challenge we have?<br>
- Used to be super popular on Twitter before it became a hellsite..<br>
- This was my first submission...and you couldn't tell me NOTHING.<br>
- So proud I figured out a lollipop chart
:::
## Benefits of Creating Generative Art {.turq background-color="#3a7188"}
::: {style="padding-bottom: 20px;"}
<h3> The Obvious 🎨 </h3>
- Improved Data Visualization Skills
<center>![](images/mid_tt){width="45%"}</center>
:::
::: notes
This was my work after about 2 months of creating generative art...
:::
## Benefits of Creating Generative Art {.turq background-color="#3a7188"}
::: {style="padding-bottom: 20px;"}
<h3> The Obvious 🎨 </h3>
- Improved Data Visualization Skills
<center>![](images/last_tt){width="75%"}</center>
:::
::: notes
And my most recent tidy tuesday I did this year... obviously, i developed knowledge of how to make things more aesthetically pleasing, and how to hack my tool of choice for some cool results.
:::