2017-01-23 32 views
3

ボケの図形の詰め(または余白)を取り除くことは可能ですか? 私は様々な人物を見てきました。彼らはすべて、この空白の領域を左に持つようです。私はまた、例えば国境 を変えてみました:s1.min_border_left = 0 or change it to s1.min_border_left = 40ボケの図形から余白や余白を削除する

が、仕事をしていないようだ、それは境界線を変更しますが、何とかchangable固定していないパディングの例があるようですエリアを取り除きたいのですが: Image example これを取り除くだけで、図形をブラウザの左側に貼り付けることができますか?

Bokeh Figures and Borders

答えて

0

で幅が90%を交換してください。

html, body { 
    display: block; 
    margin: 0 auto; 
    width: 99%; 
} 
0

オープンは、HTMLページを生成し、ボケサーバーを使用して、あなたは余白を変更するには、このようなもので外部CSSシートを追加することができた場合は100%

0

他の回答に基づいて、ここに便利になることがあり抜粋です。

import os 
import re 
import tempfile 
import webbrowser 
import time 

from bokeh.io import output_file, save 


def save_bokeh_nomargins(plot, filename): 
    """ 
    Saves a bokeh plot/layout without having the left margin. 
    """ 
    # Strategy: 
    # 1. save the plot to a temp file 
    # 2. change the offending line of code 
    # 3. save the result to the destination file 
    ftemp = tempfile.mktemp() 
    try: 
     output_file(ftemp) 
     save(plot) 
     with open(ftemp) as ftemph, open(filename, "w") as fouth: 
      fouth.write(re.sub("width: 90%;", "width: 100%;", ftemph.read(), count=1)) 
    finally: 
      os.remove(ftemp) 


def show_bokeh_nomargins(plot): 
    """ 
    Displays a bokeh plot/layout without having the left margin. 
    """ 
    ftemp = tempfile.mktemp() 
    try: 
     save_bokeh_nomargins(plot, ftemp) 
     webbrowser.open(ftemp) 
     time.sleep(1) 
    finally: 
     os.remove(ftemp) 

私は、これは少しハックであることに注意しなければならない、とあなたはどこか他のwidth: 90%を持っている場合、それはうまくいかないかもしれませんあなたのファイルに。

関連する問題