1. 首页
  2. blank 相关的文章

在ppt中如何取消绘图区的边框?ggplot2去掉外

步骤如下:

1.打开PPT文件,选中图表,出现“图表工具”选项;

2.点击图表工具中格式选项,在形状样式中点击形状轮廓,选择“无轮廓”;

3.这样就没有饼图的轮廓线了,效果如下。

acgpower怎么把边框去掉


library(tidyverse) library(ggpattern) data.frame('cluster' = rep(paste0('cluster_', 1:5), time = 6), 'type' = rep(paste0('type_', 1:6), time = 5), 'value' = rnorm(n = 30, mean = 0, sd = 1)) %>% ggplot(aes(x = cluster, y = value)) + geom_col_pattern(aes(pattern = type, color = type,fill = type), position = 'dodge', alpha = 0.5) + theme_light() + scale_x_discrete(position = "top") + theme(legend.position = "bottom", panel.grid.major.x = element_blank(), panel.grid.minor.x = element_blank(), legend.title = element_blank(), panel.border = element_blank()) + guides(col = guide_legend(nrow = 1, direction = "horizontal")) + labs(x = "Six-Cluster Model Centroids", y = "Centroids for each cluster")

上面代码内里的`panel.border = element_blank()`就是指的是去掉外边框。留意在theme内里修改。别的代码不用管

#! usr/bin/python #coding=utf-8 im!port numpy as np import matplotlib.pyplot as plt data=np.random.rand(10,10) fig, ax=plt.subplots() data[data==-1]=np.nan#去掉缺省值-1 im =ax.imshow(data,interpolation='none',cmap='!Reds_r',vmin=0.6,vmax=.9)#不插值 #去掉边框 ax.spines['top'].set_visible(False) ax.spines['right'].set_visible(False) ax.spines['bottom'].set_visible(False) ax.spines['left'].set_visible(False) plt.show()

本文网址: http://www.6vho.com/page/202101618830_7660_1914018571/home