- 阅读权限
- 255
- 威望
- 1 级
- 论坛币
- 26913 个
- 通用积分
- 429.8724
- 学术水平
- 95 点
- 热心指数
- 109 点
- 信用等级
- 91 点
- 经验
- 39970 点
- 帖子
- 1630
- 精华
- 3
- 在线时间
- 580 小时
- 注册时间
- 2019-2-25
- 最后登录
- 2025-5-6
|
藤椅
时光人
发表于 2019-12-3 09:59:19
10. 发散型条形图 如果您想根据单个指标查看项目的变化情况,并可视化此差异的顺序和数量,那么发散条是一个很好的工具。它有助于快速区分数据中组的性能,并且非常直观,并且可以立即传达这一点。 - # Prepare Data
- df = pd.read_csv("https://github.com/selva86/datasets/raw/master/mtcars.csv")
- x = df.loc[:, ['mpg']]
- df['mpg_z'] = (x - x.mean())/x.std()
- df['colors'] = ['red' if x < 0 else 'green' for x in df['mpg_z']]
- df.sort_values('mpg_z', inplace=True)
- df.reset_index(inplace=True)
- # Draw plot
- plt.figure(figsize=(14,10), dpi= 80)
- plt.hlines(y=df.index, xmin=0, xmax=df.mpg_z, color=df.colors, alpha=0.4, linewidth=5)
- # Decorations
- plt.gca().set(ylabel='$Model
- [align=center][color=rgb(34, 34, 34)][backcolor=rgb(255, 255, 255)][font="][size=14px][img]https://p3.pstatp.com/large/pgc-image/51250e14d15345a59392bb01781b3661[/img][/size][/font][/backcolor][/color][/align]
- [align=left][color=rgb(34, 34, 34)][backcolor=rgb(255, 255, 255)][font="][size=14px]11. 发散型文本[/size][/font][/backcolor][/color][/align][align=left][color=rgb(34, 34, 34)][backcolor=rgb(255, 255, 255)][font="][size=14px]分散的文本类似于发散条,如果你想以一种漂亮和可呈现的方式显示图表中每个项目的价值,它更喜欢。[/size][/font][/backcolor][/color][/align][code]# Prepare Data
- df = pd.read_csv("https://github.com/selva86/datasets/raw/master/mtcars.csv")
- x = df.loc[:, ['mpg']]
- df['mpg_z'] = (x - x.mean())/x.std()
- df['colors'] = ['red' if x < 0 else 'green' for x in df['mpg_z']]
- df.sort_values('mpg_z', inplace=True)
- df.reset_index(inplace=True)
- # Draw plot
- plt.figure(figsize=(14,14), dpi= 80)
- plt.hlines(y=df.index, xmin=0, xmax=df.mpg_z)
- for x, y, tex in zip(df.mpg_z, df.index, df.mpg_z):
- t = plt.text(x, y, round(tex, 2), horizontalalignment='right' if x < 0 else 'left',
- verticalalignment='center', fontdict={'color':'red' if x < 0 else 'green', 'size':14})
- # Decorations
- plt.yticks(df.index, df.cars, fontsize=12)
- plt.title('Diverging Text Bars of Car Mileage', fontdict={'size':20})
- plt.grid(linestyle='--', alpha=0.5)
- plt.xlim(-2.5, 2.5)
- plt.show()
复制代码

12. 发散型包点图 发散点图也类似于发散条。然而,与发散条相比,条的不存在减少了组之间的对比度和差异。 - # Prepare Data
- df = pd.read_csv("https://github.com/selva86/datasets/raw/master/mtcars.csv")
- x = df.loc[:, ['mpg']]
- df['mpg_z'] = (x - x.mean())/x.std()
- df['colors'] = ['red' if x < 0 else 'darkgreen' for x in df['mpg_z']]
- df.sort_values('mpg_z', inplace=True)
- df.reset_index(inplace=True)
- # Draw plot
- plt.figure(figsize=(14,16), dpi= 80)
- plt.scatter(df.mpg_z, df.index, s=450, alpha=.6, color=df.colors)
- for x, y, tex in zip(df.mpg_z, df.index, df.mpg_z):
- t = plt.text(x, y, round(tex, 1), horizontalalignment='center',
- verticalalignment='center', fontdict={'color':'white'})
- # Decorations
- # Lighten borders
- plt.gca().spines["top"].set_alpha(.3)
- plt.gca().spines["bottom"].set_alpha(.3)
- plt.gca().spines["right"].set_alpha(.3)
- plt.gca().spines["left"].set_alpha(.3)
- plt.yticks(df.index, df.cars)
- plt.title('Diverging Dotplot of Car Mileage', fontdict={'size':20})
- plt.xlabel('$Mileage
- [img]https://p1.pstatp.com/large/pgc-image/dd9880350784481e93a8d042eac5abd2[/img][align=left][color=rgb(34, 34, 34)][backcolor=rgb(255, 255, 255)][font="][size=14px]13. 带标记的发散型棒棒糖图[/size][/font][/backcolor][/color][/align][align=left][color=rgb(34, 34, 34)][backcolor=rgb(255, 255, 255)][font="][size=14px]带标记的棒棒糖通过强调您想要引起注意的任何重要数据点并在图表中适当地给出推理,提供了一种可视化分歧的灵活方式。[/size][/font][/backcolor][/color][/align][code]# Prepare Data
- df = pd.read_csv("https://github.com/selva86/datasets/raw/master/mtcars.csv")
- x = df.loc[:, ['mpg']]
- df['mpg_z'] = (x - x.mean())/x.std()
- df['colors'] = 'black'
- # color fiat differently
- df.loc[df.cars == 'Fiat X1-9', 'colors'] = 'darkorange'
- df.sort_values('mpg_z', inplace=True)
- df.reset_index(inplace=True)
- # Draw plot
- import matplotlib.patches as patches
- plt.figure(figsize=(14,16), dpi= 80)
- plt.hlines(y=df.index, xmin=0, xmax=df.mpg_z, color=df.colors, alpha=0.4, linewidth=1)
- plt.scatter(df.mpg_z, df.index, color=df.colors, s=[600 if x == 'Fiat X1-9' else 300 for x in df.cars], alpha=0.6)
- plt.yticks(df.index, df.cars)
- plt.xticks(fontsize=12)
- # Annotate
- plt.annotate('Mercedes Models', xy=(0.0, 11.0), xytext=(1.0, 11), xycoords='data',
- fontsize=15, ha='center', va='center',
- bbox=dict(boxstyle='square', fc='firebrick'),
- arrowprops=dict(arrowstyle='-[, widthB=2.0, lengthB=1.5', lw=2.0, color='steelblue'), color='white')
- # Add Patches
- p1 = patches.Rectangle((-2.0, -1), width=.3, height=3, alpha=.2, facecolor='red')
- p2 = patches.Rectangle((1.5, 27), width=.8, height=5, alpha=.2, facecolor='green')
- plt.gca().add_patch(p1)
- plt.gca().add_patch(p2)
- # Decorate
- plt.title('Diverging Bars of Car Mileage', fontdict={'size':20})
- plt.grid(linestyle='--', alpha=0.5)
- plt.show()
复制代码

, xlabel='$Mileage

11. 发散型文本 分散的文本类似于发散条,如果你想以一种漂亮和可呈现的方式显示图表中每个项目的价值,它更喜欢。 - # Import dataset
- midwest = pd.read_csv("https://raw.githubusercontent.com/selva86/datasets/master/midwest_filter.csv")
- # Prepare Data
- # Create as many colors as there are unique midwest['category']
- categories = np.unique(midwest['category'])
- colors = [plt.cm.tab10(i/float(len(categories)-1)) for i in range(len(categories))]
- # Draw Plot for Each Category
- plt.figure(figsize=(16, 10), dpi= 80, facecolor='w', edgecolor='k')
- for i, category in enumerate(categories):
- plt.scatter('area', 'poptotal',
- data=midwest.loc[midwest.category==category, :],
- s=20, c=colors[i], label=str(category))
- # Decorations
- plt.gca().set(xlim=(0.0, 0.1), ylim=(0, 90000),
- xlabel='Area', ylabel='Population')
- plt.xticks(fontsize=12); plt.yticks(fontsize=12)
- plt.title("Scatterplot of Midwest Area vs Population", fontsize=22)
- plt.legend(fontsize=12)
- plt.show()
复制代码

12. 发散型包点图 发散点图也类似于发散条。然而,与发散条相比,条的不存在减少了组之间的对比度和差异。 - from matplotlib import patches
- from scipy.spatial import ConvexHull
- import warnings; warnings.simplefilter('ignore')
- sns.set_style("white")
- # Step 1: Prepare Data
- midwest = pd.read_csv("https://raw.githubusercontent.com/selva86/datasets/master/midwest_filter.csv")
- # As many colors as there are unique midwest['category']
- categories = np.unique(midwest['category'])
- colors = [plt.cm.tab10(i/float(len(categories)-1)) for i in range(len(categories))]
- # Step 2: Draw Scatterplot with unique color for each category
- fig = plt.figure(figsize=(16, 10), dpi= 80, facecolor='w', edgecolor='k')
- for i, category in enumerate(categories):
- plt.scatter('area', 'poptotal', data=midwest.loc[midwest.category==category, :], s='dot_size', c=colors[i], label=str(category), edgecolors='black', linewidths=.5)
- # Step 3: Encircling
- # https://stackoverflow.com/questions/44575681/how-do-i-encircle-different-data-sets-in-scatter-plot
- def encircle(x,y, ax=None, **kw):
- if not ax: ax=plt.gca()
- p = np.c_[x,y]
- hull = ConvexHull(p)
- poly = plt.Polygon(p[hull.vertices,:], **kw)
- ax.add_patch(poly)
- # Select data to be encircled
- midwest_encircle_data = midwest.loc[midwest.state=='IN', :]
- # Draw polygon surrounding vertices
- encircle(midwest_encircle_data.area, midwest_encircle_data.poptotal, ec="k", fc="gold", alpha=0.1)
- encircle(midwest_encircle_data.area, midwest_encircle_data.poptotal, ec="firebrick", fc="none", linewidth=1.5)
- # Step 4: Decorations
- plt.gca().set(xlim=(0.0, 0.1), ylim=(0, 90000),
- xlabel='Area', ylabel='Population')
- plt.xticks(fontsize=12); plt.yticks(fontsize=12)
- plt.title("Bubble Plot with Encircling", fontsize=22)
- plt.legend(fontsize=12)
- plt.show()
复制代码
 13. 带标记的发散型棒棒糖图 带标记的棒棒糖通过强调您想要引起注意的任何重要数据点并在图表中适当地给出推理,提供了一种可视化分歧的灵活方式。 - # Import Data
- df = pd.read_csv("https://raw.githubusercontent.com/selva86/datasets/master/mpg_ggplot2.csv")
- df_select = df.loc[df.cyl.isin([4,8]), :]
- # Plot
- sns.set_style("white")
- gridobj = sns.lmplot(x="displ", y="hwy", hue="cyl", data=df_select,
- height=7, aspect=1.6, robust=True, palette='tab10',
- scatter_kws=dict(s=60, linewidths=.7, edgecolors='black'))
- # Decorations
- gridobj.set(xlim=(0.5, 7.5), ylim=(0, 50))
- plt.title("Scatterplot with line of best fit grouped by number of cylinders", fontsize=20)
复制代码

)
plt.yticks(df.index, df.cars, fontsize=12)
plt.title('Diverging Bars of Car Mileage', fontdict={'size':20})
plt.grid(linestyle='--', alpha=0.5)
plt.show()[/code]

11. 发散型文本 分散的文本类似于发散条,如果你想以一种漂亮和可呈现的方式显示图表中每个项目的价值,它更喜欢。 - # Import dataset
- midwest = pd.read_csv("https://raw.githubusercontent.com/selva86/datasets/master/midwest_filter.csv")
- # Prepare Data
- # Create as many colors as there are unique midwest['category']
- categories = np.unique(midwest['category'])
- colors = [plt.cm.tab10(i/float(len(categories)-1)) for i in range(len(categories))]
- # Draw Plot for Each Category
- plt.figure(figsize=(16, 10), dpi= 80, facecolor='w', edgecolor='k')
- for i, category in enumerate(categories):
- plt.scatter('area', 'poptotal',
- data=midwest.loc[midwest.category==category, :],
- s=20, c=colors[i], label=str(category))
- # Decorations
- plt.gca().set(xlim=(0.0, 0.1), ylim=(0, 90000),
- xlabel='Area', ylabel='Population')
- plt.xticks(fontsize=12); plt.yticks(fontsize=12)
- plt.title("Scatterplot of Midwest Area vs Population", fontsize=22)
- plt.legend(fontsize=12)
- plt.show()
复制代码

12. 发散型包点图 发散点图也类似于发散条。然而,与发散条相比,条的不存在减少了组之间的对比度和差异。 - from matplotlib import patches
- from scipy.spatial import ConvexHull
- import warnings; warnings.simplefilter('ignore')
- sns.set_style("white")
- # Step 1: Prepare Data
- midwest = pd.read_csv("https://raw.githubusercontent.com/selva86/datasets/master/midwest_filter.csv")
- # As many colors as there are unique midwest['category']
- categories = np.unique(midwest['category'])
- colors = [plt.cm.tab10(i/float(len(categories)-1)) for i in range(len(categories))]
- # Step 2: Draw Scatterplot with unique color for each category
- fig = plt.figure(figsize=(16, 10), dpi= 80, facecolor='w', edgecolor='k')
- for i, category in enumerate(categories):
- plt.scatter('area', 'poptotal', data=midwest.loc[midwest.category==category, :], s='dot_size', c=colors[i], label=str(category), edgecolors='black', linewidths=.5)
- # Step 3: Encircling
- # https://stackoverflow.com/questions/44575681/how-do-i-encircle-different-data-sets-in-scatter-plot
- def encircle(x,y, ax=None, **kw):
- if not ax: ax=plt.gca()
- p = np.c_[x,y]
- hull = ConvexHull(p)
- poly = plt.Polygon(p[hull.vertices,:], **kw)
- ax.add_patch(poly)
- # Select data to be encircled
- midwest_encircle_data = midwest.loc[midwest.state=='IN', :]
- # Draw polygon surrounding vertices
- encircle(midwest_encircle_data.area, midwest_encircle_data.poptotal, ec="k", fc="gold", alpha=0.1)
- encircle(midwest_encircle_data.area, midwest_encircle_data.poptotal, ec="firebrick", fc="none", linewidth=1.5)
- # Step 4: Decorations
- plt.gca().set(xlim=(0.0, 0.1), ylim=(0, 90000),
- xlabel='Area', ylabel='Population')
- plt.xticks(fontsize=12); plt.yticks(fontsize=12)
- plt.title("Bubble Plot with Encircling", fontsize=22)
- plt.legend(fontsize=12)
- plt.show()
复制代码
 13. 带标记的发散型棒棒糖图 带标记的棒棒糖通过强调您想要引起注意的任何重要数据点并在图表中适当地给出推理,提供了一种可视化分歧的灵活方式。 - # Import Data
- df = pd.read_csv("https://raw.githubusercontent.com/selva86/datasets/master/mpg_ggplot2.csv")
- df_select = df.loc[df.cyl.isin([4,8]), :]
- # Plot
- sns.set_style("white")
- gridobj = sns.lmplot(x="displ", y="hwy", hue="cyl", data=df_select,
- height=7, aspect=1.6, robust=True, palette='tab10',
- scatter_kws=dict(s=60, linewidths=.7, edgecolors='black'))
- # Decorations
- gridobj.set(xlim=(0.5, 7.5), ylim=(0, 50))
- plt.title("Scatterplot with line of best fit grouped by number of cylinders", fontsize=20)
复制代码

)
plt.grid(linestyle='--', alpha=0.5)
plt.xlim(-2.5, 2.5)
plt.show()
数据分析最有用的25个 Matplotlib图(一)[/code]
 13. 带标记的发散型棒棒糖图 带标记的棒棒糖通过强调您想要引起注意的任何重要数据点并在图表中适当地给出推理,提供了一种可视化分歧的灵活方式。 - # Import Data
- df = pd.read_csv("https://raw.githubusercontent.com/selva86/datasets/master/mpg_ggplot2.csv")
- df_select = df.loc[df.cyl.isin([4,8]), :]
- # Plot
- sns.set_style("white")
- gridobj = sns.lmplot(x="displ", y="hwy", hue="cyl", data=df_select,
- height=7, aspect=1.6, robust=True, palette='tab10',
- scatter_kws=dict(s=60, linewidths=.7, edgecolors='black'))
- # Decorations
- gridobj.set(xlim=(0.5, 7.5), ylim=(0, 50))
- plt.title("Scatterplot with line of best fit grouped by number of cylinders", fontsize=20)
复制代码

, xlabel='$Mileage

11. 发散型文本 分散的文本类似于发散条,如果你想以一种漂亮和可呈现的方式显示图表中每个项目的价值,它更喜欢。 - # Import dataset
- midwest = pd.read_csv("https://raw.githubusercontent.com/selva86/datasets/master/midwest_filter.csv")
- # Prepare Data
- # Create as many colors as there are unique midwest['category']
- categories = np.unique(midwest['category'])
- colors = [plt.cm.tab10(i/float(len(categories)-1)) for i in range(len(categories))]
- # Draw Plot for Each Category
- plt.figure(figsize=(16, 10), dpi= 80, facecolor='w', edgecolor='k')
- for i, category in enumerate(categories):
- plt.scatter('area', 'poptotal',
- data=midwest.loc[midwest.category==category, :],
- s=20, c=colors[i], label=str(category))
- # Decorations
- plt.gca().set(xlim=(0.0, 0.1), ylim=(0, 90000),
- xlabel='Area', ylabel='Population')
- plt.xticks(fontsize=12); plt.yticks(fontsize=12)
- plt.title("Scatterplot of Midwest Area vs Population", fontsize=22)
- plt.legend(fontsize=12)
- plt.show()
复制代码

12. 发散型包点图 发散点图也类似于发散条。然而,与发散条相比,条的不存在减少了组之间的对比度和差异。 - from matplotlib import patches
- from scipy.spatial import ConvexHull
- import warnings; warnings.simplefilter('ignore')
- sns.set_style("white")
- # Step 1: Prepare Data
- midwest = pd.read_csv("https://raw.githubusercontent.com/selva86/datasets/master/midwest_filter.csv")
- # As many colors as there are unique midwest['category']
- categories = np.unique(midwest['category'])
- colors = [plt.cm.tab10(i/float(len(categories)-1)) for i in range(len(categories))]
- # Step 2: Draw Scatterplot with unique color for each category
- fig = plt.figure(figsize=(16, 10), dpi= 80, facecolor='w', edgecolor='k')
- for i, category in enumerate(categories):
- plt.scatter('area', 'poptotal', data=midwest.loc[midwest.category==category, :], s='dot_size', c=colors[i], label=str(category), edgecolors='black', linewidths=.5)
- # Step 3: Encircling
- # https://stackoverflow.com/questions/44575681/how-do-i-encircle-different-data-sets-in-scatter-plot
- def encircle(x,y, ax=None, **kw):
- if not ax: ax=plt.gca()
- p = np.c_[x,y]
- hull = ConvexHull(p)
- poly = plt.Polygon(p[hull.vertices,:], **kw)
- ax.add_patch(poly)
- # Select data to be encircled
- midwest_encircle_data = midwest.loc[midwest.state=='IN', :]
- # Draw polygon surrounding vertices
- encircle(midwest_encircle_data.area, midwest_encircle_data.poptotal, ec="k", fc="gold", alpha=0.1)
- encircle(midwest_encircle_data.area, midwest_encircle_data.poptotal, ec="firebrick", fc="none", linewidth=1.5)
- # Step 4: Decorations
- plt.gca().set(xlim=(0.0, 0.1), ylim=(0, 90000),
- xlabel='Area', ylabel='Population')
- plt.xticks(fontsize=12); plt.yticks(fontsize=12)
- plt.title("Bubble Plot with Encircling", fontsize=22)
- plt.legend(fontsize=12)
- plt.show()
复制代码
 13. 带标记的发散型棒棒糖图 带标记的棒棒糖通过强调您想要引起注意的任何重要数据点并在图表中适当地给出推理,提供了一种可视化分歧的灵活方式。 - # Import Data
- df = pd.read_csv("https://raw.githubusercontent.com/selva86/datasets/master/mpg_ggplot2.csv")
- df_select = df.loc[df.cyl.isin([4,8]), :]
- # Plot
- sns.set_style("white")
- gridobj = sns.lmplot(x="displ", y="hwy", hue="cyl", data=df_select,
- height=7, aspect=1.6, robust=True, palette='tab10',
- scatter_kws=dict(s=60, linewidths=.7, edgecolors='black'))
- # Decorations
- gridobj.set(xlim=(0.5, 7.5), ylim=(0, 50))
- plt.title("Scatterplot with line of best fit grouped by number of cylinders", fontsize=20)
复制代码

)
plt.yticks(df.index, df.cars, fontsize=12)
plt.title('Diverging Bars of Car Mileage', fontdict={'size':20})
plt.grid(linestyle='--', alpha=0.5)
plt.show()[/code]

11. 发散型文本 分散的文本类似于发散条,如果你想以一种漂亮和可呈现的方式显示图表中每个项目的价值,它更喜欢。 - # Import dataset
- midwest = pd.read_csv("https://raw.githubusercontent.com/selva86/datasets/master/midwest_filter.csv")
- # Prepare Data
- # Create as many colors as there are unique midwest['category']
- categories = np.unique(midwest['category'])
- colors = [plt.cm.tab10(i/float(len(categories)-1)) for i in range(len(categories))]
- # Draw Plot for Each Category
- plt.figure(figsize=(16, 10), dpi= 80, facecolor='w', edgecolor='k')
- for i, category in enumerate(categories):
- plt.scatter('area', 'poptotal',
- data=midwest.loc[midwest.category==category, :],
- s=20, c=colors[i], label=str(category))
- # Decorations
- plt.gca().set(xlim=(0.0, 0.1), ylim=(0, 90000),
- xlabel='Area', ylabel='Population')
- plt.xticks(fontsize=12); plt.yticks(fontsize=12)
- plt.title("Scatterplot of Midwest Area vs Population", fontsize=22)
- plt.legend(fontsize=12)
- plt.show()
复制代码

12. 发散型包点图 发散点图也类似于发散条。然而,与发散条相比,条的不存在减少了组之间的对比度和差异。 - from matplotlib import patches
- from scipy.spatial import ConvexHull
- import warnings; warnings.simplefilter('ignore')
- sns.set_style("white")
- # Step 1: Prepare Data
- midwest = pd.read_csv("https://raw.githubusercontent.com/selva86/datasets/master/midwest_filter.csv")
- # As many colors as there are unique midwest['category']
- categories = np.unique(midwest['category'])
- colors = [plt.cm.tab10(i/float(len(categories)-1)) for i in range(len(categories))]
- # Step 2: Draw Scatterplot with unique color for each category
- fig = plt.figure(figsize=(16, 10), dpi= 80, facecolor='w', edgecolor='k')
- for i, category in enumerate(categories):
- plt.scatter('area', 'poptotal', data=midwest.loc[midwest.category==category, :], s='dot_size', c=colors[i], label=str(category), edgecolors='black', linewidths=.5)
- # Step 3: Encircling
- # https://stackoverflow.com/questions/44575681/how-do-i-encircle-different-data-sets-in-scatter-plot
- def encircle(x,y, ax=None, **kw):
- if not ax: ax=plt.gca()
- p = np.c_[x,y]
- hull = ConvexHull(p)
- poly = plt.Polygon(p[hull.vertices,:], **kw)
- ax.add_patch(poly)
- # Select data to be encircled
- midwest_encircle_data = midwest.loc[midwest.state=='IN', :]
- # Draw polygon surrounding vertices
- encircle(midwest_encircle_data.area, midwest_encircle_data.poptotal, ec="k", fc="gold", alpha=0.1)
- encircle(midwest_encircle_data.area, midwest_encircle_data.poptotal, ec="firebrick", fc="none", linewidth=1.5)
- # Step 4: Decorations
- plt.gca().set(xlim=(0.0, 0.1), ylim=(0, 90000),
- xlabel='Area', ylabel='Population')
- plt.xticks(fontsize=12); plt.yticks(fontsize=12)
- plt.title("Bubble Plot with Encircling", fontsize=22)
- plt.legend(fontsize=12)
- plt.show()
复制代码
 13. 带标记的发散型棒棒糖图 带标记的棒棒糖通过强调您想要引起注意的任何重要数据点并在图表中适当地给出推理,提供了一种可视化分歧的灵活方式。 - # Import Data
- df = pd.read_csv("https://raw.githubusercontent.com/selva86/datasets/master/mpg_ggplot2.csv")
- df_select = df.loc[df.cyl.isin([4,8]), :]
- # Plot
- sns.set_style("white")
- gridobj = sns.lmplot(x="displ", y="hwy", hue="cyl", data=df_select,
- height=7, aspect=1.6, robust=True, palette='tab10',
- scatter_kws=dict(s=60, linewidths=.7, edgecolors='black'))
- # Decorations
- gridobj.set(xlim=(0.5, 7.5), ylim=(0, 50))
- plt.title("Scatterplot with line of best fit grouped by number of cylinders", fontsize=20)
复制代码
|
-
总评分: 经验 + 100
查看全部评分
|