Matlab_Graphics(1)_2D
1.Add title ,axis Lables, and Legend to Graph:
x=linspace(-*pi,2pi,);
y1=sin(x);
y2=cos(x);
figure
plot(x,y1,x,y2);
title('Graph of sine and cosine between -2\pi and 2\pi');% to display Greek symbols in a title,use the tex markup '\'
xlabel('-2\pi<x<2\pi'); % x-axis label
ylabel('sine and cosine value');% y-axis label
legend('y=sin(x)','y=cos(x)'); % add legend
2.change Graph axis Limits functions:
Axis function: Axis([xmin,xmax,ymin,ymax]); or xlim([xmin,xmax])/ylim([ymin,ymax])/zlim([zmin,zmax])
3.Change Tick Marks and Tick Labels of Graph:
x=linspace(-,,);
y=cos(x);
figure
plot(x,y)
h=gca; % Use gca to get the handle for the current axes
h.XTick=[-*pi,-*pi,-pi,,pi,*pi,*pi];
h.YTick=[-,-0.5,,,,]; % Change the location of the tick marks on the plot
% by setting the XTick and YTick properties of the
% axes.
h.XTickLabel={'-3pi','-2pi','-pi','','pi','2pi','3pi'};
h.YTickLabel={'min=1','-0.5','','0.5','max=1'};
Specify tick mark labels by setting the XTickLabel and YTickLabel porperties of the axes, Set these properties using
a cell array of string with the desired labels .If you do not specify enough text labels for all the tick marks,then
MATLAB cycles through the labels.
4. grid on : to display the major grid lines, The grid on command sets the XGrid,YGrid,and ZGrid axes prperties.
5. grid minor: to display the minor grid lines,The grid minor command sets the XMinorGrid/YMinorGrid, and ZMinorGrid properties.
6. grid off : to remove the grid lines,
7.Display Grid Lines in Single Direction:
x=-10:10;
y=x.^2;
figure
plot(x, y);
ax=gca;
ax.XGrid='on'; % setting the XGrid axes property to 'on ' and the YGrid axes property to 'off'
ax.YGrid='off';
ax.XMinorGrid='on'; % setting the XGridMinor axes property to 'on ' and the YGridMinor axes
ax.YMinorGrid='off'; % property to 'off'
8.Change Grid Line Style:
x=-10:10
y=x.^2;
figure
plot(x,y)
grid on
grid minor
ax=gca;
ax.GridLineStyle='-'; %change the grid line style using the GridLineStyle and
ax.MinorGridLineStyle='-'; %MinorGridLineStyle axes properties.
9.hold on: retain the line plot and add a new plot to the graph.
10.hold off: to reset the hold state so that new plots replace existing plot,which is the default behavior.
11.Create Graph with Two y-Axes:
A=;
a=0.005;
b=0.005;
t=:;
Z1=A*exp(-a*t);
Z2=sin(b*t);
[ax,p1,p2]=plotyy(t,Z1,t,Z2,'semilogy','plot');
ylabel(ax(),'Semilog Plot');
ylabel(ax(),'Linear Plot');
xlabel(ax(),'Time');
p1.LineStyle='--';
p1.LineWidth=;
p2.Linewidth=;
grid(ax(),'on');
grid(ax(),'on');
12.Display Markers at Specific Data Points on line Graph:
x=linspace(0,2*pi,100);
y=sin(x);
xmarkers=0:pi/2:2*pi;
ymarkers=sin(xmarkers);
figure
plot(x,y,'b',xmarkers,ymarkers,'b*');
Matlab_Graphics(1)_2D的更多相关文章
- 安卓自定义view_GDI绘图 _2d绘图_canvas绘图
2014年到2016年 发生了很多事情,如今已成定局,现在想忘掉这些烦恼的事情,找点以前想干没有干的事情来做,塞满大脑就不去想了. 之前,一直想做一款挂机类游戏,各种平台和开发语言都选择过了,从htm ...
- 移动开发day1_过渡_2d转换_3d立体
今天是就业班开班的第一天,上完了一天的课,做点总结. 什么叫做移动web 专门在手机或者 平板电脑 浏览器网页 为什么要学习移动web 工资高 1. 人拥有的手机数 大于 电脑的个数 2. 微信 1. ...
- CSS3_过渡_2D 变换_瓶体旋转_动态时钟
1. 过渡 transition 允许 CSS 的属性值在一定时间内平滑的过渡, 在鼠标点击,鼠标滑过或对属性改变中触发,并圆滑的改变 CSS 的属性值 简写属性: #box { width: 300 ...
- Unity ShaderLab学习总结
http://www.jianshu.com/p/7b9498e58659 Unity ShaderLab学习总结 Why Bothers? 为什么已经有ShaderForge这种可视化Shader编 ...
- 根据屏幕的宽度使用不同的css-文件
<!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8&quo ...
- Cocos2d-X3.0 刨根问底(三)----- Director类源码分析
上一章我们完整的跟了一遍HelloWorld的源码,了解了Cocos2d-x的启动流程.其中Director这个类贯穿了整个Application程序,这章随小鱼一起把这个类分析透彻. 小鱼的阅读源码 ...
- Jquery easyui的validatebox控件和正则表达式
http://blog.csdn.net/dandanzmc/article/details/36421465 仔细观察jquery.validatebox.js文件,会发现它的验证其实还是采用的正则 ...
- easyui源码翻译1.32--ValidateBox(验证框)
前言 使用$.fn.validatebox.defaults重写默认值对象.下载该插件翻译源码 validatebox(验证框)的设计目的是为了验证输入的表单字段是否有效.如果用户输入了无效的值,它将 ...
- easyui源码翻译1.32--Slider(滑动条)
前言 使用$.fn.slider.defaults重写默认值对象.下载该插件翻译源码 滑动条允许用户从一个有限的范围内选择一个数值.当滑块控件沿着轨道移动的时候,将会显示一个提示来表示当前值.用户可以 ...
随机推荐
- jieba分词
一.安装 pip 安装 或者 先下载http://pypi.python.org/pypi/jieba/ ,解压后运行python setup.py install 二.功能 1.分词 2.添加自定义 ...
- 程序设计入门——C语言 第8周编程练习 2GPS数据处理(6分)
题目内容: NMEA-0183协议是为了在不同的GPS(全球定位系统)导航设备中建立统一的BTCM(海事无线电技术委员会)标准,由美国国家海洋电子协会(NMEA-The National Marine ...
- Failed: error processing document #281: unexpected EOF,往MongoDB当中插入json文件时出现的错误。
往MongoDB当中插入json文件时提示的错误(我的操作系统是win10): 当时的执行命令是:mongoimport -d test -c restaurants d://primer-datas ...
- adaboost原理与实践
Adaboost是一种迭代算法,其核心思想是针对同一个训练集训练不同的分类器(弱分类器),然后把这些弱分类器集合起来,构成一个更强的最终分类器(强分类器).其算法本身是通过改变数据分布来实现的,它根据 ...
- 媒体查询使用方法@media
Media Queries能在不同的条件下使用不同的样式,使页面在不同在终端设备下达到不同的渲染效果.前面简单的介绍了Media Queries如何引用到项目中,但Media Queries有其自己的 ...
- vue的transition过渡效果
需要4个类: *-enter: 进入的开始状态, *-enter-active: 进入的结束状态, *-leave: 离开的开始状态, *-leave-active: 离开的结束状态 vue-rout ...
- MVC5+EF6 入门完整教程八
本篇是相对独立的一篇,主要讲解不丢失数据进行数据库结构升级. 前面我们讲解EF功能时,已经介绍过一种更新数据库的方式: EF比较model和database,如果两边不一致,程序将会drop and ...
- Sql Server参数化查询之where in和like实现详解
where in 的参数化查询实现 首先说一下我们常用的办法,直接拼SQL实现,一般情况下都能满足需要 string userIds = "1,2,3,4"; using (Sql ...
- Orchard入门:如何创建一个完整Module
这是一个Orchard-Modules的入门教程.在这个教程里,我们将开发两个功能页面分别用于数据录入与数据展示. 完成上述简单功能开发,我们一共需要6个步骤.分别为: 创建Module 创建Mode ...
- MySql学习 (一) —— 基本数据库操作语句、三大列类型
注:该MySql系列博客仅为个人学习笔记. 在使用MySql的时候,基本都是用图形化工具,如navicat.最近发现连最基本的创建表的语法都快忘了... 所以,想要重新系统性的学习下MySql,为后面 ...