目录

  • 前言
  • 1.基本使用
    • 1.1 基本用法
    • 1.2 figure图像
    • 1.3 设置坐标轴1
    • 1.4 设置坐标轴2
    • 1.5 Legend图例
    • 1.6 Annotation标注
    • 1.7 tick能见度
  • 2.画图种类
    • 2.1 Scatter散点图
    • 2.2 Bar柱状图
    • 2.3 Contours等高线图
    • 2.4 Image图片
    • 2.5 3D数据
  • 3.多图合并显示
    • 3.1 Subplot多合一显示
    • 3.2 Subplot分格显示
    • 3.3 图中图
    • 3.4 次坐标轴
  • 4.动画
    • 4.1 Animation动画
  • 结语
  • 参考

前言

莫烦老师Matplotlib教程,将所有代码和对应的图记录在博客中,方便自己后续查看

作者:莫烦Python

转自:https://mofanpy.com/tutorials/data-manipulation/plt/

视频:【莫烦Python】Matplotlib Python画图教程

代码:https://github.com/MorvanZhou/tutorials/tree/master/matplotlibTUT

环境:python-3.9.13 matplotlib-3.5.2 numpy-1.21.5

1.基本使用

1.1 基本用法


# 3 - simple plotimport matplotlib.pyplot as plt
import numpy as npx = np.linspace(-1, 1, 50)
y = 2 * x + 1
y1 = x ** 2
plt.plot(x, y1)
plt.show()

simple_plot

1.2 figure图像

  • plt.figure() 新建一个画布,以下所有图像都在这个画布中

    • num 画布名称
    • figsize 画布大小,tuple类型
  • plt.plot()
    • color 颜色,str类型
    • linewidth 线宽,float类型
    • linestyle 线类型 str类型

# 4 - figureimport matplotlib.pyplot as plt
import numpy as npx = np.linspace(-3, 3, 50)
y1 = 2 * x + 1
y2 = x ** 2plt.figure()
plt.plot(x, y1)plt.figure(num=3, figsize=(8,5))
plt.plot(x, y2)
# plot the second curve in this figure with certain parameters
plt.plot(x, y1, color='red', linewidth=1.0, linestyle='--')plt.show()

figure_1

figure_2

1.3 设置坐标轴1

修改坐标轴的刻度和文字描述

  • plt.xlim() plt.ylim() 修改x/y坐标轴的范围,接收tuple类型
  • plt.xlabel() plt.ylabel() 修改x/y坐标轴的标签,接收str类型
  • plt.xticks() plt.yticks()
    • 第一个参数修改新的刻度,接收list类型
    • 第二个参数修改对应刻度的名称,接收list类型,为了字体一致可选择数学公式+r(正则表达形式)

# 5 - axis settingimport matplotlib.pyplot as plt
import numpy as npx = np.linspace(-3, 3, 50)
y1 = 2 * x + 1
y2 = x ** 2plt.figure()
plt.plot(x, y2)
plt.plot(x, y1, color='red', linewidth=1.0, linestyle='--')
# set x limits
plt.xlim((-1, 2))
plt.ylim((-2, 3))
plt.xlabel('I am x')
plt.ylabel('I am y')# set new sticks
new_ticks = np.linspace(-1, 2, 5)
print(new_ticks)
plt.xticks(new_ticks)
# set tick labels
plt.yticks([-2, -1.8, -1, 1.22, 3],[r'$really\ bad$', r'$bad$', r'$normal$', r'$good$', r'$really\ good$'])
plt.show()

axis setting1

1.4 设置坐标轴2

修改坐标轴位置

  • plt.gca() 获取当前的轴
  • plt.gca().xaxis.set_ticks_position() 设置x轴
  • plt.gca().spines[].set_position(()) 设置原点
  • 设置刻度尺朝向 参考自matplotlib:刻度线的方向调整

# 6 - axis settingimport matplotlib.pyplot as plt
import numpy as np# plt.rcParams['xtick.direction'] = 'in'  # 将x轴的刻度方向设置向内
# plt.rcParams['ytick.direction'] = 'in'  # 将y轴的刻度方向设置向内x = np.linspace(-3, 3, 50)
y1 = 2 * x + 1
y2 = x ** 2plt.figure()
plt.plot(x, y2)
# plot the second curve in this figure with certain parameters
plt.plot(x, y1, color='red', linewidth=1.0, linestyle='--')
# set x limits
plt.xlim((-1, 2))
plt.ylim((-2, 3))# set new sticks
new_ticks = np.linspace(-1, 2, 5)
print(new_ticks)
plt.xticks(new_ticks)
# set tick labels
plt.yticks([-2, -1.8, -1, 1.22, 3],[r'$really\ bad$', r'$bad$', r'$normal$', r'$good$', r'$really\ good$'])
# to use '$ $' for math text and nice looking, e.g. '$\pi$'# gca = 'get current axis'
ax = plt.gca()
ax.spines['right'].set_color('none')    # 去除右轴
ax.spines['top'].set_color('none')      # 去除上轴ax.xaxis.set_ticks_position('bottom')   # 设置下轴为x轴
# ACCEPTS: [ 'top' | 'bottom' | 'both' | 'default' | 'none' ]ax.spines['bottom'].set_position(('data', 0))   # 设置y轴原点为0
# the 1st is in 'outward' | 'axes' | 'data'
# axes: percentage of y axis
# data: depend on y dataax.yaxis.set_ticks_position('left')     # 设置左轴为y轴
# ACCEPTS: [ 'left' | 'right' | 'both' | 'default' | 'none' ]ax.spines['left'].set_position(('data', 0))   # 设置x轴原点为0
plt.show()

axis setting2

1.5 Legend图例

添加Legend图例,帮助展示出每个数据对应的图像名称

  • plt.legend()

# 7 - legendimport matplotlib.pyplot as plt
import numpy as np# plt.rcParams['xtick.direction'] = 'in'  # 将x轴的刻度方向设置向内
# plt.rcParams['ytick.direction'] = 'in'  # 将y轴的刻度方向设置向内x = np.linspace(-3, 3, 50)
y1 = 2 * x + 1
y2 = x ** 2plt.figure()
# set x limits
plt.xlim((-1, 2))
plt.ylim((-2, 3))# set new sticks
new_ticks = np.linspace(-1, 2, 5)
print(new_ticks)
plt.xticks(new_ticks)
# set tick labels
plt.yticks([-2, -1.8, -1, 1.22, 3],[r'$really\ bad$', r'$bad$', r'$normal$', r'$good$', r'$really\ good$'])l1, = plt.plot(x, y1, label='linear line')
l2, = plt.plot(x, y2, color='red', linewidth=1.0, linestyle='--', label='square line')plt.legend(loc='upper right')
# plt.legend(handles=[l1, l2], labels=['up', 'down'], loc='best')
# the "," is very important in here l1, = plt... and l2, = plt... for this step
"""legend( handles=(line1, line2, line3),labels=('label1', 'label2', 'label3'),'upper right')The *loc* location codes are::'best' : 0,          (currently not supported for figure legends)'upper right'  : 1,'upper left'   : 2,'lower left'   : 3,'lower right'  : 4,'right'        : 5,'center left'  : 6,'center right' : 7,'lower center' : 8,'upper center' : 9,'center'       : 10,"""
plt.show()

legend

1.6 Annotation标注

  • plt.annotation() 加注释
  • plt.text() 加文字描述

# 8 - annotationimport matplotlib.pyplot as plt
import numpy as np# plt.rcParams['xtick.direction'] = 'in'  # 将x轴的刻度方向设置向内
# plt.rcParams['ytick.direction'] = 'in'  # 将y轴的刻度方向设置向内x = np.linspace(-3, 3, 50)
y = 2 * x + 1plt.figure(num=1, figsize=(8,5),)
plt.plot(x, y,)ax = plt.gca()
ax.spines['right'].set_color('none')
ax.spines['top'].set_color('none')
ax.xaxis.set_ticks_position('bottom')
ax.spines['bottom'].set_position(('data', 0))
ax.yaxis.set_ticks_position('left')
ax.spines['left'].set_position(('data', 0))x0 = 1
y0 = 2 * x0 + 1
plt.plot([x0, x0,], [0, y0,], 'k--', linewidth=2.5)
plt.scatter([x0, ], [y0, ], s=50, color='b')# method 1:
#####################
plt.annotate(r'$2x+1=%s$' % y0, xy=(x0, y0), xycoords='data', xytext=(+30, -30),textcoords='offset points', fontsize=16,arrowprops=dict(arrowstyle='->', connectionstyle="arc3,rad=.2"))# method 2:
########################
plt.text(-3.7, 3, r'$This\ is\ the\ some\ text. \mu\ \sigma_i\ \alpha_t$',fontdict={'size': 16, 'color': 'r'})
plt.show()

annotation

1.7 tick能见度


# 9 - tick_visibilityimport matplotlib.pyplot as plt
import numpy as np# plt.rcParams['xtick.direction'] = 'in'  # 将x轴的刻度方向设置向内
# plt.rcParams['ytick.direction'] = 'in'  # 将y轴的刻度方向设置向内x = np.linspace(-3, 3, 50)
y = 0.1 * xplt.figure()
plt.plot(x, y, linewidth=10, zorder=1)      # set zorder for ordering the plot in plt 2.0.2 or higher
plt.ylim(-2, 2)
ax = plt.gca()
ax.spines['right'].set_color('none')
ax.spines['top'].set_color('none')
ax.xaxis.set_ticks_position('bottom')
ax.spines['bottom'].set_position(('data', 0))
ax.yaxis.set_ticks_position('left')
ax.spines['left'].set_position(('data', 0))print(ax.get_xticklabels())
for label in ax.get_xticklabels() + ax.get_yticklabels():label.set_fontsize(12)# set zorder for ordering the plot in plt 2.0.2 or higherlabel.set_bbox(dict(facecolor='white', edgecolor='none', alpha=0.8, zorder=2))
plt.show()

tick visibility

2.画图种类

2.1 Scatter散点图


# 10 - scatterimport matplotlib.pyplot as plt
import numpy as npn = 1024    # data size
X = np.random.normal(0, 1, n)   # 均值为0方差为1的高斯分布
Y = np.random.normal(0, 1, n)
T = np.arctan2(Y, X)    # for color later onplt.scatter(X, Y, s=75, c=T, alpha=.5)plt.xlim(-1.5, 1.5)
plt.xticks(())  # ignore xticks
plt.ylim(-1.5, 1.5)
plt.yticks(())  # ignore yticks
plt.show()

scatter

2.2 Bar柱状图


# 11 - barimport matplotlib.pyplot as plt
import numpy as npn = 12
X = np.arange(n)
Y1 = (1 - X / float(n)) * np.random.uniform(0.5, 1.0, n)
Y2 = (1 - X / float(n)) * np.random.uniform(0.5, 1.0, n)plt.bar(X, +Y1, facecolor='#9999ff', edgecolor='white')
plt.bar(X, -Y2, facecolor='#ff9999', edgecolor='white')for x, y in zip(X, Y1):# ha: horizontal alignment# va: vertical alignmentplt.text(x + 0.04, y + 0.02, '%.2f' % y, ha='center', va='bottom')for x, y in zip(X, Y2):# ha: horizontal alignment# va: vertical alignmentplt.text(x + 0.04, -y - 0.02, '%.2f' % y, ha='center', va='top')plt.xlim(-.5, n)
plt.xticks(())
plt.ylim(-1.1, 1.1)
plt.yticks(())
plt.show()

bar

2.3 Contours等高线图


# 12 - contoursimport matplotlib.pyplot as plt
import numpy as npdef f(x, y):# the height functionreturn (1 - x / 2 + x**5 + y**3) * np.exp(-x**2 -y**2)n = 256
x = np.linspace(-3, 3, n)
y = np.linspace(-3, 3, n)
X, Y = np.meshgrid(x, y)
print(X)
print(Y)# use plt.contourf to filling contours
# X, Y and value for (X,Y) point
plt.contourf(X, Y, f(X, Y), 8, alpha=.75, cmap=plt.cm.hot)# use plt.coutour to add contour lines
C = plt.contour(X, Y, f(X, Y), 8, colors='black', linewidth=.5)
# adding label
plt.clabel(C, inline=True, fontsize=10)plt.xticks(())
plt.yticks(())
plt.show()

contours

2.4 Image图片


# 13 - imageimport matplotlib.pyplot as plt
import numpy as np# image data
a = np.array([0.313660827978, 0.365348418405, 0.423733120134,0.365348418405, 0.439599930621, 0.525083754405,0.423733120134, 0.525083754405, 0.651536351379]).reshape(3,3)"""
for the value of "interpolation", check this:
http://matplotlib.org/examples/images_contours_and_fields/interpolation_methods.html
for the value of "origin"= ['upper', 'lower'], check this:
http://matplotlib.org/examples/pylab_examples/image_origin.html
"""plt.imshow(a, interpolation='nearest', cmap='bone', origin='lower')
plt.colorbar(shrink=.92)plt.xticks(())
plt.yticks(())
plt.show()

image

2.5 3D数据


# 14 - 3dimport matplotlib.pyplot as plt
import numpy as np
from mpl_toolkits.mplot3d import Axes3Dfig = plt.figure()
ax = Axes3D(fig)
# X, Y value
X = np.arange(-4, 4, 0.25)
Y = np.arange(-4, 4, 0.25)
X, Y = np.meshgrid(X, Y)
R = np.sqrt(X ** 2 + Y ** 2)
# height value
Z = np.sin(R)ax.plot_surface(X, Y, Z, rstride=1, cstride=1, cmap=plt.get_cmap('rainbow'))
"""
============= ================================================Argument      Description============= ================================================*X*, *Y*, *Z* Data values as 2D arrays*rstride*     Array row stride (step size), defaults to 10*cstride*     Array column stride (step size), defaults to 10*color*       Color of the surface patches*cmap*        A colormap for the surface patches.*facecolors*  Face colors for the individual patches*norm*        An instance of Normalize to map values to colors*vmin*        Minimum value to map*vmax*        Maximum value to map*shade*       Whether to shade the facecolors============= ================================================
"""# This is different from plt12_contours
ax.contourf(X, Y, Z, zdir='z', offset=-2, cmap=plt.get_cmap('rainbow'))
"""
==========  ================================================Argument    Description==========  ================================================*X*, *Y*,   Data values as numpy.arrays*Z**zdir*      The direction to use: x, y or z (default)*offset*    If specified plot a projection of the filled contouron this position in plane normal to zdir==========  ================================================
"""ax.set_zlim(-2, 2)
plt.show()

3D

3.多图合并显示

3.1 Subplot多合一显示


# 15 - subplotfrom dataclasses import dataclass
import matplotlib.pyplot as plt# example 1:
###############################
plt.figure(figsize=(6, 4))
# plt.subplot(n_rows, n_cols, plot_num)
plt.subplot(2, 2, 1)
plt.plot([0, 1], [0, 1])plt.subplot(222)
plt.plot([0, 1], [0, 2])plt.subplot(223)
plt.plot([0, 1], [0, 3])plt.subplot(224)
plt.plot([0, 1], [0, 4])plt.tight_layout()# example 2:
###############################
plt.figure(figsize=(6, 4))
# plt.subplot(n_rows, n_cols, plot_num)
plt.subplot(2, 1, 1)
# figure splits into 2 rows, 1 col, plot to the 1st sub-fig
plt.plot([0, 1], [0, 1])plt.subplot(234)
# figure splits into 2 rows, 3 col, plot to the 4th sub-fig
plt.plot([0, 1], [0, 2])plt.subplot(235)
# figure splits into 2 rows, 3 col, plot to the 5th sub-fig
plt.plot([0, 1], [0, 3])plt.subplot(236)
# figure splits into 2 rows, 3 col, plot to the 6th sub-fig
plt.plot([0, 1], [0, 4])plt.tight_layout()
plt.show()

subplot1

subplot2

3.2 Subplot分格显示


# 16 - gridimport matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec# method 1: subplot2grid
##########################
plt.figure()
ax1 = plt.subplot2grid((3, 3), (0, 0), colspan=3)   # stands for axes
ax1.plot([1, 2], [1, 2])
ax1.set_title('ax1_title')
ax2 = plt.subplot2grid((3, 3), (1, 0), colspan=2)
ax3 = plt.subplot2grid((3, 3), (1, 2), rowspan=2)
ax4 = plt.subplot2grid((3, 3), (2, 0))
ax4.scatter([1, 2], [2, 2])
ax4.set_xlabel('ax4_x')
ax4.set_ylabel('ax4_y')
ax5 = plt.subplot2grid((3, 3), (2, 1))# method 2: gridspec
#########################
plt.figure()
gs = gridspec.GridSpec(3, 3)
# use index form 0
ax6 = plt.subplot(gs[0, :])
ax7 = plt.subplot(gs[1, :2])
ax8 = plt.subplot(gs[1:, 2])
ax9 = plt.subplot(gs[-1, 0])
ax10 = plt.subplot(gs[-1, -2])# method 3: easy to define structure
####################################
f, ((ax11, ax12), (ax13, ax14)) = plt.subplots(2, 2, sharex=True, sharey=True)
ax11.scatter([1, 2], [1, 2])plt.tight_layout()
plt.show()

grid1

grid2

grid3

3.3 图中图


# 17 - plot in plot
import matplotlib.pyplot as pltfig = plt.figure()
x = [1, 2, 3, 4, 5, 6, 7]
y = [1, 3, 4, 2, 5, 8, 6]# below are all percentage
left, bottom, width, height = 0.1, 0.1, 0.8, 0.8
ax1 = fig.add_axes([left, bottom, width, height])   # main axes
ax1.plot(x, y, 'r')
ax1.set_xlabel('x')
ax1.set_ylabel('y')
ax1.set_title('title')ax2 = fig.add_axes([0.2, 0.6, 0.25, 0.25])  # inside axes
ax2.plot(y, x, 'b')
ax2.set_xlabel('x')
ax2.set_ylabel('y')
ax2.set_title('title inside 1')# different method to add axes
####################################
plt.axes([0.6, 0.2, 0.25, 0.25])
plt.plot(y[::-1], x, 'g')
plt.xlabel('x')
plt.ylabel('y')
plt.title('title inside 2')
plt.show()

plot in plot

3.4 次坐标轴


# 18 - secondary y axisimport matplotlib.pyplot as plt
import numpy as npx = np.arange(0, 10, 0.1)
y1 = 0.05 * x ** 2
y2 = -1 * y1fig, ax1 = plt.subplots()ax2 = ax1.twinx()   # mirror the ax1
ax1.plot(x, y1, 'g-')
ax2.plot(x, y2, 'b-')ax1.set_xlabel('X data')
ax1.set_ylabel('Y1 data', color='g')
ax2.set_ylabel('Y2 data', color='b')
plt.savefig("18.png")
plt.show()

secondary y axis

4.动画

4.1 Animation动画


# 19 - animationimport matplotlib.pyplot as plt
from matplotlib import animation
import numpy as npfig, ax = plt.subplots()x = np.arange(0, 2 * np.pi, 0.01)
line, = ax.plot(x, np.sin(x))def animate(i):line.set_ydata(np.sin(x + i/10.0))  # update the datareturn line,def init():line.set_ydata(np.sin(x))return line,# call the animator.  blit=True means only re-draw the parts that have changed.
# blit=True dose not work on Mac, set blit=False
# interval= update frequency
ani = animation.FuncAnimation(fig=fig, func=animate, frames=100, init_func=init, interval=20, blit=False)# save the animation as an mp4.  This requires ffmpeg or mencoder to be
# installed.  The extra_args ensure that the x264 codec is used, so that
# the video can be embedded in html5.  You may need to adjust this for
# your system: for more information, see
# http://matplotlib.sourceforge.net/api/animation_api.html
# anim.save('basic_animation.mp4', fps=30, extra_args=['-vcodec', 'libx264'])# ani.save("19.gif", writer='imagemagick')
plt.show()

animation

结语

代码仅供自己参考,大家可以查看对应的教程视频自行学习。

参考

  • 莫烦Python
  • https://mofanpy.com/tutorials/data-manipulation/plt/
  • 【莫烦Python】Matplotlib Python画图教程
  • https://github.com/MorvanZhou/tutorials/tree/master/matplotlibTUT
  • matplotlib官方文档

【莫烦Python】Matplotlib Python画图教程相关推荐

  1. python matplotlib三维画图、二维画图常用命令总结

    python常用画图命令总结 1.python matplotlib三维画图 2.python matplotlib二维画图 1.python matplotlib三维画图 import matplo ...

  2. 莫烦python简历_Matplotlib画图教程

    目录 1 Matplotlib 简介 -----1.1 为什么用Matplotlib? -----1.2 Matplotlib 安装 2 基本使用 -----2.1 基本用法 -----2.2 fig ...

  3. python matplotlib数据可视化教程_matplotlib的Python数据可视化和探索——入门指南

    matplotlib--最受欢迎的Python库,用于数据可视化和探索 我喜欢在Python中使用matplotlib.这是我学会掌握的第一个可视化库,此后一直存在.matplotlib是最受欢迎的用 ...

  4. python matplotlib 论文画图代码总结

    最近赶了一篇论文,其中涉及到很多实验结果的绘制.最开始使用了pandas自带的plot功能,使用简单,但是很多细节都无法自己调节定制,默认的结果又相当的丑.于是参考了csdn上各位大佬的分享,这些分享 ...

  5. Windows 环境 python matplotlib 包画图时 英文数字显示正常 中文乱码问题

    在用matplotlib包画图时,如果只是在英文的工作环境,图中英文.数字还是符号一般显示都是正常的.但是,当在图中使用中文的文本显示时,往往会在本应该中文文字显示的区域乱码,乱码的形式有很多种情况, ...

  6. python matplotlib数据可视化教程_Python使用matplotlib实现数据可视化教程

    目前有很多 工具 都可以数实现据可视化,比如我们常用的Excel,还有数据科学另一门重要的语言R,以及百度的Echarts等可视化工具.今天我们的主角是 Python 中的matplotlib库(官网 ...

  7. 【环境配置】python+matplotlib简单安装教程

    图像处理必备库--matplotlib安装 matplotlib简介 python安装以及环境配置 matplotlib安装 matplotlib简介 matplotlib是基于python语言的开源 ...

  8. python matplotlib plt 画图总结

    文章目录 笔记主页 绘图默认参数设置 1 绘图 1.1 曲线图 绘制双Y轴图 绘制多个子图 1.2 散点图 1.3 箱型图 2 颜色 2.1 默认颜色 2.2 颜色库 2.3 三维图背景改成白色 3 ...

  9. python matplotlib plt 画图 将刻度 替换为文字/字符以及画断断续续的分段函数

    直接上代码 import numpy as npimport matplotlib.pyplot as plt from pylab import * import matplotlib; matpl ...

  10. Python matplotlib 论文画图之常用操作

    1. 改变图的大小 # figsize的2.8和1.7指的是英寸,dpi指定图片分辨率.那么图片就是(2.8*300)*(1.7*300)像素大小 figure(num=None, figsize=( ...

最新文章

  1. CSS中的字体属性和使用
  2. java dagger2_java – Dagger2不生成Daggercomponent类
  3. CSS3弹性盒模型之box-orient box-direction
  4. 多线程不重复读取数据_别再犯错了,多线程访问同一个资源一定要上锁?
  5. java pc 蓝牙_Nokia PC 套件与蓝牙适配器连接教程(转)--个人推荐
  6. mysql 表中中文不显示
  7. ACM程序设计选修课——1024: 末位零(求末尾0的方法+可有可无的快速幂)
  8. 使用AVR-GCC编程Arduino
  9. 微信小程序位置定位php,【微信开发】微信小程序通过经纬度计算两地距离php代码实现...
  10. 【经验分享】优麒麟上的硬盘读写性能测试
  11. 自制solidworks图框步骤_如何建立标准的solidworks图框模板
  12. 【C++】:动态库与静态库区别
  13. MindManager下载和使用
  14. 用户验收测试要求目标
  15. 抖音弹幕解析过程 PB数据转json 解决乱码 所有语言通用思路
  16. 元宇宙「虚拟世界」,构建身临其境的社交世界
  17. Python 利用 turtle画出樱花树
  18. 小米全色激光影院对比当贝X3激光投影仪哪个更好
  19. python第二周day3
  20. 几个目标检测算法的比较——yolov4,yolov4-tiny,faster-rcnn

热门文章

  1. 任务二:Crypto学习
  2. PMP证书续证详细流程!!
  3. 【编程随想】聊聊分布式散列表(DHT)的原理——以 Kademlia(Kad) 和 Chord 为例
  4. iOS 源生推送和极光推送
  5. 层次化文本分类Hierarchical Multi-Label Classification Networks
  6. 计算机二级excel高级筛选,Excel高级筛选,看这一篇就够了!
  7. itext设置pdf的尺寸_iText图像调整大小
  8. 可调电位器/滑动变阻器拆解
  9. ip地址和mac地址的区别以及tpc/ip四层网络协议
  10. Tomcat内存溢出原因分析