Python Bokeh – Plotting Squares with Xs on a GraphReadDiscussCoursesPracticeImprove Article ImproveSave Article SaveLike Article LikeBokeh is a Python interactive data visualization. It 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.Bokeh can be used to plot squares with Xs on a graph. Plotting squares with Xs on a graph can be done using the square_x() method of the plotting module.plotting.figure.square_x()Syntax : square_x(parameters)Parameters :x : x-coordinates of the center of the squarey : y-coordinates of the center of the squareReturns : an object of class GlyphRendererExample 1 : In this example we will be using the default values for plotting the graph.# importing the modulesfrom bokeh.plotting import figure, output_file, show # file to save the modeloutput_file("gfg.html") # instantiating the figure objectgraph = figure(title = "Bokeh Square X Graph") # the points to be plottedx = 0y = 0 # plotting the graphgraph.square_x(x, y, size = 30, fill_color = None) # displaying the modelshow(graph)Output :Example 2 : In this example we will be plotting the multiple squares with various other parameters# importing the modules from bokeh.plotting import figure, output_file, show # file to save the model output_file("gfg.html") # instantiating the figure object graph = figure(title = "Bokeh Square X Graph") # name of the x-axis graph.xaxis.axis_label = "x-axis" # name of the y-axis graph.yaxis.axis_label = "y-axis" # points to be plottedx = [3, 3, 5]y = [3, 1, 3]size = [130, 100, 60] # color value of the squarecolor = ["yellow", "red", "purple"] # fill alpha value of the squarefill_alpha = [0.9, 0.7, 0.5] # plotting the graph graph.square_x(x, y, size = size, color = color, fill_alpha = fill_alpha) # displaying the model show(graph)Output :Last Updated : 10 Jul, 2020Like Article Save Article Please Login to comment...Similar ReadsPython Bokeh - Plotting Squares with Dots on a GraphPython Bokeh - Plotting Squares with Crosses on a GraphPython Bokeh - Plotting Squares on a GraphPython Bokeh - Plotting a Line GraphPython Bokeh - Plotting Ellipses on a GraphPython Bokeh - Plotting Dots on a GraphPython Bokeh - Plotting Diamond Dots on a GraphPython Bokeh - Plotting Diamond Crosses on a GraphPython Bokeh - Plotting Diamonds on a GraphPython Bokeh - Plotting Dashes on a GraphRelated TutorialsOpenAI Python API - Complete GuidePandas AI: The Generative AI Python LibraryPython for Kids - Fun Tutorial to Learn Python ProgrammingData Analysis TutorialFlask Tutorial LikePreviousPython Bokeh - Plotting Triangles on a GraphNext Python Bokeh - Plotting Square Pins on a GraphArticle Contributed By :YYash_RYash_R FollowVote for difficultyEasy Normal Medium Hard ExpertArticle Tags :Data VisualizationPython Bokeh-plotting-figure-classPython-BokehPythonPractice Tags :pythonReport Issue