Skip to content
geeksforgeeks
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • Build your AI Agent
    • GfG 160
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Contests
    • Accenture Hackathon (Ending Soon!)
    • GfG Weekly [Rated Contest]
    • Job-A-Thon Hiring Challenge
    • All Contests and Events
  • Bokeh
  • Matplotlib
  • Pandas
  • Seaborn
  • Ggplot
  • Plotly
  • Altair
  • Networkx
  • Machine Learning Math
  • Machin Learning
  • Data Analysis
  • Deep Learning
  • Deep Learning Projects
  • NLP
  • Computer vision
  • Data science
  • Machin Learning Interview question
  • Deep learning interview question
Open In App
Next Article:
bokeh.plotting.figure.circle_x() function in Python
Next article icon

bokeh.plotting.figure.diamond() function in Python

Last Updated : 28 Jul, 2020
Comments
Improve
Suggest changes
Like Article
Like
Report

Bokeh is a data visualization library in Python that provides high-performance interactive charts and plots and the output can be obtained in various mediums like notebook, HTML and server. Figure Class create a new Figure for plotting. It is a subclass of Plot that simplifies plot creation with default axes, grids, tools, etc.  

bokeh.plotting.figure.diamond() function

The diamond() function in the plotting module of the bokeh library is used to Configure and add Diamond glyphs to this Figure. 
 

Syntax: diamond(x, y, size=4, angle=0.0, *, angle_units=’rad’, fill_alpha=1.0, fill_color=’gray’, line_alpha=1.0, line_cap=’butt’, line_color=’black’, line_dash=[], line_dash_offset=0, line_join=’bevel’, line_width=1, name=None, tags=[], **kwargs)

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

  • x: This parameter is the x-coordinates for the center of the markers.
  • y: This parameter is the y-coordinates for the center of the markers.
  • size: This parameter is the size (diameter) values for the markers in screen space units.
  • angle: This parameter is the angles to rotate the markers.
  • fill_color: This parameter is the fill color values for the markers.
  • line_color: This parameter is the line color values for the markers with default value of black.1.
  • name: This parameter is the user-supplied name for this model.
  • tags: This parameter is the user-supplied values for this model.


Return: This method return the GlyphRenderer value. 
 


Below examples illustrate the bokeh.plotting.figure.diamond() function in bokeh.plotting: 
Example 1: 
 

Python3

# Implementation of bokeh function 
     
import numpy as np  
from bokeh.plotting import figure, output_file, show 
     
plot = figure(plot_width = 300, plot_height = 300) 
plot.diamond(x = [1, 2, 3], y = [3, 7, 5],  
            size = 20, color ="red", alpha = 0.9) 
     
show(plot) 
                      
                       

Output: 
 


Example 2: 
 

Python3

# Implementation of bokeh function 
     
import numpy as np  
from bokeh.plotting import figure, output_file, show 
     
x = [1, 2, 3, 4, 5] 
y = [6, 7, 8, 7, 3] 
    
output_file("geeksforgeeks.html") 
    
p = figure(plot_width = 300, plot_height = 300) 
  
p.line(x, y, line_width = 2) 
p.diamond(x, y, fill_color ="red",  
         line_color ="green", size = 18) 
    
show(p) 
                      
                       

Output: 
 


 



Next Article
bokeh.plotting.figure.circle_x() function in Python

S

shubhamsingh84100
Improve
Article Tags :
  • Python
  • Python Bokeh-plotting-figure-class
  • Python-Bokeh
Practice Tags :
  • python

Similar Reads

  • bokeh.plotting.figure.diamond_cross() function in Python
    Bokeh is a data visualization library in Python that provides high-performance interactive charts and plots and the output can be obtained in various mediums like a notebook, HTML and server. Figure Class create a new Figure for plotting. It is a subclass of Plot that simplifies plot creation with d
    2 min read
  • bokeh.plotting.figure.dash() function in Python
    Bokeh is a data visualization library in Python that provides high-performance interactive charts and plots and the output can be obtained in various mediums like notebook, Html and server. Figure Class create a new Figure for plotting. It is a subclass of Plot that simplifies plot creation with def
    2 min read
  • bokeh.plotting.figure.cross() function in Python
    Bokeh is a data visualization library in Python that provides high-performance interactive charts and plots and the output can be obtained in various mediums like notebook, HTML, and server. Figure Class create a new Figure for plotting. It is a subclass of Plot that simplifies plot creation with de
    2 min read
  • bokeh.plotting.figure.circle() function in Python
    Bokeh is a data visualization library in Python that provides high-performance interactive charts and plots and the output can be obtained in various mediums like notebook, html and server. The Figure Class create a new Figure for plotting. It is a subclass of Plot that simplifies plot creation with
    4 min read
  • bokeh.plotting.figure.circle_x() function in Python
    Bokeh is a data visualization library in Python that provides high-performance interactive charts and plots and the output can be obtained in various mediums like notebook, html and server. The Figure Class create a new Figure for plotting. It is a subclass of Plot that simplifies plot creation with
    4 min read
  • bokeh.plotting.figure.arc() function in Python
    Bokeh is a data visualization library in Python that provides high-performance interactive charts and plots and the output can be obtained in various mediums like notebook, html and server. The Figure Class create a new Figure for plotting. It is a subclass of Plot that simplifies plot creation with
    4 min read
  • bokeh.plotting.figure.step() function in Python
    Bokeh is a data visualization library in Python that provides high-performance interactive charts and plots and the output can be obtained in various mediums like notebook, html and server. The Figure Class create a new Figure for plotting. It is a subclass of Plot that simplifies plot creation with
    4 min read
  • bokeh.plotting.figure.circle_cross() function in Python
    Bokeh is a data visualization library in Python that provides high-performance interactive charts and plots and the output can be obtained in various mediums like notebook, html and server. The Figure Class create a new Figure for plotting. It is a subclass of Plot that simplifies plot creation with
    4 min read
  • bokeh.plotting.figure.bezier() function in Python
    Bokeh is a data visualization library in Python that provides high-performance interactive charts and plots and the output can be obtained in various mediums like notebook, html and server. The Figure Class create a new Figure for plotting. It is a subclass of Plot that simplifies plot creation with
    4 min read
  • bokeh.plotting.figure.annulus() function in Python
    Bokeh is a data visualization library in Python that provides high-performance interactive charts and plots and the output can be obtained in various mediums like notebook, html and server. The Figure Class create a new Figure for plotting. It is a subclass of Plot that simplifies plot creation with
    4 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences