<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                今天看了一下使用python繪制圖表的方法,有個強大的類庫matplotlib,可以制作出高質量的2D和3D圖形,先記錄一下,以后慢慢學習。 matplotlib下載及API手冊地址:[http://sourceforge.net/projects/matplotlib/files/matplotlib/](http://sourceforge.net/projects/matplotlib/files/matplotlib/) 數學庫numpy下載及API手冊地址:[http://www.scipy.org/Download](http://www.scipy.org/Download) 幾個繪圖的例子,來自API手冊: 1、最簡單的圖: 代碼: ~~~ #!/usr/bin/env python import matplotlib.pyplot as plt plt.plot([10, 20, 30]) plt.xlabel('tiems') plt.ylabel('numbers') plt.show() ~~~ 測試: ![](https://box.kancloud.cn/2016-06-08_57579356028ce.gif) 2.餅圖: 代碼: ~~~ #!/usr/bin/env python # -*- coding: utf-8 -*- from pylab import * # make a square figure and axes figure(1, figsize=(6,6)) ax = axes([0.1, 0.1, 0.8, 0.8]) labels = 'Frogs', 'Hogs', 'Dogs', 'Logs' fracs = [15,30,45, 10] explode=(0, 0.05, 0, 0) pie(fracs, explode=explode, labels=labels, autopct='%1.1f%%', shadow=True) title('Raining Hogs and Dogs', bbox={'facecolor':'0.8', 'pad':5}) savefig('D:\\pie.png') show() ~~~ 測試: ![](https://box.kancloud.cn/2016-06-08_575793561a6e5.gif) 3、使用numpy庫函數: 代碼: ~~~ #!/usr/bin/env python # -*- coding: utf-8 -*- import numpy as np import matplotlib.pyplot as plt t = np.arange(0.0, 1.01, 0.01) s = np.sin(2*2*np.pi*t) plt.fill(t, s*np.exp(-5*t), 'r') plt.grid(True) #保存為PDF格式,也可保存為PNG等圖形格式 plt.savefig('D:\\test.pdf') plt.show() ~~~ 測試: ![](https://box.kancloud.cn/2016-06-08_57579356335e9.gif)
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看