File tree Expand file tree Collapse file tree 3 files changed +38
-4
lines changed Expand file tree Collapse file tree 3 files changed +38
-4
lines changed Original file line number Diff line number Diff line change
1
+ import networkx as nx
2
+ import matplotlib .pyplot as plt
3
+
4
+
5
+ G = nx .hypercube_graph (4 )
6
+ pos = nx .spring_layout (G ) # (spring layout works well for hypercubes)
7
+ fig , ax = plt .subplots (figsize = (8 , 8 )) # transparent background
8
+
9
+ nx .draw (
10
+ G , pos , with_labels = False ,
11
+ node_size = 500 , node_color = "#00FFFF" , # Cyan nodes (good contrast in both modes)
12
+ edge_color = "#333333" , # Dark gray edges (works in both modes)
13
+ width = 4 , # Make edges extra bold
14
+ ax = ax
15
+ )
16
+ ax .set_axis_off ()
17
+
18
+ # 4_hypercube_graph_square_bold_edges_contrast
19
+ plt .savefig (
20
+ "icon.png" ,
21
+ format = "png" ,
22
+ transparent = True ,
23
+ bbox_inches = 'tight' ,
24
+ pad_inches = 0
25
+ )
26
+
27
+ plt .show ()
Original file line number Diff line number Diff line change
1
+ matplotlib == 3.9.2
2
+ networkx == 3.3
Original file line number Diff line number Diff line change @@ -38,18 +38,23 @@ const About = () => {
38
38
</ div >
39
39
< p >
40
40
For those of you curious, the favicon is a < Highlight text = "4-hypercube graph" color = "cyan" /> made via Python, using NetworkX and Matplotlib.
41
- Check < LinkWithArrow
41
+ Check the < LinkWithArrow
42
42
href = "/icon.ico" target = "_blank"
43
43
className = "mr-1 hover:underline hover:underline-offset-2 text-orange-500"
44
44
>
45
- it
45
+ image
46
46
</ LinkWithArrow >
47
- out and learn < LinkWithArrow
47
+ out, learn < LinkWithArrow
48
48
href = "https://en.wikipedia.org/wiki/Hypercube_graph" target = "_blank"
49
49
className = "mr-1 hover:underline hover:underline-offset-2 text-blue-violet-500"
50
50
>
51
51
more
52
- </ LinkWithArrow > .
52
+ </ LinkWithArrow > about hypercube graphs & here is the < LinkWithArrow
53
+ href = "https://github.com/steadyfall/steadyfall.github.io/blob/main/hypercube/generate.py" target = "_blank"
54
+ className = "mr-1 hover:underline hover:underline-offset-2 dark:text-firefly-500 text-firefly-600"
55
+ >
56
+ code
57
+ </ LinkWithArrow > to generate it yourself.
53
58
</ p >
54
59
</ div >
55
60
</ BlurFade >
You can’t perform that action at this time.
0 commit comments