当前位置:网站首页>Matlab paper illustration drawing template issue 39 - stairs
Matlab paper illustration drawing template issue 39 - stairs
2022-07-26 03:38:00 【A Kun's daily scientific research】
In the previous post , Shared Matlab Drawing template of line chart :

Three dimensional line chart Drawing template for :

As well as some Special line diagram :




This time I will share a kind of line diagram : Stairs .
Let's take a look first Finished product effect :


hot tip :Matlab Thesis illustration drawing template series , It aims to reduce the use of Matlab The threshold for scientific research mapping , Just add the corresponding content according to the template format , You can get data illustrations that meet the format requirements of most journals and dissertations . If you feel useful, you can share it with your friends .
The most critical part of the template :
1. Data preparation
This part is mainly Reading data , Define arguments 、 The dependent variable .
% Reading data% Define argumentsx = linspace(0,4*pi,30)';% Define the dependent variablesamp1 = 0.5*cos(x);samp2 = 1*cos(1.5*x);samp3 = 1.5*cos(0.5*x);samp4 = 1.5*cos(x);
2. Color definition
Color matching tests personal aesthetics , Need to try more .
here Directly use the previously shared colorplus Tools :
%% Color definitionC = colorplus([34 202 83 104]);C1 = C(1,:);C2 = C(2,:);C3 = C(3,:);C4 = C(4,:);

3. Ladder diagram drawing
Use ‘stairs’ command , draw A step map without beautification .
S1 = stairs(x, samp1);
S2 = stairs(x, samp2);
S3 = stairs(x, samp3);
S4 = stairs(x, samp4);
hXLabel = xlabel('Point spacing (m)');
hYLabel = ylabel('MAE (m)');4. Detail optimization
For the beauty of illustrations , Choose a good color before applying , And adjust other properties of the line .
% Define lineweight and color ( Or Linetype 、 Symbol 、 Lineweight and color )set(S1, 'LineWidth', 1.5, 'Color', C1)set(S2, 'LineWidth', 1.5, 'Color', C2)set(S3, 'LineWidth', 1.5, 'Color', C3)set(S4, 'LineWidth', 1.5, 'Color', C4)% set(S1, 'LineStyle', '-', 'Marker', '.', 'MarkerSize', 18, 'LineWidth', 1.5, 'Color', C1)% set(S2, 'LineStyle', '-', 'Marker', '*', 'LineWidth', 1.5, 'Color', C2)% set(S3, 'LineStyle', '-', 'Marker', 'o', 'LineWidth', 1.5, 'Color', C3)% set(S4, 'LineStyle', '-', 'Marker', 's', 'LineWidth', 1.5, 'Color', C4)
further , Adjust axis 、 Font size 、 Background color and other details :
% Axis beautificationset(gca, 'Box', 'off', ... % Frame'XGrid', 'off', 'YGrid', 'on', ... % grid'TickDir', 'out', 'TickLength', [.01 .01], ... % scale'XMinorTick', 'off', 'YMinorTick', 'off', ... % Small scale'XColor', [.1 .1 .1], 'YColor', [.1 .1 .1],... % Axis color'XTick', 0:2:14,...'XLim', [0 4*pi],...'YTick', -2:0.5:2, ...'YLim', [-1.7 2])ax2 = axes('Position',get(gca,'Position'),...'XAxisLocation','top',...'YAxisLocation','right',...'Color','none',...'XColor','k','YColor','k');set(ax2,'YTick', []);set(ax2,'XTick', []);box on% LegendhLegend = legend([S1,S2,S3,S4], ...'Samp1', 'Samp2','Samp3','Samp4', ...'Location', 'northeast',...'orientation','horizontal');% Font sizeset(gca, 'FontName', 'Arial', 'FontSize', 9)set([hXLabel,hYLabel,hLegend], 'FontName', 'Arial', 'FontSize', 10)% The background colorset(gcf,'Color',[1 1 1])
After setting up , With the resolution required by the journal 、 Format output picture .
%% Image outputfigW = figureWidth;figH = figureHeight;set(figureHandle,'PaperUnits',figureUnits);set(figureHandle,'PaperPosition',[0 0 figW figH]);fileout = 'test2';print(figureHandle,[fileout,'.png'],'-r300','-dpng');


above .
Complete code :
边栏推荐
- C语言函数(2)
- ELS message loop
- Canvas -- draw text -- modification of pie chart
- Canvas -- drawing of rectangle -- making of histogram
- redis集群的三种方式
- 图解LeetCode——5. 最长回文子串(难度:中等)
- What are the methods of array sorting in JS
- Tf.constant usage
- Offline data warehouse from 0 to 1-stage II software installation
- NFT is beautiful because it is meaningless
猜你喜欢

Configuration and use of virtualservice, gateway and destinationrule of istio III

PXE高效批量网络装机
![[mathematical modeling - Summary of planning model] | matlab solution](/img/b0/a4d33d7d7b605b7cc6149b59b55fb8.png)
[mathematical modeling - Summary of planning model] | matlab solution

Canvas -- draw text -- modification of pie chart

Hcip day 14

Graduation season & harvest season, leave your beautiful moments

6-40v input fixed 5V 3.3V output 1.1a current 23-5 package

Use VRRP technology to realize gateway equipment redundancy, with detailed configuration experiments

离线数据仓库从0到1-阶段一资源购买配置

LoRa和NB-IOT可用用在哪些地方
随机推荐
PXE高效批量网络装机
Sentinel vs Hystrix 到底怎么选?
els 初始化窗口类
想要做好软件测试,可以先了解AST、SCA和渗透测试
2022-07-21 study notes of group 4 self-cultivation class (every day)
Efficient Video Instance Segmentation via Tracklet Query and Proposal
leetcode-169.多数元素
c语言指针基本知识要点总结(一)
[create interactive dice roller application]
Bing(必应)搜索,为什么用户越来越多?
Canvas -- draw text -- modification of pie chart
How Lora wireless gateway can quickly realize end-to-cloud transmission
PXE efficient batch network installation
Let Baidu collect, crawler own website
ELS callback function, exit message
Opencv error: (parameter or structure field)) unrecognized or unsupported array type in functon 'cvgetmat‘
What is the difference between heap memory and stack memory?
Graduation season & harvest season, leave your beautiful moments
Canvas -- drawing of rectangle -- making of histogram
Opencv saves pictures in the specified format