完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
这种方法可以把当前的图像属性表示出来人后你想改什么就改什么。 首先画一个图像 >> t = 0:0.01:2*pi; >> h = plot(t,sin(t)); 好了,图像出来了。那么通常大家就会问了,如何改变步长,如何添加网格,如何改变线性等等。让我们一个一个来实现吧! 首先,这样,,键入get(h) 这里的h = plot(t,sin(t)); >> get(h) DisplayName: '' Annotation: [1x1 hg.Annotation] Color: [0 0 1] EraseMode: 'normal' LineStyle: '-' LineWidth: 0.5000 Marker: 'none' MarkerSize: 6 MarkerEdgeColor: 'auto' MarkerFaceColor: 'none' XData: [1x629 double] YData: [1x629 double] ZData: [1x0 double] BeingDeleted: 'off' ButtonDowNFCn: [] Children: [0x1 double] Clipping: 'on' CreateFcn: [] DeleteFcn: [] BusyAction: 'queue' HandleVisibility: 'on' HitTest: 'on' Interruptible: 'on' Selected: 'off' SelectionHighlight: 'on' Tag: '' Type: 'line' UIContextMenu: [] UserData: [] Visible: 'on' Parent: 171.0044 XDataMode: 'manual' XDataSource: '' YDataSource: '' ZDataSource: '' 会出现一堆属性,挑你要修改的。比如如何改变线性 对应的属性在这里 LineStyle: '-' 线型,是直线 LineWidth: 0.5000 线宽, Marker: 'none' 标记,没有 MarkerSize: 6 标记磅值 MarkerEdgeColor: 'auto' 边缘颜色 MarkerFaceColor: 'none' 便面颜色 知道了这几个属性是干什么的了,我们就来修改吧 set(h,'LineStyle','-.','LineWidth',1.5,'Marker','o','MarkerSize',10) 你看 改过来了吧。其他的属性是什么就不多说了,大家可以试一下,很有趣的哟~~~ 然后是我们最关心的坐标轴的属性设置。坐标轴属性花样百出,记住的也只是简单的比如xlabel,title之类的。我们同样可以利用这种方法来做 在命令窗口键入 get(gca) >> get(gca) ActivePositionProperty = outerposition ALim = [0 1] ALimMode = auto AmbientLightColor = [1 1 1] Box = on CameraPosition = [3.5 0 17.3205] CameraPositionMode = auto CameraTarget = [3.5 0 0] CameraTargetMode = auto CameraUpVector = [0 1 0] CameraUpVectorMode = auto CameraViewAngle = [6.60861] CameraViewAngleMode = auto CLim = [0 1] CLimMode = auto Color = [1 1 1] CurrentPoint = [ (2 by 3) double array] ColorOrder = [ (7 by 3) double array] DataAspectRatio = [3.5 1 1] DataAspectRatioMode = auto DrawMode = normal FontAngle = normal FontName = Helvetica FontSize = [10] FontUnits = points FontWeight = normal GridLineStyle = : Layer = bottom LineStyleOrder = - LineWidth = [0.5] MinorGridLineStyle = : NextPlot = replace OuterPosition = [0 0 1 1] PlotBoxAspectRatio = [1 1 1] PlotBoxAspectRatioMode = auto Projection = orthographic Position = [0.13 0.11 0.775 0.815] TickLength = [0.01 0.025] TickDir = in TickDirMode = auto TightInset = [0.0225694 0.0256024 0.00434028 0.0120482] Title = [173.005] Units = normalized View = [0 90] XColor = [0 0 0] XDir = normal XGrid = off XLabel = [174.005] XAxisLocation = bottom XLim = [0 7] XLimMode = auto XMinorGrid = off XMinorTick = off XScale = linear XTick = [0 1 2 3 4 5 6 7] XTickLabel = 0 1 2 3 4 5 6 7 XTickLabelMode = auto XTickMode = auto YColor = [0 0 0] YDir = normal YGrid = off YLabel = [175.005] YAxisLocation = left YLim = [-1 1] YLimMode = auto YMinorGrid = off YMinorTick = off YScale = linear YTick = [ (1 by 11) double array] YTickLabel = [ (11 by 4) char array] YTickLabelMode = auto YTickMode = auto ZColor = [0 0 0] ZDir = normal ZGrid = off ZLabel = [176.005] ZLim = [-1 1] ZLimMode = auto ZMinorGrid = off ZMinorTick = off ZScale = linear ZTick = [-1 0 1] ZTickLabel = ZTickLabelMode = auto ZTickMode = auto BeingDeleted = off ButtonDownFcn = Children = [172.006] Clipping = on CreateFcn = DeleteFcn = BusyAction = queue HandleVisibility = on HitTest = on Interruptible = on Parent = [1] Selected = off SelectionHighlight = on Tag = Type = axes UIContextMenu = [] UserData = [] Visible = on 在这些属性里面,步长,网格对应的属性分别是 XTick = [0 1 2 3 4 5 6 7] 步长; YGrid = off 网格,默认,关闭 那么我们就这样 >> set(gca,'xtick',[0:0.5:7],'xgrid','on') |
|
相关推荐
4 个讨论
|
|
楼主 想和你学点东西啊
|
|
|
|
|
|
MATLAB(3)--矩阵的引用(sub2ind、ind2sub、reshape函数使用)
944 浏览 0 评论
1408 浏览 0 评论
3981 浏览 1 评论
17360 浏览 0 评论
5027 浏览 0 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-9-10 12:46 , Processed in 0.688746 second(s), Total 43, Slave 36 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号