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的更多相关文章

  1. 安卓自定义view_GDI绘图 _2d绘图_canvas绘图

    2014年到2016年 发生了很多事情,如今已成定局,现在想忘掉这些烦恼的事情,找点以前想干没有干的事情来做,塞满大脑就不去想了. 之前,一直想做一款挂机类游戏,各种平台和开发语言都选择过了,从htm ...

  2. 移动开发day1_过渡_2d转换_3d立体

    今天是就业班开班的第一天,上完了一天的课,做点总结. 什么叫做移动web 专门在手机或者 平板电脑 浏览器网页 为什么要学习移动web 工资高 1. 人拥有的手机数 大于 电脑的个数 2. 微信 1. ...

  3. CSS3_过渡_2D 变换_瓶体旋转_动态时钟

    1. 过渡 transition 允许 CSS 的属性值在一定时间内平滑的过渡, 在鼠标点击,鼠标滑过或对属性改变中触发,并圆滑的改变 CSS 的属性值 简写属性: #box { width: 300 ...

  4. Unity ShaderLab学习总结

    http://www.jianshu.com/p/7b9498e58659 Unity ShaderLab学习总结 Why Bothers? 为什么已经有ShaderForge这种可视化Shader编 ...

  5. 根据屏幕的宽度使用不同的css-文件

    <!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8&quo ...

  6. Cocos2d-X3.0 刨根问底(三)----- Director类源码分析

    上一章我们完整的跟了一遍HelloWorld的源码,了解了Cocos2d-x的启动流程.其中Director这个类贯穿了整个Application程序,这章随小鱼一起把这个类分析透彻. 小鱼的阅读源码 ...

  7. Jquery easyui的validatebox控件和正则表达式

    http://blog.csdn.net/dandanzmc/article/details/36421465 仔细观察jquery.validatebox.js文件,会发现它的验证其实还是采用的正则 ...

  8. easyui源码翻译1.32--ValidateBox(验证框)

    前言 使用$.fn.validatebox.defaults重写默认值对象.下载该插件翻译源码 validatebox(验证框)的设计目的是为了验证输入的表单字段是否有效.如果用户输入了无效的值,它将 ...

  9. easyui源码翻译1.32--Slider(滑动条)

    前言 使用$.fn.slider.defaults重写默认值对象.下载该插件翻译源码 滑动条允许用户从一个有限的范围内选择一个数值.当滑块控件沿着轨道移动的时候,将会显示一个提示来表示当前值.用户可以 ...

随机推荐

  1. JAVA 1.4 算术运算

    1. 如果在一个算术运算中有int,double,float那么最终运算的结果是double,那么也就是说参与运算的类型和得到的结果:结果一定是参与运算的精度最高的那个类型 2. 算术运算中的除法 i ...

  2. 个人博客作业Week3

    一.调研 下载并使用,按照描述的bug定义,找出几个功能性的比较严重的bug.至少两个.用专业的语言描述(每个bug 不少于 40字),如有必要,可以配图. 电脑用户未登录就能使用单词本功能,万一是用 ...

  3. 使用layer.open时content属性传值记录

    最近在做一个后台项目,正好碰上了要使用layer.open,就顺手记录一下,方便以后遇到了有个参考 - 2016/11/7 layer 这个是一个web弹层组件,挺好用的...然后项目框架是SSM.. ...

  4. 从resfful API设计到加密算法

    众所周知,SOAP 是基于XML的webservice协议,传的数据都是xml格式的,而当下resftul设计比较火,因为快效率高,但是安全性就不及SOAP, SOAP定义了xml-security的 ...

  5. shell下>和>>的区别

    >  :如果文件不存在,同上,如果文件存在,先将文件清空,然后将数据填入此文件 >> :如果文件不存在,将创建新的文件,并将数据送至此文件:如果文件存在,则将数据添加在文件后面

  6. leetcode刷题全纪录(持续更新)

    2.Add Two Numbers 原题链接https://leetcode.com/problems/add-two-numbers/ AC解: public ListNode addTwoNumb ...

  7. css学习笔记 4

    伪类可以用来指定一个或多个与其相关的选择符的状态,如a:link a:active a:hover a:visited :ie7及以下不支持. 注意:上面与超链接相关的伪类的顺序必须是:LVHA. 伪 ...

  8. C++笔记(1)explicit构造函数

    按照默认规定,只有一个参数的构造函数也定义了一个隐式转换,将该构造函数对应数据类型的数据转换为该类对象,如下面所示: class String { String ( const char* p );  ...

  9. CSS3让一段文字多余的用省略号表示,当鼠标移动上去的时候显示全部文字

    <style type="text/css"> div { width:100px; overflow:hidden; white-space:nowrap; text ...

  10. jquery mobile 的优缺点

    jQuery Mobile 优点 跨浏览器兼容性最好,几乎兼容所有的平台和浏览器: 入门简单,语法简洁,编码灵活,一些简单的应用直接用HTML既可实现,无需Javascript: 开源插件与第三方扩展 ...