英文叫做dashed line 和dash-dot line。 线条通过参数linestyle来设置,我们先来看看全虚线,两个短线表示全虚线。如果是一根短线表示实线,也就是默认的style。 除了虚线图之外还有点线图和点状图,这两者顾名思义,大家应该不难猜出来。 三合一 我们回顾一下我们刚才介绍的,一共有三种特性,分别是标记、线条以及颜色。
2. ‘--’ dashed line style 3. '-.' dash-dot line style 4. ':' dotted line style 三、数据点形状 1. '.' point marker 2. 'o' circle marker 3. 'v' triangle_down marker 4. '^' triangle_down marker 5. '>...
importnumpy as npimportpandas as pdimportmatplotlib.pyplot as plt%matplotlib inline#导入相关模块#linestyle参数plt.plot([i**2foriinrange(100)], linestyle='-.')#不用设置的时候默认为直线‘-’#'-' solid line style#'--' dashed line style#'-.' dash-dot line style#':' dotted line style ...
``'-'`` solid line style ``'--'`` dashed line style ``'-.'`` dash-dot line style ``':'`` dotted line style ``'.'`` point marker ``','`` pixel marker ``'o'`` circle marker ``'v'`` triangle_down marker ``'^'`` triangle_up marker ``'<'`` triangle_left marker `...
'-':实线(solid line style) '--':虚线(dashed line style) '-.':点划线(dash-dot line style) ':':点线(dotted line style) 绘制散点图 matplotlib.pyplot.scatter(x, y, s=None, c=None, marker=None, cmap=None, norm=None, vmin=None, vmax=None, alpha=None, linewidths=None, verts=None...
x=np.linspace(0,10,100)y=np.sin(x)plt.figure(figsize=(10,6))plt.plot(x,y,linestyle='-',label='Solid')plt.plot(x,y+1,linestyle='--',label='Dashed')plt.plot(x,y+2,linestyle='-.',label='Dash-dot')plt.plot(x,y+3,linestyle=':',label='Dotted')plt.title('Basic Line Styl...
matplotlib.pyplt.plot(x, y, linestyle='dashed') The above-used parameters are outlined as below: x:X-axis coordinates of the points on the line. y:Y-axis coordinates of the points on the line. linestyle:special feature used to change the style of the line. We mention it as dashed be...
``'-'`` solid line style ``'--'`` dashed line style ``'-.'`` dash-dot line style ``':'`` dotted line style === === **Colors** The supported color abbreviations are the single letter codes === === # 颜色也可以是16进制的颜色代码 character color...
'--' dashed line style(线虚) '-.' dash-dot line style ':' dotted line style(点虚)''' market: https://matplotlib.org/api/markers_api.html View text 颜色: https://matplotlib.org/users/colormaps.html https://matplotlib.org/examples/color/colormaps_reference.html ...
'-' solid line style '--' dashed line style '-.' dash-dot line style ':' dotted line style Example format strings: 'b' # blue markers with default shape 'or' # red circles '-g' # green solid line '--' # dashed line with default color '^k:' # black triangle_up markers conn...