Skip to content

Commit f062061

Browse files
chore: merge feature branch
2 parents 144557d + d08bd6e commit f062061

3 files changed

Lines changed: 54 additions & 3 deletions

File tree

.github/workflows/ci-plottest.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ jobs:
6666
echo "📦 Installing: uv sync $EXTRAS"
6767
uv sync $EXTRAS
6868
69-
- name: Setup Chrome for Highcharts
70-
if: steps.detect_libs.outputs.has_plots == 'true' && contains(steps.detect_libs.outputs.libraries, 'highcharts')
69+
- name: Setup Chrome for Selenium-based libraries
70+
if: steps.detect_libs.outputs.has_plots == 'true' && (contains(steps.detect_libs.outputs.libraries, 'highcharts') || contains(steps.detect_libs.outputs.libraries, 'bokeh'))
7171
uses: browser-actions/setup-chrome@v1
7272
with:
7373
chrome-version: stable
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
"""
2+
histogram-basic: Basic Histogram
3+
Library: bokeh
4+
"""
5+
6+
import numpy as np
7+
from bokeh.io import export_png
8+
from bokeh.plotting import figure
9+
10+
11+
# Data - 500 normally distributed values (mean=100, std=15)
12+
np.random.seed(42)
13+
values = np.random.normal(100, 15, 500)
14+
15+
# Compute histogram bins
16+
hist, edges = np.histogram(values, bins=30)
17+
18+
# Create figure (4800 x 2700 px for high resolution)
19+
p = figure(width=4800, height=2700, title="Basic Histogram", x_axis_label="Value", y_axis_label="Frequency")
20+
21+
# Draw histogram using quad glyph
22+
p.quad(
23+
top=hist,
24+
bottom=0,
25+
left=edges[:-1],
26+
right=edges[1:],
27+
fill_color="#306998",
28+
fill_alpha=0.7,
29+
line_color="white",
30+
line_width=1,
31+
)
32+
33+
# Style title
34+
p.title.text_font_size = "20pt"
35+
p.title.align = "center"
36+
37+
# Style axis labels
38+
p.xaxis.axis_label_text_font_size = "20pt"
39+
p.yaxis.axis_label_text_font_size = "20pt"
40+
p.xaxis.major_label_text_font_size = "16pt"
41+
p.yaxis.major_label_text_font_size = "16pt"
42+
43+
# Style grid - subtle
44+
p.xgrid.grid_line_alpha = 0.3
45+
p.ygrid.grid_line_alpha = 0.3
46+
47+
# Ensure y-axis starts at zero
48+
p.y_range.start = 0
49+
50+
# Save output
51+
export_png(p, filename="plot.png")

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ plotting = [
7575
lib-matplotlib = ["matplotlib>=3.9.0", "numpy>=1.26.0", "pandas>=2.2.0"]
7676
lib-seaborn = ["seaborn>=0.13.0", "matplotlib>=3.9.0", "numpy>=1.26.0", "pandas>=2.2.0"]
7777
lib-plotly = ["plotly>=5.18.0", "kaleido>=0.2.1", "numpy>=1.26.0", "pandas>=2.2.0"]
78-
lib-bokeh = ["bokeh>=3.4.0", "numpy>=1.26.0", "pandas>=2.2.0"]
78+
lib-bokeh = ["bokeh>=3.4.0", "numpy>=1.26.0", "pandas>=2.2.0", "selenium>=4.15.0", "webdriver-manager>=4.0.0"]
7979
lib-altair = ["altair>=5.2.0", "vl-convert-python>=1.3.0", "numpy>=1.26.0", "pandas>=2.2.0"]
8080
lib-plotnine = ["plotnine>=0.13.0", "numpy>=1.26.0", "pandas>=2.2.0"]
8181
lib-pygal = ["pygal>=3.0.0", "cairosvg>=2.7.0", "pandas>=2.2.0"]

0 commit comments

Comments
 (0)