A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.geeksforgeeks.org/make-an-area-plot-in-python-using-bokeh/ below:

Make an area plot in Python using Bokeh

Make an area plot in Python using Bokeh

Last Updated : 15 Jul, 2025

Bokeh is a Python interactive data visualization. Unlike Matplotlib and Seaborn, Bokeh renders its plots using HTML and JavaScript. It targets modern web browsers for presentation providing elegant, concise construction of novel graphics with high-performance interactivity.

Plotting the Area Plots

Area plots are defined as the filled regions between two series that share a common areas. Bokeh Figure class has two methods which are given below:

1. varea() method:  varea() method is a vertical directed area which has one x coordinate array and two y coordinate arrays, y1 and y2, that will be filled between.

Syntax: varea(x, y1, y2, **kwargs)

Parameter:This method accept the following parameters that are described below:

Example:

Python3
# Implementation of bokeh function
  
import numpy as np 
from bokeh.plotting import figure, output_file, show
  
x = [1, 2, 3, 4, 5]
y1 = [2, 4, 5, 2, 4]
y2 = [1, 2, 2, 3, 6]
 
output_file("geeksforgeeks.html")
 
p = figure(plot_width=300, plot_height=300)
 
# area plot
p.varea(x=x, y1=y1, y2=y2,fill_color="green")
 
show(p)

Output:

2. harea() method:  harea() method is a horizontal directed area which has one x coordinate array and two y coordinate arrays, y1 and y2, that will be filled between.

Syntax: harea(x1, x2, y, **kwargs)

Parameter:This method accept the following parameters that are described below:

Example:

Python3
# Implementation of bokeh function
  
import numpy as np 
from bokeh.plotting import figure, output_file, show
  
y = [1, 2, 3, 4, 5]
x1 = [2, 4, 5, 2, 4]
x2 = [1, 2, 2, 3, 6]
 
output_file("geeksforgeeks.html")
 
p = figure(plot_width=300, plot_height=300)
 
# area plot
p.harea(x1=x1, x2=x2, y=y,fill_color="green")
 
show(p)

Output:



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4