当前位置:网站首页>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.
边栏推荐
- dotnet delete read-only files
- 【debug】postgres数据存储错乱
- Comic | Two weeks after the boss laid me off, he hired me back and doubled my salary!
- Oreo域名授权验证系统v1.0.6公益开源版本网站源码
- Getting Started with Lattice Passwords
- Tear down the underlying mechanism of the five JOINs of SparkSQL
- How to understand the crawler's Scrapy framework in the simplest and most popular way?
- Zero-knowledge proof notes - private transaction, pederson, interval proof, proof of ownership
- 伺服电机矢量控制原理与仿真(1)控制系统的建立
- MySQL stored procedure introduction, creation, case, delete, view "recommended collection"
猜你喜欢

ADB 安装 + 打驱动全教程
![[Teach you to use the serial port idle interrupt of the STM32HAL library]](/img/9e/88a11727e1452315edc2c8ac74690e.png)
[Teach you to use the serial port idle interrupt of the STM32HAL library]

for 循环中的 ++i 与 i++

mdk5.14无法烧录

JWT主动校验Token是否过期

IPV6地址

c语言小项目(三子棋游戏实现)
![[2022 Hangzhou Electric Multi-School 5 1003 Slipper] Multiple Super Source Points + Shortest Path](/img/78/054329dec6a6faea5e9d583b6a8da5.png)
[2022 Hangzhou Electric Multi-School 5 1003 Slipper] Multiple Super Source Points + Shortest Path

How to carry out AI business diagnosis and quickly identify growth points for cost reduction and efficiency improvement?

明明加了唯一索引,为什么还是产生了重复数据?
随机推荐
宝塔实测-搭建中小型民宿酒店管理源码
模拟对抗之红队免杀开发实践
Tear down the underlying mechanism of the five JOINs of SparkSQL
PowerCLi 批量配置NTP
实战:10 种实现延迟任务的方法,附代码!
构建Buildroot根文件系统(I.MX6ULL)
DICOM医学影像协议
大资本已开始逃离加密领域?
dotnet 使用 lz4net 压缩 Stream 或文件
After the tester with 10 years of service "naked resignation" from the big factory...
拼多多开放平台订单信息查询接口【pdd.order.basic.list.get订单基础信息列表查询接口(根据成交时间)】代码对接教程
MySQL字段类型
深度解析:为什么跨链桥又双叒出事了?
3. Byte stream and character stream of IO stream
STP基本配置及802.1D生成树协议的改进
二叉搜索树解决硬木问题
零知识证明笔记——私密交易,pederson,区间证明,所有权证明
js数据类型、节流/防抖、点击事件委派优化、过渡动画
MATLAB中readtimetable函数用法
mdk5.14 cannot be burned