English 中文(简体)
在Matlab为地块功能设置颜色
原标题:Setting colors for plot function in Matlab

我希望能够选择多线块地的颜色,但我不能这样做。 这是我的法典。

colors = { b , r , g };
T = [0 1 2] ;
column = [2 3];
count = magic(3);
SelecY = count(:,column),
plot(T,SelecY, Color ,colors{column});
最佳回答

你们只能以这种方式指明一个肤色,必须将其指定为三维载体。 你的三个路线是:

  1. 穿透和具体指明颜色,与你一样:

    hold on
    for i=1:size(SelecY, 2)
        plot(T, SelecY(:,i), colors{i});
    end
    
  2. 借助于RGB的彩色特性,你可以通过科罗财产通过颜色,就像你试图做到:

    cols = jet(8);
    hold on
    for i=1:size(SelecY, 2)
        plot(T, SelecY(:,i),  Color , cols(i,:));
    end
    
  3. 另外,通过采用《欧洲刑法》的方式,你还可以在前面具体说明,然后通过:

    set(gca,  ColorOrder , jet(3))
    hold all
    for i=1:size(SelecY, 2)
        plot(T, SelecY(:,i));
    end
    

关于标注,见其他答案。

问题回答

出于某种原因,我不得不在不使用操作的情况下工作,但:

h = plot(T,SelecY);
set(h, { Color }, colors(column) );

我的工作。





相关问题
using colors in calculated member

Im using this query in MDX for a calculate measure topcount(nonempty([StatusPlanes].[Status].Status.members,[Measures].[Planes]),1)(0).member_caption this will bring me this result Dimension1 ...

Using colors with MDX calculated measure

I m using this query in MDX for a calculated measure topcount(nonempty([StatusPlanes].[Status].Status.members,[Measures].[Planes]),1)(0).member_caption This will bring me this result Dimension1 ...

How can I convert a color image to grayscale in MATLAB?

I am trying to implement an algorithm in computer vision and I want to try it on a set of pictures. The pictures are all in color, but I don t want to deal with that. I want to convert them to ...

Hex colors: Numeric representation for "transparent"?

I am building a web CMS in which the user can choose colours for certain site elements. I would like to convert all colour values to hex to avoid any further formatting hassle ("rgb(x,y,z)" or named ...

How to change out-of-focus text selection color in Xcode?

Okay, I ll bite. I ve got really pleasant code/window colors set up in Xcode. Ordinarily, my selection color is very visible. When I am doing a project search and iterating through the results, ...

How to change Gmap markers color?

I ve a custom google map with different points: Markers[0] = new Array(new GMarker(new GLatLng(45.0, 9.0)), "Location1", "<strong>Address Line</strong><br/>Some information"); ...