最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Python使用Matplotlib實(shí)現(xiàn)Logos設(shè)計(jì)代碼

 更新時(shí)間:2017年12月25日 17:02:23   投稿:mengwei  
這篇文章主要介紹了Python使用Matplotlib實(shí)現(xiàn)Logos設(shè)計(jì)代碼,具有一定借鑒價(jià)值,需要的朋友可以參考下。

本文主要展示了使用matplotlib設(shè)計(jì)logo的示例及完整代碼,首先看下其演示結(jié)果:

Python代碼如下:

import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib.cm as cm

mpl.rcParams['xtick.labelsize'] = 10
mpl.rcParams['ytick.labelsize'] = 12
mpl.rcParams['axes.edgecolor'] = 'gray'


axalpha = 0.05
figcolor = 'white'
dpi = 80
fig = plt.figure(figsize=(6, 1.1), dpi=dpi)
fig.patch.set_edgecolor(figcolor)
fig.patch.set_facecolor(figcolor)


def add_math_background():
  ax = fig.add_axes([0., 0., 1., 1.])

  text = []
  text.append(
    (r"$W^{3\beta}_{\delta_1 \rho_1 \sigma_2} = "
     r"U^{3\beta}_{\delta_1 \rho_1} + \frac{1}{8 \pi 2}"
     r"\int^{\alpha_2}_{\alpha_2} d \alpha^\prime_2 "
     r"\left[\frac{ U^{2\beta}_{\delta_1 \rho_1} - "
     r"\alpha^\prime_2U^{1\beta}_{\rho_1 \sigma_2} "
     r"}{U^{0\beta}_{\rho_1 \sigma_2}}\right]$", (0.7, 0.2), 20))
  text.append((r"$\frac{d\rho}{d t} + \rho \vec{v}\cdot\nabla\vec{v} "
         r"= -\nabla p + \mu\nabla^2 \vec{v} + \rho \vec{g}$",
         (0.35, 0.9), 20))
  text.append((r"$\int_{-\infty}^\infty e^{-x^2}dx=\sqrt{\pi}$",
         (0.15, 0.3), 25))
  text.append((r"$F_G = G\frac{m_1m_2}{r^2}$",
         (0.85, 0.7), 30))
  for eq, (x, y), size in text:
    ax.text(x, y, eq, ha='center', va='center', color="#11557c",
        alpha=0.25, transform=ax.transAxes, fontsize=size)
  ax.set_axis_off()
  return ax


def add_matplotlib_text(ax):
  ax.text(0.95, 0.5, 'www.fzitv.net', color='#11557c', fontsize=55,
      ha='right', va='center', alpha=1.0, transform=ax.transAxes)


def add_polar_bar():
  ax = fig.add_axes([0.025, 0.075, 0.2, 0.85], projection='polar')

  ax.patch.set_alpha(axalpha)
  ax.set_axisbelow(True)
  N = 7
  arc = 2. * np.pi
  theta = np.arange(0.0, arc, arc/N)
  radii = 10 * np.array([0.2, 0.6, 0.8, 0.7, 0.4, 0.5, 0.8])
  width = np.pi / 4 * np.array([0.4, 0.4, 0.6, 0.8, 0.2, 0.5, 0.3])
  bars = ax.bar(theta, radii, width=width, bottom=0.0)
  for r, bar in zip(radii, bars):
    bar.set_facecolor(cm.jet(r/10.))
    bar.set_alpha(0.6)

  ax.tick_params(labelbottom=False, labeltop=False,
          labelleft=False, labelright=False)

  ax.grid(lw=0.8, alpha=0.9, ls='-', color='0.5')

  ax.set_yticks(np.arange(1, 9, 2))
  ax.set_rmax(9)


if __name__ == '__main__':
  main_axes = add_math_background()
  add_polar_bar()
  add_matplotlib_text(main_axes)
  plt.show()

時(shí)間關(guān)系,具體注釋先不加了,有不明白的可以留言交流討論。

總結(jié)

以上就是本文關(guān)于Python使用Matplotlib實(shí)現(xiàn)Logos設(shè)計(jì)代碼的全部內(nèi)容,希望對大家有所幫助。感興趣的朋友可以繼續(xù)參閱本站:

python學(xué)習(xí)之matplotlib繪制散點(diǎn)圖實(shí)例

Python數(shù)據(jù)可視化編程通過Matplotlib創(chuàng)建散點(diǎn)圖代碼示例

matplotlib在python上繪制3D散點(diǎn)圖實(shí)例詳解

如有不足之處,歡迎留言指出。感謝朋友們對本站的支持!

相關(guān)文章

最新評論

廉江市| 旌德县| 沙坪坝区| 商河县| 高邮市| 剑河县| 泰州市| 烟台市| 胶州市| 江门市| 吉木乃县| 呼伦贝尔市| 河池市| 咸阳市| 龙门县| 合江县| 油尖旺区| 海门市| 九江县| 含山县| 宣汉县| 怀远县| 宁化县| 深圳市| 韶山市| 昌乐县| 凤冈县| 公安县| 万荣县| 林西县| 宁武县| 钟祥市| 长寿区| 文昌市| 龙海市| 葵青区| 陕西省| 宁阳县| 霍城县| 阳谷县| 勃利县|