Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions plots/bokeh/scatter/scatter-basic/default.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
"""
scatter-basic: Basic Scatter Plot
Library: bokeh
"""

import numpy as np
from bokeh.io import export_png
from bokeh.models import ColumnDataSource
from bokeh.plotting import figure


# Data
np.random.seed(42)
x = np.random.randn(100) * 2 + 10
y = x * 0.8 + np.random.randn(100) * 2

source = ColumnDataSource(data={"x": x, "y": y})

# Create figure (4800 × 2700 px for 16:9 aspect ratio)
p = figure(width=4800, height=2700, title="Basic Scatter Plot", x_axis_label="X Value", y_axis_label="Y Value")

# Plot scatter
p.scatter(x="x", y="y", source=source, size=12, color="#306998", alpha=0.7)

# Styling
p.title.text_font_size = "20pt"
p.xaxis.axis_label_text_font_size = "20pt"
p.yaxis.axis_label_text_font_size = "20pt"
p.xaxis.major_label_text_font_size = "16pt"
p.yaxis.major_label_text_font_size = "16pt"
p.grid.grid_line_alpha = 0.3

# Save
export_png(p, filename="plot.png")
Loading
Loading