Bokeh examples3/21/2023 You’ll find out more about the toolbar and how to configure it in the Adding Interaction section at the end of this tutorial. This is an important sneak preview into the interactive elements of Bokeh that come right out of the box. # Import reset_output (only needed once) from otting import reset_output # Use reset_output() between subsequent show() calls, as needed reset_output ()īefore moving on, you may have noticed that the default Bokeh figure comes pre-loaded with a toolbar. That’s it! Those six steps are the building blocks for a tidy, flexible template that can be used to take your data from the table to the big screen: Otherwise, you can revisit the steps above as needed to bring your data vision to reality. If you like what you see, you can save your visualization to an image file. Whether you’re viewing your visualization in a browser or notebook, you’ll be able to explore your visualization, examine your customizations, and play with any interactions that were added. Preview and Save Your Beautiful Data Creationįinally, it’s time to see what you created. ![]() In addition, your plots can be quickly linked together, so a selection on one will be reflected on any combination of the others. Not only does Bokeh offer the standard grid-like layout options, but it also allows you to easily organize your visualizations into a tabbed layout in just a few lines of code. If you need more than one figure to express your data, Bokeh’s got you covered. This functionality gives you incredible creative freedom in representing your data.Īdditionally, Bokeh has some built-in functionality for building things like stacked bar charts and plenty of examples for creating more advanced visualizations like network graphs and maps. Here, you have the flexibility to draw your data from scratch using the many available marker and shape options, all of which are easily customizable. Next, you’ll use Bokeh’s multitude of renderers to give shape to your data. You can also set up a suite of tools that can enable various user interactions with your visualization. In this step, you can customize everything from the titles to the tick marks. Set up the Figure(s)įrom here, you’ll assemble your figure, preparing the canvas for your visualization. In this tutorial, you’ll learn about two common options that Bokeh provides: generating a static HTML file and rendering your visualization inline in a Jupyter Notebook. Determine Where the Visualization Will Be RenderedĪt this step, you’ll determine how you want to generate and ultimately view your visualization. This step commonly involves data handling libraries like Pandas and Numpy and is all about taking the required steps to transform it into a form that is best suited for your intended visualization. If you need a quick refresher on handling data in Python, definitely check out the growing number of excellent Real Python tutorials on the subject. You can download the examples and code snippets from the Real Python GitHub repo.Īny good data visualization starts with-you guessed it-data. Add interactivity to your visualizations.Customize and organize your visualizations.Transform your data into visualizations, using Bokeh.Using a number of examples on a real-world dataset, the goal of this tutorial is to get you up and running with Bokeh. ![]() However, it’s an equally powerful tool for exploring and understanding your data or creating beautiful custom charts for a project or report. This makes it a great candidate for building web-based dashboards and applications. Unlike popular counterparts in the Python visualization space, like Matplotlib and Seaborn, Bokeh renders its graphics using HTML and JavaScript. Watch it together with the written tutorial to deepen your understanding: Interactive Data Visualization in Python With Bokehīokeh prides itself on being a library for interactive data visualization. Watch Now This tutorial has a related video course created by the Real Python team.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |