2011-07-04 11 views
5

을 감안할 때 두 개의 벡터 플롯을 오버레이에 대한 불투명도 제어 및 다음플롯을

as = VectorPlot[{Cos[y], Sin[x] }, {x, -3, 3}, {y, -3, 3}, 
       VectorScale -> Automatic, VectorColorFunction -> "Rainbow" 
    ]; 
bs = StreamPlot[{Cos[y], Sin[x] }, {x, -3, 3}, {y, -3, 3}, 
       VectorScale -> Automatic, StreamColorFunction -> "Rainbow" 
    ]; 
cs = ContourPlot[Cos[x] + Sin[y], {x, -3, 3}, {y, -3, 3}, 
       ColorFunction -> "BlueGreenYellow" 
    ]; 
Show[cs, bs, as] 

enter image description here

같은 윤곽 플롯 우리는 기본 중첩 작업이 아니라 [] 표시에 의해 이루어집니다 볼 수 있습니다. 하지만 내 질문은 어떻게 배경 등고선 음영 cs의 불투명도를 제어 할 수 있습니까? 또한, 다음과 같은 색상 함수에 "BlueGreenYellow"유형 색상 체계를 삽입하려면 어떻게해야합니까?

ContourPlot[Cos[x] + Sin[y], {x, -3, 3}, {y, -3, 3}, 
      ColorFunction -> (Directive[Opacity[#],Blue] &) 
]; 

답변

7

다음과 같이 BaseStyle를 사용하여 시도 할 수 있습니다 : 벡터 및 프레임이 부분적으로 투명하기 때문에

cs = ContourPlot[Cos[x] + Sin[y], {x, -3, 3}, {y, -3, 3}, 
       ColorFunction -> "BlueGreenYellow", 
       BaseStyle -> Directive[Opacity[0.5]] 
    ]; 

enter image description here

10

나는 그 jmlopez '솔루션은 올바른 생각하지 않는다. 나는 불투명 한 벡터를 보존 할 Graphics 객체 내로 Opacity 명령을 삽입하는 것이 좋습니다 있다고 생각 :

as = VectorPlot[{Cos[y], Sin[x]}, {x, -3, 3}, {y, -3, 3}, 
     VectorScale -> Automatic, VectorColorFunction -> "Rainbow"]; 
bs = StreamPlot[{Cos[y], Sin[x]}, {x, -3, 3}, {y, -3, 3}, 
     VectorScale -> Automatic, StreamColorFunction -> "Rainbow"]; 
cs = ContourPlot[Cos[x] + Sin[y], {x, -3, 3}, {y, -3, 3}, 
     ColorFunction -> "BlueGreenYellow"]; 

cs2 = MapAt[{Opacity[0.5], #} &, cs, 1]; 

Show[cs2, bs, as] 

enter image description here


두 번째 문제는 해결되지 않았다. 이 같은 불투명도와 컬러 그라데이션을 결합 할 수 있습니다 :

ContourPlot[Cos[x] + Sin[y], {x, -3, 3}, {y, -3, 3}, 
    ColorFunction -> ({Opacity[#], ColorData["BlueGreenYellow"][#]} &) 
] 

enter image description here

관련 문제