当前位置:网站首页>Matlab论文插图绘制模板第40期—带偏移扇区的饼图
Matlab论文插图绘制模板第40期—带偏移扇区的饼图
2022-07-26 16:24:00 【阿昆的科研日常】
在之前的文章中,分享了Matlab饼图的绘制模板:

进一步,再来分享一下带偏移扇区饼图的绘制模板。
先来看一下成品效果:

特别提示:Matlab论文插图绘制模板系列,旨在降低大家使用Matlab进行科研绘图的门槛,只需按照模板格式添加相应内容,即可得到满足大部分期刊以及学位论文格式要求的数据插图。如果觉得有用可以分享给你的朋友。
模板中最关键的部分内容:
1. 数据准备
此部分主要是读取数据,定义各变量。
% 读取数据
X = [0.49 0.12 0.1 0.08 0.08 0.04 0.04 0.05];
explode = [0 0 1 0 1 0 0 0];
Label = {'Brazil','Colombia','Argentina','Peru','Venezuela','Chile','Ecuador','Others'};其中,通过将对应的 explode 元素设置为1来偏移第3和第5块饼图扇区。
2. 颜色定义
颜色搭配比较考验个人审美,需要多加尝试。
这里直接用之前分享的addcolorplus工具中的渐变色:
% 渐变色
map = addcolorplus(282);
idx = linspace(1,64,8);
idx = round(idx);
C = map(idx,:);
C = flipud(C);
3. 带偏移扇区的饼图绘制
使用‘pie’命令,绘制未经美化的带偏移扇区的饼图。
pie(X,explode)
hTitle = title('South American Population by Country');
4. 细节优化
为了插图的美观,利用’colormap’命令赋上之前选择好的颜色:
% 赋色
colormap(C)进一步,调整标签、字体字号、背景颜色等属性:
% 标签
hLegend = legend(Label, 'Position', [0.85 0.15 0.1 0.3]);
hLegend.ItemTokenSize = [5 5];
legend('boxoff');
% 字体字号
th = findobj(gca, 'Type', 'text');
set(th, 'FontName', 'Arial', 'FontSize', 11)
set(hLegend, 'FontName', 'Arial', 'FontSize', 9)
set(hTitle, 'FontSize', 12, 'FontWeight' , 'bold')
% 背景颜色
set(gcf,'Color',[1 1 1])设置完毕后,以期刊所需分辨率、格式输出图片。
%% 图片输出
print('test.png','-r300','-dpng');
也可以尝试其他配色:




以上。
完整代码:
边栏推荐
- Digital intelligence transformation, management first | jnpf strives to build a "full life cycle management" platform
- Analyzing method and proc in Ruby
- Bugku login2
- 2022 Niuke summer multi school training camp 1 (acdgij)
- 怎么使用C语言嵌套链表实现学生成绩管理系统
- From SiCp to LISP video replay
- How to configure tke cluster node Max pod
- How to write unit tests
- Interface test for quick start of JMeter
- Pat grade a 1050 string subtraction
猜你喜欢

docker安装redis?如何配置持久化策略?
It turns out that cappuccino information security association does this. Let's have a look.

Mapwithstate of spark streaming state flow

PAT甲级 1046 Shortest Distance

微信小程序---网络数据请求

Vscode batch delete

基于sisotool极点配置PI参数及基于Plecs的三相电压源逆变器仿真

NUC 11 build esxi 7.0.3f install network card driver-v2 (upgraded version in July 2022)

TDengine 落地协鑫能科,数百亿数据压缩至 600GB

面试时候常说的复杂度到底是什么?
随机推荐
MVC和ECS两种设计架构的初浅理解
Activity之onCreate、onRestoreInstanceState恢复数据的区别
Test cases should never be used casually, recording the thinking caused by the exception of a test case
Clojure Web Development -- ring user guide
Clojure operation principle bytecode generation
NUC 11构建 ESXi 7.0.3f安装网卡驱动-V2(2022年7月升级版)
Final consistency distributed transaction TCC
[BJDCTF2020]Easy MD5
Difference between C event and delegation
IDEA 阿里云多模块部署
guetzli简单使用
Re7:读论文 FLA/MLAC Learning to Predict Charges for Criminal Cases with Legal Basis
Digital intelligence transformation, management first | jnpf strives to build a "full life cycle management" platform
What is the complexity often said during the interview?
DTS搭载全新自研内核,突破两地三中心架构的关键技术|腾讯云数据库
Modify the password of the root user of MySQL database
Understanding JS foundation and browser engine
C # set different text watermarks for each page of word
C语言重点知识总结
2022 test questions and answers for the latest national fire facility operator (senior fire facility operator)