问题描述
我一直在尝试在 ggmap 中绘制 voronoi 细分,其中每个块的颜色将被赋予十六进制代码,例如 #FFCC00。到目前为止,我想出的代码如下:
Warning message:
computation Failed in `stat_voronoi_tile()`:
There is at most one point,data or dummy,inside
the given rectangular window. Thus there are
insufficiently many points to triangulate/tessellate.
但是,当我添加 .Box::before,.Box::after {
content: "";
position: absolute;
z-index: -1;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #ff0000;
clip-path: polygon(0 0%,100% 15%,100% 85%,0 100%);
}
.Box::after {
background-color: #3f3f3f;
transform: scaleX(-1); /* the shape is the same so I simple invert it but you can apply another clip-path here */
}
.Box {
padding:50px;
display:inline-block;
position:relative;
}
参数时,出现错误警告:
<div class="Box">
<h1>Hello World</h1>
</div>
我不确定如何修复,因为在添加参数之前,地图显示没有错误。因此我的问题是:如何将自定义颜色编码的 voronoi 镶嵌添加到 ggmap 上?
提前致谢!