{"spec_id":"line-basic","library":"bokeh","language":"python","code":"\"\"\" anyplot.ai\nline-basic: Basic Line Plot\nLibrary: bokeh 3.9.0 | Python 3.13.13\nQuality: 87/100 | Updated: 2026-04-29\n\"\"\"\n\nimport os\n\nimport numpy as np\nfrom bokeh.io import export_png, output_file, save\nfrom bokeh.models import ColumnDataSource\nfrom bokeh.plotting import figure\n\n\n# Theme tokens\nTHEME = os.getenv(\"ANYPLOT_THEME\", \"light\")\nPAGE_BG = \"#FAF8F1\" if THEME == \"light\" else \"#1A1A17\"\nINK = \"#1A1A17\" if THEME == \"light\" else \"#F0EFE8\"\nINK_SOFT = \"#4A4A44\" if THEME == \"light\" else \"#B8B7B0\"\nBRAND = \"#009E73\"\n\n# Data - Daily temperature readings for a month\nnp.random.seed(42)\ndays = np.arange(1, 32)\nbase_temp = 20 + 8 * np.sin(np.linspace(0, np.pi, 31))\ntemperature = base_temp + np.random.randn(31) * 2\n\nsource = ColumnDataSource(data={\"day\": days, \"temperature\": temperature})\n\n# Plot\np = figure(\n    width=4800,\n    height=2700,\n    title=\"line-basic · bokeh · anyplot.ai\",\n    x_axis_label=\"Day of Month\",\n    y_axis_label=\"Temperature (°C)\",\n)\n\np.line(x=\"day\", y=\"temperature\", source=source, line_width=5, line_color=BRAND)\np.scatter(x=\"day\", y=\"temperature\", source=source, size=16, fill_color=BRAND, line_color=PAGE_BG, line_width=3)\n\n# Style — text sizes for 4800×2700 px\np.title.text_font_size = \"42pt\"\np.title.text_color = INK\np.xaxis.axis_label_text_font_size = \"32pt\"\np.xaxis.axis_label_text_color = INK\np.yaxis.axis_label_text_font_size = \"32pt\"\np.yaxis.axis_label_text_color = INK\np.xaxis.major_label_text_font_size = \"24pt\"\np.xaxis.major_label_text_color = INK_SOFT\np.yaxis.major_label_text_font_size = \"24pt\"\np.yaxis.major_label_text_color = INK_SOFT\n\n# Background and borders\np.background_fill_color = PAGE_BG\np.border_fill_color = PAGE_BG\np.outline_line_color = INK_SOFT\n\n# Axis lines and ticks\np.xaxis.axis_line_color = INK_SOFT\np.yaxis.axis_line_color = INK_SOFT\np.xaxis.major_tick_line_color = INK_SOFT\np.yaxis.major_tick_line_color = INK_SOFT\np.xaxis.axis_line_width = 2\np.yaxis.axis_line_width = 2\n\n# Grid — y-axis only, subtle\np.xgrid.grid_line_color = None\np.ygrid.grid_line_color = INK\np.ygrid.grid_line_alpha = 0.10\n\np.toolbar_location = None\n\n# Save\nexport_png(p, filename=f\"plot-{THEME}.png\")\noutput_file(f\"plot-{THEME}.html\")\nsave(p)\n"}