JH Park note

Week 01 Worknotes

2018-01-02 22:12:24
Python + Bokeh 에서 여러가지 옵션 테스트

  • WebGL Mode
  • Open default Web Browsers as Chrome (for WebGL)
  • Export SVG
  • Import CSV
  • Disable Toolbar
    import webbrowser
    print(webbrowser._browsers)


    # MacOS
    chrome_path = 'open -a /Applications/Google\ Chrome.app %s'

    from bokeh.io import export_svgs

    import pandas
    from bokeh.plotting import figure, output_file, show


    # pandas
    df = pandas.read_csv('audio_data_1sec.csv')

                                 
    # bokeh
    plot = figure(width=1200, height=350, x_range=[0,1200], output_backend="webgl")
    plot.toolbar.logo = None
    # plot.toolbar_location = None

    plot.scatter(x=df.time, y=df.value)
    plot.line(x=df.time, y=df.value)

    show(plot, browser=chrome_path)

    output_file('audio_data_1sec.html')

    plot.output_backend = "svg"
    export_svgs(plot, filename="plot.svg")

2018-01-02 01:58:59
작업 노트를 좀더 자세히 기록할 것.
긴 작업 노트의 경우 Medium 으로 옮길 것.