<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-Hans-CN">
	<id>https://wiki.swarma.org/index.php?action=history&amp;feed=atom&amp;title=%E4%BD%BF%E7%94%A8python%E7%BB%98%E5%88%B6%E4%B8%80%E4%B8%AA%E7%AE%80%E5%8D%95%E7%9A%84%E7%BD%91%E7%BB%9C</id>
	<title>使用python绘制一个简单的网络 - 版本历史</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.swarma.org/index.php?action=history&amp;feed=atom&amp;title=%E4%BD%BF%E7%94%A8python%E7%BB%98%E5%88%B6%E4%B8%80%E4%B8%AA%E7%AE%80%E5%8D%95%E7%9A%84%E7%BD%91%E7%BB%9C"/>
	<link rel="alternate" type="text/html" href="https://wiki.swarma.org/index.php?title=%E4%BD%BF%E7%94%A8python%E7%BB%98%E5%88%B6%E4%B8%80%E4%B8%AA%E7%AE%80%E5%8D%95%E7%9A%84%E7%BD%91%E7%BB%9C&amp;action=history"/>
	<updated>2026-11-02T22:07:24Z</updated>
	<subtitle>本wiki的该页面的版本历史</subtitle>
	<generator>MediaWiki 1.35.0</generator>
	<entry>
		<id>https://wiki.swarma.org/index.php?title=%E4%BD%BF%E7%94%A8python%E7%BB%98%E5%88%B6%E4%B8%80%E4%B8%AA%E7%AE%80%E5%8D%95%E7%9A%84%E7%BD%91%E7%BB%9C&amp;diff=34710&amp;oldid=prev</id>
		<title>2024年5月21日 (二) 03:29 13944556914</title>
		<link rel="alternate" type="text/html" href="https://wiki.swarma.org/index.php?title=%E4%BD%BF%E7%94%A8python%E7%BB%98%E5%88%B6%E4%B8%80%E4%B8%AA%E7%AE%80%E5%8D%95%E7%9A%84%E7%BD%91%E7%BB%9C&amp;diff=34710&amp;oldid=prev"/>
		<updated>2024-05-21T03:29:21Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;zh-Hans-CN&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;←上一版本&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2024年5月21日 (二) 03:29的版本&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l26&quot; &gt;第26行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第26行：&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[File:simple_graph_1.png|400px]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[File:simple_graph_1.png|400px]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;[[category:python]]&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;使用python绘制一个简单的网络&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Category&lt;/ins&gt;:&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;待润色&lt;/ins&gt;]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;category&lt;/del&gt;:&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;旧词条迁移&lt;/del&gt;]]&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>13944556914</name></author>
	</entry>
	<entry>
		<id>https://wiki.swarma.org/index.php?title=%E4%BD%BF%E7%94%A8python%E7%BB%98%E5%88%B6%E4%B8%80%E4%B8%AA%E7%AE%80%E5%8D%95%E7%9A%84%E7%BD%91%E7%BB%9C&amp;diff=15437&amp;oldid=prev</id>
		<title>思无涯咿呀咿呀：创建页面，内容为“使用networkx包，我们可以很轻易地构建和绘制网络。  首先调用包  &lt;syntaxhighlight lang=&quot;python&quot;&gt;     import networkx as nx     import matplotli…”</title>
		<link rel="alternate" type="text/html" href="https://wiki.swarma.org/index.php?title=%E4%BD%BF%E7%94%A8python%E7%BB%98%E5%88%B6%E4%B8%80%E4%B8%AA%E7%AE%80%E5%8D%95%E7%9A%84%E7%BD%91%E7%BB%9C&amp;diff=15437&amp;oldid=prev"/>
		<updated>2020-10-16T01:50:34Z</updated>

		<summary type="html">&lt;p&gt;创建页面，内容为“使用networkx包，我们可以很轻易地构建和绘制网络。  首先调用包  &amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;     import networkx as nx     import matplotli…”&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;使用networkx包，我们可以很轻易地构建和绘制网络。&lt;br /&gt;
&lt;br /&gt;
首先调用包&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
    import networkx as nx&lt;br /&gt;
    import matplotlib.pyplot as plt&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
其次使用networkx自带的命令制造一个有20条边的星状网络，使用不同深度的绿色来绘制连边，使用弹性算法（spring layout）来绘图。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;    &lt;br /&gt;
    plt.figure(num=None, figsize=(6, 6), dpi=80, facecolor='w', edgecolor='k')&lt;br /&gt;
    n_of_edges=20&lt;br /&gt;
    G=nx.star_graph(n_of_edges)&lt;br /&gt;
    pos=nx.spring_layout(G)&lt;br /&gt;
    colors=range(n_of_edges)&lt;br /&gt;
    nx.draw(G,pos,node_color='orange',&lt;br /&gt;
            edge_color=colors,width=4,&lt;br /&gt;
            edge_cmap=plt.cm.Greens,with_labels=False)&lt;br /&gt;
    plt.show()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
得到下图：&lt;br /&gt;
&lt;br /&gt;
[[File:simple_graph_1.png|400px]]&lt;br /&gt;
&lt;br /&gt;
[[category:python]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[category:旧词条迁移]]&lt;/div&gt;</summary>
		<author><name>思无涯咿呀咿呀</name></author>
	</entry>
</feed>