【问题标题】:Changing font size of colorbar TickLabels in Matlab automatically在 Matlab 中自动更改颜色条 TickLabels 的字体大小
【发布时间】:2018-11-15 16:03:09
【问题描述】:

如何在 Matlab 中自动更改颜色条 TickLabels 的字体大小? 我知道我可以使用

更改字体
c = colorbar;
c.Label.String = 'string';
c.Label.FontSize=16;

但找不到如何更改刻度的字体大小。

【问题讨论】:

  • 什么意思? c.Label.FontSize=16; 是您更改字体大小的方式,正如名称 FontSize 所建议的那样。
  • 它不会改变 Ticklables 的字体大小。它改变了标签的字体大小。
  • 尝试更改c.FontSize
  • 谢谢纳文。我不知道我是怎么错过的:)

标签: matlab matlab-figure


【解决方案1】:

你可能指的是刻度的粗细,你可以通过属性来改变

c.LineWidth

或者你可以改变刻度的字体大小

c.FontSize

您可以使用许多其他属性,特别是在 2018b 中,这些是可修改的属性及其默认值:

        AxisLocation: 'out'
    AxisLocationMode: 'auto'
        BeingDeleted: 'off'
                 Box: 'on'
          BusyAction: 'queue'
       ButtonDownFcn: ''
            Children: [0×0 GraphicsPlaceholder]
               Color: [0.1500 0.1500 0.1500]
           CreateFcn: ''
           DeleteFcn: ''
           Direction: 'normal'
           FontAngle: 'normal'
            FontName: 'Helvetica'
            FontSize: 9
          FontWeight: 'normal'
    HandleVisibility: 'on'
             HitTest: 'on'
       Interruptible: 'off'
               Label: [1×1 Text]
              Limits: [0 1]
          LimitsMode: 'auto'
           LineWidth: 0.5000
            Location: 'eastoutside'
              Parent: [1×1 Figure]
       PickableParts: 'visible'
            Position: [0.8307 0.1095 0.0381 0.8167]
            Selected: 'off'
  SelectionHighlight: 'on'
                 Tag: 'Colorbar'
       TickDirection: 'in'
TickLabelInterpreter: 'tex'
          TickLabels: {11×1 cell}
      TickLabelsMode: 'auto'
          TickLength: 0.0100
               Ticks: [0 0.1000 0.2000 0.3000 0.4000 0.5000 0.6000 0.7000 0.8000 0.9000 1]
           TicksMode: 'auto'
                Type: 'colorbar'
       UIContextMenu: [1×1 ContextMenu]
               Units: 'normalized'
            UserData: []
             Visible: 'on'

如果它不在这里,你不能改变它。

【讨论】:

    猜你喜欢
    • 2017-03-04
    • 2016-09-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-06-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多