擅长:python、mysql、java
<p>差不多了。</p>
<p>它是:</p>
<pre><code>for c in CS.collections:
c.set_dashes([(0, (2.0, 2.0))])
</code></pre>
<p>如果你把一个<code>print c.get_dashes()</code>放在那里,你就会发现(我就是这么做的)。</p>
<p>也许线条样式的定义有点变化,您是从一个旧的示例开始工作的。</p>
<p><a href="http://matplotlib.org/api/collections_api.html">collections documentation</a>的意思是:</p>
<blockquote>
<ul>
<li><p>set_dashes(ls)</p>
<p>alias for set_linestyle</p></li>
<li><p>set_linestyle(ls)</p>
<p>Set the linestyle(s) for the collection.</p>
<p>ACCEPTS: [‘solid’ | ‘dashed’, ‘dashdot’, ‘dotted’ | (offset, on-off-dash-seq) ]</p></li>
</ul>
</blockquote>
<p>所以在<code>[(0, (2.0, 2.0))]</code>中,0是偏移量,然后元组是on-off重复模式。</p>