from bokeh.io import export_png, export_svg, save
save(p, "plot.html") # interactive HTML export_png(p, "plot.png") # requires selenium + phantomjs (older)
In 2.3.3,
export_pngmay need manual setup. Usesave()for reliable sharing.
p.line('date', 'price', source=source, legend_label="Price", color="navy", alpha=0.7) p.line('date', 'moving_avg', source=source, legend_label="10-day MA", color="firebrick", line_width=2)
Bokeh 2.3.3 is a specific version of the Bokeh interactive visualization library released in July 2021. It is a patch-release that primarily addresses bugs related to layouts and extensions. Key Features of Bokeh 2.3.3
Version Focus: As a minor patch release, its main goal was fixing regressions rather than adding major new features.
Fixes: Notable fixes included resolving an issue where the Column layout ignored the scrollable CSS class.
Legacy Context: This version still relied on older WebGL code, which some users found buggy, leading many to later upgrade to version 2.4.x for better performance. Working with Text in Bokeh 2.3.3
When developing text-based elements in this version, you typically use several core models and properties:
Axis Labels: You can add line breaks to labels using the \n string.
Text Properties: Visual attributes like text_color, text_font, and text_font_style can be applied to titles, labels, and annotations.
Mathematical Text: Bokeh 2.3.x supports rendering mathematical notation (LaTeX) via MathJax through the MathText model. bokeh 2.3.3
Text Glyphs: You can render text directly onto a plot using the text() glyph method, which allows for vectorized text placement. Usage Example (v2.3.3 Syntax)
To display a simple text label on a plot in this version, you would use the following structure:
from bokeh.plotting import figure, show p = figure(width=400, height=400) # Adding text glyphs p.text(x=[1, 2], y=[1, 2], text=["Label A", "Label B"], text_color="firebrick", text_font_size="20pt") show(p) Use code with caution. Copied to clipboard
For more detailed documentation, you can refer to the archived Bokeh 2.3.3 User Guide or see current installation options on PyPI. Styling visual attributes — Bokeh 2.3.3 Documentation
Bokeh 2.3.3 is a patch release from July 2021 that primarily addresses layout bugs and extension-related regressions . Below are helpful resources and posts categorized by their utility. Key Technical Updates & Fixes
The Official Release Notes for 2.3.3 detail several critical bug fixes :
Layout Fixes: Resolved issues where columns ignored scrollable CSS classes and panel layout regressions .
Formatting: Fixed bad formatting of y-axis labels when using themes .
UI Tweaks: Active tabs now correctly stay in view on render, and a bug preventing plot heights from going below 600px was fixed .
Extensions: Fixed a bug where extensions did not fetch the exact version from the CDN . Helpful Community Discussions
Working with Tabs and Panels: A discussion on Bokeh Discourse confirms that Bokeh 2.3.3 works well with Panel 0.12.1 to resolve common layout warning messages (like W-1002 EMPTY_LAYOUT) . from bokeh
DataTable Formatting: Users on Bokeh Discourse share solutions for combining NumberFormatter and HTMLTemplateFormatter in 2.3.3 to style specific cells based on value (e.g., coloring negative numbers red) .
Embedding in Private Networks: If you're having trouble with plots not rendering on a private network, this post explains how to manually configure a Resources object to load BokehJS components without relying on external CDNs . Common Troubleshooting
WebGL Issues: If you experience bugs with WebGL in 2.3.3, such as legend interactions not working properly, community experts on Stack Overflow suggest upgrading to Bokeh 2.4.3+, which included significant WebGL refactoring .
Memory Management: There are noted reports of increasing memory consumption when using bokeh serve with multiple browser sessions; if your application is long-running, monitoring memory usage is recommended .
Step Cast Warning: Be aware that the default step value for numeric inputs is 1, which may unexpectedly cast float inputs to integers. You must explicitly set step to a float (e.g., 0.1) to avoid this . Plots Not Rendering on Private Network - Bokeh Discourse
Bokeh 2.3.3, released in July 2021, is a focused patch-release of the Bokeh interactive visualization library. While it isn't a major feature update, it serves as a critical maintenance release that addresses specific layout regressions and extension bugs identified in the broader 2.3.x series. Performance and Stability
This version is primarily valued for its stability improvements. It resolved several frustrating UI issues, such as:
Layout Fixes: Corrected issues where column CSS classes like scrollable were ignored and fixed layout regressions in the panel component.
Axis Formatting: Addressed bad formatting of y-axis labels when using specific themes.
Widget Behavior: Fixed a bug where dropdown menus were hidden in multi-choice widgets and ensured the active tab stays in view upon rendering. Key Features of the 2.3 Series
For users looking at this specific version, it carries the significant advancements of the 2.3 major release, including: title="Volume") ] data_table = DataTable(source=source
Improved WebGL support: Better performance for large datasets.
Enhanced Documentation: A restructured User Guide and expanded documentation to help new users get started.
Server Capabilities: Robust tools for building sophisticated web applications and dashboards without needing to write JavaScript. Community Perspectives
Users often compare Bokeh's flexibility favorably against other frameworks for specific use cases:
“I actually loved using Bokeh... I like attaching callbacks to the object that started the callback... I also like not having to worry about saving/loading the current state of the application.” Bokeh Discourse · 5 years ago
“Bokeh's architecture is more suited for complex layouts and interactive elements than Matplotlib, making it a top choice for dashboards.” StrataScratch · 1 year ago
Verdict: Bokeh 2.3.3 is a reliable "legacy" choice if you are maintaining a project from the 2021 era. However, for new projects, you should consider the latest version (currently 3.x) which offers modern contour plots and significantly restructured APIs.
Installing this specific version is straightforward. It is strongly recommended to use a virtual environment.
columns = [ TableColumn(field="date", title="Date", formatter="datetime"), TableColumn(field="price", title="Price ($)"), TableColumn(field="volume", title="Volume") ] data_table = DataTable(source=source, columns=columns, width=400, height=400)
⚠️ Later Bokeh versions (3.x) have breaking changes in API and default themes.