【问题标题】:Simple Matlab plot won't display point MarkerType简单的 Matlab 绘图不会显示点 MarkerType
【发布时间】:2017-06-27 14:02:21
【问题描述】:

我正在使用 Matlab R2015b - 学术用途和 MarkerType '.'在绘图中不起作用(它不会显示,但数据已被绘制,因为我可以点击它。这是一个简单的示例代码,显示“*”和“-”工作但不是“。”我尝试重新启动计算机和 Matlab,但尚未尝试重新安装,并想尝试避免这种情况。

figure;
plot(10:-1:1,1:10,'r-'); hold on;
plot(1:20,1:20,'r.','MarkerSize',10); hold on;
plot(1:10,1:10,'r*','MarkerSize',10);

如果这可能有帮助,当我输入时:

get(gcf)
             Alphamap: [1x64 double]
         BeingDeleted: 'off'
           BusyAction: 'queue'
        ButtonDownFcn: ''
             Children: [1x1 Axes]
             Clipping: 'on'
      CloseRequestFcn: 'closereq'
                Color: [0.9400 0.9400 0.9400]
             Colormap: [64x3 double]
            CreateFcn: ''
          CurrentAxes: [1x1 Axes]
     CurrentCharacter: ''
        CurrentObject: [1x1 Line]
         CurrentPoint: [355 267]
            DeleteFcn: ''
         DockControls: 'on'
             FileName: ''
    GraphicsSmoothing: 'on'
     HandleVisibility: 'on'
        IntegerHandle: 'on'
        Interruptible: 'on'
       InvertHardcopy: 'on'
          KeyPressFcn: {3x1 cell}
        KeyReleaseFcn: ''
              MenuBar: 'figure'
                 Name: ''
             NextPlot: 'add'
               Number: 1
          NumberTitle: 'on'
     PaperOrientation: 'portrait'
        PaperPosition: [0.2500 2.5000 8 6]
    PaperPositionMode: 'manual'
            PaperSize: [8.5000 11]
            PaperType: 'usletter'
           PaperUnits: 'inches'
               Parent: [1x1 Root]
              Pointer: 'arrow'
    PointerShapeCData: [16x16 double]
  PointerShapeHotSpot: [8 8]
             Position: [2932 266 560 420]
             Renderer: 'opengl'
         RendererMode: 'auto'
               Resize: 'on'
        SelectionType: 'normal'
       SizeChangedFcn: ''
                  Tag: ''
              ToolBar: 'auto'
                 Type: 'figure'
        UIContextMenu: [0x0 GraphicsPlaceholder]
                Units: 'pixels'
             UserData: []
              Visible: 'on'
  WindowButtonDownFcn: {3x1 cell}
WindowButtonMotionFcn: ''
    WindowButtonUpFcn: {3x1 cell}
    WindowKeyPressFcn: {3x1 cell}
  WindowKeyReleaseFcn: {3x1 cell}
 WindowScrollWheelFcn: ''
          WindowStyle: 'normal'

当我输入时:

get(gca)
                   ALim: [0 1]
               ALimMode: 'auto'
 ActivePositionProperty: 'outerposition'
      AmbientLightColor: [1 1 1]
           BeingDeleted: 'off'
                    Box: 'on'
               BoxStyle: 'back'
             BusyAction: 'queue'
          ButtonDownFcn: ''
                   CLim: [0 1]
               CLimMode: 'auto'
         CameraPosition: [10 10 17.3205]
     CameraPositionMode: 'auto'
           CameraTarget: [10 10 0]
       CameraTargetMode: 'auto'
         CameraUpVector: [0 1 0]
     CameraUpVectorMode: 'auto'
        CameraViewAngle: 6.6086
    CameraViewAngleMode: 'auto'
               Children: [3x1 Line]
               Clipping: 'on'
          ClippingStyle: '3dbox'
                  Color: [1 1 1]
             ColorOrder: [7x3 double]
        ColorOrderIndex: 1
              CreateFcn: ''
           CurrentPoint: [2x3 double]
        DataAspectRatio: [10 10 1]
    DataAspectRatioMode: 'auto'
              DeleteFcn: ''
              FontAngle: 'normal'
               FontName: 'Helvetica'
               FontSize: 10
          FontSmoothing: 'on'
              FontUnits: 'points'
             FontWeight: 'normal'
              GridAlpha: 0.1500
          GridAlphaMode: 'auto'
              GridColor: [0.1500 0.1500 0.1500]
          GridColorMode: 'auto'
          GridLineStyle: '-'
       HandleVisibility: 'on'
                HitTest: 'on'
          Interruptible: 'on'
LabelFontSizeMultiplier: 1.1000
                  Layer: 'bottom'
         LineStyleOrder: '-'
    LineStyleOrderIndex: 1
              LineWidth: 0.5000
         MinorGridAlpha: 0.2500
     MinorGridAlphaMode: 'auto'
         MinorGridColor: [0.1000 0.1000 0.1000]
     MinorGridColorMode: 'auto'
     MinorGridLineStyle: ':'
               NextPlot: 'add'
          OuterPosition: [0 0 1 1]
                 Parent: [1x1 Figure]
          PickableParts: 'visible'
     PlotBoxAspectRatio: [1 0.7903 0.7903]
 PlotBoxAspectRatioMode: 'auto'
               Position: [0.1300 0.1100 0.7750 0.8150]
             Projection: 'orthographic'
               Selected: 'off'
     SelectionHighlight: 'on'
             SortMethod: 'childorder'
                    Tag: ''
                TickDir: 'in'
            TickDirMode: 'auto'
   TickLabelInterpreter: 'tex'
             TickLength: [0.0100 0.0250]
             TightInset: [0.0363 0.0532 0.0134 0.0202]
                  Title: [1x1 Text]
TitleFontSizeMultiplier: 1.1000
        TitleFontWeight: 'bold'
                   Type: 'axes'
          UIContextMenu: [0x0 GraphicsPlaceholder]
                  Units: 'normalized'
               UserData: []
                   View: [0 90]
                Visible: 'on'
                  XAxis: [1x1 NumericRuler]
          XAxisLocation: 'bottom'
                 XColor: [0.1500 0.1500 0.1500]
             XColorMode: 'auto'
                   XDir: 'normal'
                  XGrid: 'off'
                 XLabel: [1x1 Text]
                   XLim: [0 20]
               XLimMode: 'auto'
             XMinorGrid: 'off'
             XMinorTick: 'off'
                 XScale: 'linear'
                  XTick: [0 2 4 6 8 10 12 14 16 18 20]
             XTickLabel: {11x1 cell}
         XTickLabelMode: 'auto'
     XTickLabelRotation: 0
              XTickMode: 'auto'
                  YAxis: [1x1 NumericRuler]
          YAxisLocation: 'left'
                 YColor: [0.1500 0.1500 0.1500]
             YColorMode: 'auto'
                   YDir: 'normal'
                  YGrid: 'off'
                 YLabel: [1x1 Text]
                   YLim: [0 20]
               YLimMode: 'auto'
             YMinorGrid: 'off'
             YMinorTick: 'off'
                 YScale: 'linear'
                  YTick: [0 2 4 6 8 10 12 14 16 18 20]
             YTickLabel: {11x1 cell}
         YTickLabelMode: 'auto'
     YTickLabelRotation: 0
              YTickMode: 'auto'
                  ZAxis: [1x1 NumericRuler]
                 ZColor: [0.1500 0.1500 0.1500]
             ZColorMode: 'auto'
                   ZDir: 'normal'
                  ZGrid: 'off'
                 ZLabel: [1x1 Text]
                   ZLim: [-1 1]
               ZLimMode: 'auto'
             ZMinorGrid: 'off'
             ZMinorTick: 'off'
                 ZScale: 'linear'
                  ZTick: [-1 0 1]
             ZTickLabel: ''
         ZTickLabelMode: 'auto'
     ZTickLabelRotation: 0
              ZTickMode: 'auto'

【问题讨论】:

  • 玩了更多之后,我有一个更新。对于任何“。” MarkerSize 大于 16,点显示(适当大),但对于任何 MarkerSize 15 及以下,点不可见。

标签: matlab matlab-figure


【解决方案1】:

您在 MATLAB 中看到不寻常的绘图,可以尝试的一件事是将 OpenGL 渲染更改为 Painters (ref)。你可以通过运行来做到这一点:

set(gcf, 'Renderer', 'painters')

并查看问题是否仍然存在。默认为OpenGL

如果这样可以解决问题,您可能会考虑更新您的显卡驱动程序和/或全新安装 MATLAB。另外,如果您还没有,请尝试重新启动。

【讨论】:

  • 谢谢!这解决了它。您对 Painters 命令的工作是正确的,在更新我的视频卡驱动程序后,问题就解决了。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-09-04
  • 2017-04-16
相关资源
最近更新 更多