爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 13100|回复: 16

[程序设计] m_map标注经纬度

[复制链接]
发表于 2016-2-18 19:59:07 | 显示全部楼层 |阅读模式

登录后查看更多精彩内容~

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
请问各位大神MATLAB的m_map怎样可以只标经度不标纬度,只标纬度不标经度呢?
只发现去掉m_grid之后用axis off 可以经纬度都不标~
万分感谢!
密码修改失败请联系微信:mofangbao
发表于 2016-2-18 21:20:59 | 显示全部楼层
没怎么用过这个工具箱,但有一个设想:不想要经度或纬度时用xticklabel或是yticklabel把不想要的给用空格替换掉应该就不显示了吧(没试验过)
密码修改失败请联系微信:mofangbao
发表于 2016-2-18 22:10:56 | 显示全部楼层
set(gca, 'xticklable','off'); 试一下
密码修改失败请联系微信:mofangbao
发表于 2016-2-18 22:50:48 | 显示全部楼层
同意,试试楼上的。
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2016-2-19 09:37:51 | 显示全部楼层
Aires 发表于 2016-2-18 22:10
set(gca, 'xticklable','off'); 试一下

谢谢,不过好像还是不行
m_proj('Equidistant Cylindrical','lat',[-90 90],'lon',[0 360]);%投影设置
m_pcolor(lon,lat,xgdjf1');colormap(mmm);%绘图设置,此处rxyspace可换成其余变量
caxis([-50 50])
shading flat;
% clabel(C,H,'fontsize',6);%标记数值
m_grid('linestyle','none');set(gca, 'xticklable','off');
m_coast('linewidth',0.1,'color','k');%添加海岸线
colorbar('SouthOutside')
hold on
[c,h] = m_contour(X,Y,xzdjf1',1,'color',[2/255 122/255 19/255],'linewidth',1.5);%将显著性区域用红线圈出
然后报错(像下面那样)
Error using hg.axes/set
The name 'xticklable' is not an accessible property for an instance of class 'axes'.
可不可以请问这样错在哪里了呢?谢谢!
密码修改失败请联系微信:mofangbao
发表于 2016-2-19 10:59:11 | 显示全部楼层
南国的佳人 发表于 2016-2-19 09:37
谢谢,不过好像还是不行
m_proj('Equidistant Cylindrical','lat',[-90 90],'lon',[0 360]);%投影设置
...

不好意思,我打错了,应该是xticklabel不是xticklable,sorry。。。
密码修改失败请联系微信:mofangbao
发表于 2016-2-19 11:00:39 | 显示全部楼层
南国的佳人 发表于 2016-2-19 09:37
谢谢,不过好像还是不行
m_proj('Equidistant Cylindrical','lat',[-90 90],'lon',[0 360]);%投影设置
...

你先用get(gca);查一下里面xticklabel的属性,再对应修改一下
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2016-2-19 14:40:14 | 显示全部楼层
Aires 发表于 2016-2-19 11:00
你先用get(gca);查一下里面xticklabel的属性,再对应修改一下

get(gca)
        ActivePositionProperty = outerposition
        ALim = [0.1 10]
        ALimMode = auto
        AmbientLightColor = [1 1 1]
        Box = on
        CameraPosition = [0 0 3.49782e+17]
        CameraPositionMode = auto
        CameraTarget = [0 0 -5e+15]
        CameraTargetMode = auto
        CameraUpVector = [0 1 0]
        CameraUpVectorMode = auto
        CameraViewAngle = [10.1207]
        CameraViewAngleMode = auto
        CLim = [-50 50]
        CLimMode = manual
        Color = [1 1 1]
        CurrentPoint = [ (2 by 3) double array]
        ColorOrder = [ (7 by 3) double array]
        DataAspectRatio = [1 1 1e+16]
        DataAspectRatioMode = manual
        DrawMode = normal
        FontAngle = normal
        FontName = Helvetica
        FontSize = [10]
        FontUnits = points
        FontWeight = normal
        GridLineStyle = :
        Layer = bottom
        LineStyleOrder = -
        LineWidth = [0.5]
        MinorGridLineStyle = :
        NextPlot = add
        OuterPosition = [0 0 1 1]
        PlotBoxAspectRatio = [2 1 0.31831]
        PlotBoxAspectRatioMode = auto
        Projection = orthographic
        Position = [0.13 0.275079 0.775 0.649921]
        TickLength = [0.01 0.025]
        TickDir = in
        TickDirMode = auto
        TightInset = [0.0464286 0 0.00357143 0]
        Title = [180.007]
        Units = normalized
        View = [0 90]
        XColor = [1 1 1]
        XDir = normal
        XGrid = off
        XLabel = [177.007]
        XAxisLocation = bottom
        XLim = [-3.14159 3.14159]
        XLimMode = manual
        XMinorGrid = off
        XMinorTick = off
        XScale = linear
        XTick = []
        XTickLabel = off
        XTickLabelMode = manual
        XTickMode = manual
        YColor = [0 0 0]
        YDir = normal
        YGrid = off
        YLabel = [178.007]
        YAxisLocation = left
        YLim = [-1.5708 1.5708]
        YLimMode = manual
        YMinorGrid = off
        YMinorTick = off
        YScale = linear
        YTick = [-1.5 -1 -0.5 0 0.5 1 1.5]
        YTickLabel =
                -1.5
                -1  
                -0.5
                0   
                0.5
                1   
                1.5
        YTickLabelMode = auto
        YTickMode = auto
        ZColor = [0 0 0]
        ZDir = normal
        ZGrid = off
        ZLabel = [179.007]
        ZLim = [-1e+16 0]
        ZLimMode = auto
        ZMinorGrid = off
        ZMinorTick = off
        ZScale = linear
        ZTick = [-1e+16 -5e+15 0]
        ZTickLabel =
        ZTickLabelMode = auto
        ZTickMode = auto

        BeingDeleted = off
        ButtonDownFcn =
        Children = [ (23 by 1) double array]
        Clipping = on
        CreateFcn =
        DeleteFcn =
        BusyAction = queue
        HandleVisibility = on
        HitTest = on
        Interruptible = on
        Parent = [1]
        Selected = off
        SelectionHighlight = on
        Tag =
        Type = axes
        UIContextMenu = []
        UserData = []
        Visible = off
可不可以请问再改哪些可以去掉X轴的标注呢?谢谢!
我只改了这些
set(gca, 'xticklabel','off'); set(gca,'XColor',[1 1 1]);set(gca,'XTickLabelMode','manual');
set(gca,'XTickMode','manual');
set(gca,'XTick',[]);set(gca,'XColor',[1 1 1]);
密码修改失败请联系微信:mofangbao
发表于 2016-2-19 16:55:37 | 显示全部楼层
坐标轴刻度和标注
1. 坐标轴刻度(XTick, YTick, ZTick)
只有在设定的数值处才会出现刻度。设定方式可以是[0 1 2 2.5 3]或者1:1:10。
2. 坐标轴刻度模式(XTickMode, YTickMode, ZTickMode)
选择坐标轴刻度是由matlab自动设定(‘auto’)还是用xtick等进行设定(‘manual’)
3. 坐标轴刻度标注(XTickLabel, YTickLabel, ZTickLabel )
在指定刻度的地方做出定义的标注。Matlab支持TeX 和LaTeX文本,不过有的地方可能支持的不如支持董先生好,大家在使用的时候需要按照基本法来进行。
4. 坐标轴刻度标注模式(XTickLabelMode, YTickLabelMode, ZTickLabelMode)
这个嘛…和上面的差不多,也是auto和manual两个选项,大家想必都明白了。
5. 刻度标注模式(TickLabelInterpreter )
此属性是是告诉matlab到底你用的是TeX 文本还是LaTeX文本亦或只是普通文本。共有三个选项,'tex' 、 'latex'和'none'。其中,默认的是tex选项。至于语法嘛,我记得有一本书叫做《84分钟学会latex》,可是那本书我看了一周都没看懂…好在matlab支持的相对有限,主要是上下标、字体、字符颜色、希腊字母和一些数学符号。我相信使用这个的人肯定不知道比我高到哪里去了。有一点需要提醒的是上下标需要用大括号括起来,否则只对第一个字符有效。
6. 坐标轴刻度标注角度(XTickLabelRotation, YTickLabelRotation, ZTickLabelRotation)
此选项定义坐标轴刻度标注的旋转角度,直接输入数值就可以啦。按照逆时针角度进行旋转,负数就是顺时针。
7. 坐标轴小刻度(XMinorTick, YMinorTick, ZMinorTick)
是否在主要刻度中穿插小刻度。小刻度的数目由主要刻度之间的间隔决定。On和off两个选项。两个小刻度之间的数值由小刻度的数量决定。
8. 刻度长度(TickLength)
表示刻度线的长度。一般是两个数,比如说默认的[0.01 0.025]。第一个数值表示在二维视角下的刻度长度,第二个数值表示在三维视角下的刻度长度。对于三个坐标轴,该数值会根据其最长长度进行标准化调整。
9. 刻度方向(TickDir )
决定刻度线的方向。默认是in,表示刻度线的方向指向坐标轴内,你也可以选择out,表示坐标轴刻度线指向坐标外侧。
10. 刻度方向模式(TickDirMode )
用于控制tickdir的属性,和前面一样的,两个模式:auto和manual。Auto就是使用默认的刻度方向,而manual则是根据tickdir的方向来绘制刻度线。

摘自http://mp.weixin.qq.com/s?__biz= ... 04d03b9fa8c4458b#rd
密码修改失败请联系微信:mofangbao
发表于 2016-2-19 17:22:44 | 显示全部楼层
南国的佳人 发表于 2016-2-19 14:40
get(gca)
        ActivePositionProperty = outerposition
        ALim = [0.1 10]

楼主参照二爷写的帖子吧
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Copyright ©2011-2014 bbs.06climate.com All Rights Reserved.  Powered by Discuz! (京ICP-10201084)

本站信息均由会员发表,不代表气象家园立场,禁止在本站发表与国家法律相抵触言论

快速回复 返回顶部 返回列表