2017-10-20 2 views
0

디지털 신호의 플롯이 있습니다. 나는 내가 녹음하고있는 과정의 특정 단계에서 음영을하려고 노력하고있다. 나는 다큐멘터리를 통해 독서를 시도했지만 다음 질문에 대한 답을 찾지 못했습니다.마우스를 가져 가면 텍스트가 채워집니다. Python plotly

1) 첫 번째 및 양식 : 전체 텍스트를 채우기 영역에 추가 할 수 있습니까? 커서가 '녹색'영역 위에있을 때 커서 상자에 '스테이지 0'이라고 말하고 싶습니다. 다음은이 작업을 수행하기위한 코드입니다.

trace_stage0=go.Scatter(
    x = [points['A'][0], points['B'][0]], 
    y = [1,1], 
    mode = 'line', 
    line = dict(width=0.2, color='rgb(0, 190, 0)'), 
    fill = 'tozeroy', 
    hoveron = "fills", 
    hovertext = "Stage 0", 
    showlegend = False) 
for i in range(Num_Channels): 
    fig.append_trace(trace0[i],i+1,1) 
    fig.append_trace(trace_stage0,i+1,1) 

2) 어떻게 각 행의 끝점을 제거 할 수 있습니까? 나에게 그들은 내가 묘사하려는 정보에서 산만 해지고있다. 나는 mode = 'none'을 시도했지만, 분명히 채우기 색상을 제어 할 수있는 능력이 없어졌습니다.

3) 채우기의 불투명도를 조정하는 방법이 있습니까? 좀 더 가볍게 만들고 싶습니다. community.plot.ly에서 'empet'에

Digital Capture

답변

0

감사합니다 덕분에, 여기서 일하는 결국 코드입니다. 기본적으로 음영 처리 된 섹션에 대해 별도의 플롯을 작성해야했습니다.

#### Plot ploints for the text #### 
trace_stages=dict(type='scatter', 
    x= stages_x, 
    y=[0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 
     0.5, 0.5, 0.5, 0.5, 0.5], 
    mode='markers', 
    text=['stage 0', 'stage 1', 'stage 2', 'stage 3', 'stage 4', 'stage 5', 
      'stage 6', 'stage 7', 'stage 8','stage 9', 'stage 10'], 
    hoverinfo='text', 
    marker=dict(size=[0]), 
    showlegend = False 
    ) 
#### Plot for the shading #### 
trace_stage0=go.Scatter(
    x = [points['A'][0], points['B'][0]], 
    y = [1,1], 
    mode = 'markers+lines', 
    line = dict(width=0),   # Setting width = 0 = no lines 
    marker=dict(size=[0,0]),   # Setting size = [0,0] = no dots 
    fill = 'tozeroy', 
    fillcolor = 'rgba(190,0,0,.15)', # The '.15' sets opaqueness 
    hoverinfo = "none", 
    showlegend = False) 

일부 긴 코드를 사용하지만 작동합니다.

관련 문제