- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
给出以下示例:
A = [0, 1, 2]
B = [3, 4, 5]
C = [6, 7, 8, 9]
df = pd.DataFrame(data = {'D': np.random.randn(3*3*4)},
index = pd.MultiIndex.from_product([A, B, C], names=['A', 'B', 'C']))
df.reset_index(['B', 'C'], inplace=True)
def facet_heatmap(data, color):
data = data.pivot(columns='B', values='D')
ax = sns.heatmap(data, square=True, cmap="coolwarm", linewidths=0.0, rasterized=True, cbar=False)
ax.invert_yaxis()
g = sns.FacetGrid(df, col='C', col_wrap=2)
g.map_dataframe(facet_heatmap)
当使用可选参数 square=True 时,网格的每个子图中都有一些灰色边框。但是,当 square=False (默认值)时,灰色边框消失。有人知道如何在保持 square=True 的同时删除灰色边框吗?
最佳答案
这不是边框,只是灰色背景。您可以使用seaborn的set_style
函数将其设置为白色:
sns.set_style("whitegrid")
关于python - Seaborn FacetGrid + 热图灰色边框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44332117/
我正在尝试创建一个 seaborn FacetGrid 来显示我拥有的某些数据中集群之间的转换概率。数据有一堆主题和 4 个集群(因此每个主题有 16 个数据点,每对新旧集群一个)。因为这些是概率,所
我的结构遵循 pandas DataFrame: n X Y Z 0 1.000000 1.000000 1.014925 1
我一直在与 seaborn.catplot 一起工作为了有一个条形图(下面的数据样本)将 counts 中的值相加一套的列reasons ,由一组公司分隔: sns.catplot(x='Bill_N
我有以下代码可以创建您可以在图片中看到的情节: g = sns.FacetGrid(data, col="Provincia",col_wrap=6,size=2.5) g.map(sns.barpl
我使用 Seaborn 绘制了一个简单的 RelPlot,它返回了一个 Facetgrid 对象。我使用的代码如下: import seaborn as sns palette = sns.color
我有一组数据,我正在尝试使用 seaborn 中的 FacetGrid 绘制这些数据。每个数据点都有一个与之相关的权重,我想在网格的每个方面绘制一个加权直方图。 例如,假设我有以下(随机创建的)数据集
是否可以使用seaborn创建堆叠条形图facetgrid? g = sns.FacetGrid(data, col="city", col_order=cities, col_wrap=3, hei
提前抱歉图像数量过多,但它们有助于演示问题 我构建了一个数据框,其中包含多个基材、多个层的薄膜厚度测量值,作为坐标的函数: | | Sub | Result | Layer | Row | Co
我正在尝试使用seaborn创建一个Facetgrid来显示我的所有列分布以及正态分布线以与正态分布进行比较。 我在pandas中的数据帧看起来像这样: column values 0
我有 2 个数据帧,1 个有训练数据,另一个有标签。训练数据中有 6 个特征/列,标签数据框中有 1 列。我想要我的面网格中有 6 个图 - 所有这些都是散点图。因此,特征 1 与标签、特征 2 与标
给出以下示例: A = [0, 1, 2] B = [3, 4, 5] C = [6, 7, 8, 9] df = pd.DataFrame(data = {'D': np.random.randn(
我正在尝试将颜色条添加到 3 个 seaborn 绘图的网格中。我可以将颜色条添加到 3 个单独的图,或者在第三个图旁边挤压一个颜色条。我想在第三个图之后有一个颜色条,而不改变最后一个图的大小。 我从
给定一些数据: pt = pd.DataFrame({'alrmV':[000,000,000,101,101,111,111], 'he':[e,e,e,e,h
灵感来自 this page 上的示例,我想用 Iris 数据集制作一个 seaborn facetgrid,它有 6 个方面:3 种 x 2 种类型(花瓣或萼片)。在每个方面,我都需要一个长度(或宽
如果我通过 FacetGrid().map() 更改 plt.plot 实例的线宽,我将丢失图例中线型的详细信息。在此图中,线型从图表中正确可见 但是,如果我增加线宽 z 不再正确显示线型 如果你想重
我想每月绘制数据并每年显示一次年份标签。这是数据: timedates = ['2013-01-01', '2013-02-01', '2013-03-01', '2013-04-01', '2013
在 Seaborn 中,您可以使用 FacetGrid 设置要在其上绘制的数据感知网格。然后,您可以使用 map 或 map_dataframe 方法绘制这些网格。 我无法正确指定与 map 或 ma
我有一个具有以下结构的 DataFrame: interval segment variable value 4 02:00:00 Night weekdays
我正在尝试在 Seaborn 中创建一个 FacetGrid 我的代码目前是: g = sns.FacetGrid(df_reduced, col="ActualExternal", margin_t
我想在 Facetgrid 的每个图中反转 y 轴。 下面是代码的简化示例: import pandas as pd import numpy as np import seaborn as sns
我是一名优秀的程序员,十分优秀!