当前位置:网站首页>matlab drawing
matlab drawing
2022-08-04 21:05:00 【Lin Dexi】
This article describes how to use matlab to draw.This article includes: line chart x-axis and y-axis, title, legend Column chart fill pattern
Line Chart
How does matlab set the distance between the legend and the x-axis of the graph in the next section
The legend of the line chart needs to know the Legend, which can be set using him
legend(...,'Location',LOC) adds alegend in the specifiedlocation, LOC, with respect to the axes. LOC may be either a1x4 position vector or one of the following strings:'North' inside plot box near top'South' inside bottom'East' inside right'West' inside left'NorthEast' inside top right (default for 2-D plots)'NorthWest' inside top left'SouthEast' inside bottom right'SouthWest' inside bottom left'NorthOutside' outside plot box near top'SouthOutside' outside bottom'EastOutside' outside right'WestOutside' outside left'NorthEastOutside' outside top right (default for 3-D plots)'NorthWestOutside' outside top left'SouthEastOutside' outside bottom right'SouthWestOutside' outside bottom left'Best' least conflict with data in plot'BestOutside' least unused space outside plotHow to set the x-axis size?
It can be set by set(gca,'xtick',1:1:100);code setting starts from 1 and ends at 100, explain
set(gca,'xtick',start:between two dots:end);
Histogram
How to draw a bar chart and how to fill the bar chart with different patterns?
Matlab histogram fill pattern can be drawn using applyhatch, the following will tell you how to do it
The first step is to copy the file applyhatch.m to your computer.About where to download applyhatch.m, please Baidu, if you can't find it, you can contact me at [email protected]
Don't tell in herenext
The second step is to copy the file to the workbench. What is the workbench is the folder path opened by the software. The path is as shown below
You can modify it yourself, just put the above files in this folder.
The usage is applyhatch(gcf,'\.x.');
The second parameter is to use a different pattern, you can add '/', '\', '|', '-', '+', 'x', '.'several characters
Example:
close allclear allclc% The computer journal paper% Jigang Wu etc.% copyright: [email protected]% data = [31,32,35;72,73,75;113,114,117;144,146,147;171,173,174;213,215,220];data =[16,17,18;33,34,37;51,54,55;71,74,74;86,91,91;105,113,113];bar(data,1);axis([0 7 0.0 150]);legend('DPA','TSRP','GRP',0);grid on;set(gca,'XTickLabel',{'100','200','300','400','500','600'});xlabel('The number of internal nodes');ylabel('The number of replica that created');set(gcf,'Color','w'); % Set the background color to white, otherwise the color of the area where the coordinate axis appears is grayapplyhatch(gcf,'\.x.');For different combinations of histograms, use data=[data 1.1, data 1.2, data 1.3; data 2.1, data 2.2...]
Then draw it, use bar(data,1); The second parameter is the width, try to modify the second value and run it.
The legend can be used. The legend of matlab uses legend('DPA','TSRP','GRP',0); to add the corresponding legend as much as there is data.
Try the following code:
y=[559006 ,2269384,783762;508559 ,2140905,696001;506491,2007763,735464]bar(y,0.6)legend('n','N','l')grid on;set(gca,'XTickLabel',{'first','second','third'})xlabel('Number of matches')ylabel('Number of results')set (gcf,'Position',[500,500,500,500],'color','w')applyhatch(gcf,'\.x./');set(gcf,'Color','w'); If you encounter problems with the process, you can contact me.
Thanks to Brother Chen Long for his help.
边栏推荐
- 基于单向链表结构的软件虚拟定时器的设计与构建
- Comic | Two weeks after the boss laid me off, he hired me back and doubled my salary!
- [Teach you to use the serial port idle interrupt of the STM32HAL library]
- Qt Designer生成的图形可以自适应窗口的大小变化
- 链队
- 该如何训练好深度学习模型?
- Configure laravel queue method using fort app manager
- 【TypeScript】深入学习TypeScript枚举
- Debug locally and start the local server in vs code
- 项目难管理?先学会用好甘特图(内附操作方法及实用模板)
猜你喜欢
随机推荐
【一起学Rust | 进阶篇 | Service Manager库】Rust专用跨平台服务管理库
Matlab画图2
STP --- 生成树协议
【2022杭电多校5 1003 Slipper】多个超级源点+最短路
命名路由、组件中name的作用
QT(42)-QT线程-线程调用槽函数
链栈的应用
某男子因用本地虚拟机做压测,惨遭字节面试官当场嘲笑
[21天学习挑战赛——内核笔记](二)——设备树基础
Zynq Fpga图像处理之AXI接口应用——axi_lite接口使用
win10 uwp 修改图片质量压缩图片
Oreo domain name authorization verification system v1.0.6 public open source version website source code
Qt Designer生成的图形可以自适应窗口的大小变化
Uniapp微信雪糕刺客单页小程序源码
[Data Mining] Written Exam Questions for Sohu Data Mining Engineers
用 Excel 爬取网络数据的四个小案例
结构体小结
明明加了唯一索引,为什么还是产生了重复数据?
【TypeScript】深入学习TypeScript枚举
LayaBox---TypeScript---举例









