{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "## 第7章 Bokehを使いこなそう\n", "\n", "### 7-2: さまざまなオブジェクトの調整" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "# リスト7.2.1:Line()関数のキーワード引数でタイトルを設定\n", "from bokeh.charts import Line\n", "\n", "plot_high = Line([1, 2, 3], title=\"high-level\")" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "# リスト7.2.2:figure()関数のキーワード引数でタイトルを設定\n", "from bokeh.plotting import figure\n", "\n", "plot_mid = figure(title=\"mid-level\")" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "high-level\n", "mid-level\n" ] } ], "source": [ "# リスト7.2.3:属性の参照\n", "print(plot_high.title.text)\n", "print(plot_mid.title.text)" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "High-Level\n", "Mid-Level\n" ] } ], "source": [ "# リスト7.2.5:属性の設定\n", "plot_high.title.text = \"High-Level\"\n", "plot_mid.title.text = \"Mid-Level\"\n", "print(plot_high.title.text)\n", "print(plot_mid.title.text)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.2" } }, "nbformat": 4, "nbformat_minor": 2 }