DelphiLearn PythonPythonPython GUIRAD StudioWindows

How To Build A Python GUI For Stunning Data Visualizations

How To Build A Python GUI For Stunning Data Visualizations

With the growing demand for Data Science and Analytics skill sets, drawing graphics programmatically is a very popular task these days. Especially the need for high quality, real-time, and interactive graphics. You can easily create a GUI app for that purpose by combining the power of the Plotly library with Python4Delphi (P4D). P4D is a free set of powerful tools that allows you to work with Python scripts, modules, and types in Delphi and easily create Windows GUIs with Data Visualization Tools Python.

What is Plotly?

Plotly or is an interactive, open-source, and browser-based Data Visualization library for Python. Built on top of plotly.js, is a high-level, declarative charting library. plotly.js ships with over 30 chart types, including scientific charts, 3D graphs, statistical charts, SVG maps, financial charts, and more. is MIT Licensed.

Are you looking for a simple, flexible, and powerful Data Visualization library, and build a nice GUI for it? You can deliver enterprise-grade and publication-quality graphs easily by combining Plotly and Python4Delphi library, inside Delphi and C++Builder.

This post will guide you on how to run the Plotly library using Python for Delphi to display it in the Delphi Windows GUI app.

How do I enable Plotly for data Visualization inside Python4Delphi on Windows?

First, open and run our Python GUI using project Demo1 from Python4Delphi with RAD Studio. Then insert the script into the lower Memo, click the Execute button, and get the result in the upper Memo. You can find the Demo1 source on GitHub. The behind the scene details of how Delphi manages to run your Python code in this amazing Python GUI can be found at this link.

Open Demo01.dproj
Open Demo01.dproj

How do I install Plotly in Python?

Here is how you can get Plotly using the pip command:

To test the installation, let’s run this script to visualize the Iris dataset using a basic scatterplot:

Let’s see the result:

Plotly Demo with Python4Delphi in Windows.


How can I visualize real-world data using Plotly inside a Windows GUI app?

The following is a code example of Plotly to visualize the famous 1962-2006 Walmart Store Openings dataset (run this inside the lower Memo of Python4Delphi Demo01 GUI):

What does Plotly look like when it is running?

Let’s see the result:

Plotly Demo with Python4Delphi in Windows.

Check out the full source code here!

Congratulations, now you have learned how to run the Plotly library using Python for Delphi to display it in the Delphi Windows GUI app! Now you can solve various real-world problems using plots created by the Plotly library and Python4Delphi.


Do you have more examples of using Plotly and other types of data visualizations in Windows GUI apps?

Check out the Plotly data visualization library for Python and use it in your projects: and

Check out Python4Delphi which easily allows you to build Python GUIs for Windows using Delphi:

Or read our collections of Data Visualization articles:





Related posts

Become An Expert With A Python GUI Builder By Watching These 5 Videos

PythonPython GUI

What Are Python Native Development Tools?


5 Real-Life Lessons About The Best IDE for Python


24 Hours to Improving A Python GUI

Leave a Reply

Your email address will not be published.