Skip to content

Commit e2e6ab6

Browse files
jarrodmillmanMars Lee
authored and
Mars Lee
committed
Add network/graph category to scientific domains tab (numpy#374)
1 parent 2dd4638 commit e2e6ab6

File tree

4 files changed

+75
-7
lines changed

4 files changed

+75
-7
lines changed

layouts/partials/scientific-domains.html

+16-7
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@
1515
<td class="bold-text">Statistical Computing </td>
1616
<td class="bold-text">Signal Processing </td>
1717
<td class="bold-text">Image Processing </td>
18-
<td class="bold-text">Symbolic Computing </td>
18+
<td class="bold-text">Graphs and Networks </td>
1919
<td class="bold-text">Astronomy Processes </td>
2020
<td class="bold-text">Cognitive Psychology </td>
2121
</tr>
2222
<tr>
2323
<td><img class="cell-layout" src="images/content_images/sc_dom_img/sd1.png" alt="A computer chip with an atomic symbol."></td>
2424
<td><img class="cell-layout" src="images/content_images/sc_dom_img/sd2.png" alt="A line graph with the line moving up."></td>
25-
<td><img class="cell-layout" src="images/content_images/sc_dom_img/sd3.png" alt="A bar chart wiht positive and negative values."></td>
25+
<td><img class="cell-layout" src="images/content_images/sc_dom_img/sd3.png" alt="A bar chart with positive and negative values."></td>
2626
<td><img class="cell-layout" src="images/content_images/sc_dom_img/sd4.png" alt="An photograph of the sun and mountains."></td>
27-
<td><img class="cell-layout" src="images/content_images/sc_dom_img/sd6.png" alt="Multiple mathematical symbols on graph paper."></td>
27+
<td><img class="cell-layout" src="images/content_images/sc_dom_img/sd6.svg" alt="A simple graph."></td>
2828
<td><img class="cell-layout" src="images/content_images/sc_dom_img/sd7.png" alt="A telescope and multiple planets."></td>
2929
<td><img class="cell-layout" src="images/content_images/sc_dom_img/sd8.png" alt="A human head with gears."></td>
3030
</tr>
@@ -33,7 +33,7 @@
3333
<td class="center-text"><a href="https://pandas.pydata.org">Pandas</a></td>
3434
<td class="center-text"><a href="https://www.scipy.org">SciPy</a></td>
3535
<td class="center-text"><a href="https://scikit-image.org">Scikit-image</a></td>
36-
<td class="center-text"><a href="https://www.sympy.org">SymPy</a></td>
36+
<td class="center-text"><a href="https://networkx.org">NetworkX</a></td>
3737
<td class="center-text"><a href="https://www.astropy.org">AstroPy</a></td>
3838
<td class="center-text"><a href="https://www.psychopy.org">PsychoPy</a></td>
3939
</tr>
@@ -42,7 +42,7 @@
4242
<td class="center-text"><a href="https://github.com/statsmodels/statsmodels"> statsmodels</a></td>
4343
<td class="center-text"><a href="https://pywavelets.readthedocs.io">PyWavelets</a></td>
4444
<td class="center-text"><a href="https://opencv.org">OpenCV</a></td>
45-
<td class="center-text"></td>
45+
<td class="center-text"><a href="https://graph-tool.skewed.de/">graph-tool</a></td>
4646
<td class="center-text"><a href="https://github.com/sunpy/sunpy">SunPy</a></td>
4747
<td class="center-text"></td>
4848
</tr>
@@ -51,10 +51,19 @@
5151
<td class="center-text"><a href="https://github.com/mwaskom/seaborn">Seaborn</a></td>
5252
<td class="center-text"></td>
5353
<td class="center-text"></td>
54-
<td class="center-text"></td>
54+
<td class="center-text"><a href="https://igraph.org/python/">igraph</a></td>
5555
<td class="center-text"><a href="https://github.com/spacepy/spacepy">SpacePy</a></td>
5656
<td class="center-text"></td>
5757
</tr>
58+
<tr>
59+
<td class="lastrow-center-text"></td>
60+
<td class="lastrow-center-text"></td>
61+
<td class="lastrow-center-text"></td>
62+
<td class="lastrow-center-text"></td>
63+
<td class="center-text"><a href="https://pygsp.rtfd.io">PyGSP</a></td>
64+
<td class="lastrow-center-text"></td>
65+
<td class="lastrow-center-text"></td>
66+
</tr>
5867
<!-- Second Row -->
5968
<tr class="highlight-th">
6069
<td class="bold-text">Bioinformatics</td>
@@ -71,7 +80,7 @@
7180
<td><img class="cell-layout" src="images/content_images/sc_dom_img/sd11.png" alt="Four mathematical symbols."></td>
7281
<td><img class="cell-layout" src="images/content_images/sc_dom_img/sd12.png" alt="A three-dimensional graph with a box."></td>
7382
<td><img class="cell-layout" src="images/content_images/sc_dom_img/sd13.png" alt="A conical flask and test tube."></td>
74-
<td><img class="cell-layout" src="images/content_images/sc_dom_img/sd14.png" alt="The Earth surronded by four circling arrows."></td>
83+
<td><img class="cell-layout" src="images/content_images/sc_dom_img/sd14.png" alt="The Earth surrounded by four circling arrows."></td>
7584
<td><img class="cell-layout" src="images/content_images/sc_dom_img/sd15.png" alt="A human hand tapping a browser window."></td>
7685
</tr>
7786
<tr>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import networkx as nx
2+
import matplotlib as mpl
3+
import matplotlib.pyplot as plt
4+
import matplotlib.patches as patches
5+
import matplotlib.lines as lines
6+
7+
mpl.rcParams['patch.antialiased'] = True
8+
mpl.rcParams['lines.antialiased'] = True
9+
10+
# create graph
11+
G = nx.Graph()
12+
G.add_edge(1, 2)
13+
G.add_edge(1, 3)
14+
G.add_edge(1, 5)
15+
G.add_edge(2, 3)
16+
G.add_edge(3, 4)
17+
G.add_edge(4, 5)
18+
19+
# set node positions and drawing options
20+
pos = {1: (0, 0), 2: (-1, 0.3), 3: (2, 0.17), 4: (4, 0.255), 5: (5, 0.03)}
21+
options = {
22+
"node_size": 4000,
23+
"node_color": "white",
24+
"edge_color": "black",
25+
"edgecolors": "black",
26+
"linewidths": 20,
27+
"width": 20,
28+
}
29+
30+
# draw graph
31+
nx.draw(G, pos, **options)
32+
ax = plt.gca()
33+
ax.margins(0.10)
34+
plt.axis("off")
35+
plt.savefig("sd6-large.svg")
36+
37+
# set the width to 130 pixels with the following command:
38+
# $ rsvg-convert -a -w 160 -f svg sd6-large.svg -o sd6.svg
39+
40+
# if you want to blur the lines
41+
# $ convert sd6-large.svg -blur 0x8 sd6-blur.svg
42+
# $ rsvg-convert -a -w 160 -f svg sd6-blur.svg -o sd6.svg
-35.6 KB
Binary file not shown.
Loading

0 commit comments

Comments
 (0)