Skip to content

Python-Based Visualization of PLAXIS Outputs

Comparing Outputs Across Phases with PLAXIS Automation Series: The integrated plotting tool in the PLAXIS Output app enables users to analyze outputs at different stages. While it offers fundamental plot functions for visually representing results, many opt for Excel due to its extensive...

Displaying PLAXIS Results with Python Code
Displaying PLAXIS Results with Python Code

Python-Based Visualization of PLAXIS Outputs

In this tutorial, we will guide you through the process of automating the creation of customized plots in Excel using Python, focusing on PLAXIS 2D models. This tutorial builds upon the lessons learned from the second tutorial, with an emphasis on extracting output from multiple phases and using plots to compare results.

Prerequisites

To follow along with this tutorial, you will need the following:

  1. A PLAXIS 2D model from the second tutorial.
  2. The PLAXIS environment and VS Code installed.
  3. The required modules: pandas, xlsxwriter, and Openpyxl.

Steps to Automate Plots in Excel

  1. Extract PLAXIS Results: Utilize the PLAXIS Python API to gather the necessary data from your PLAXIS project output.
  2. Manipulate Data: Process the extracted data in Python as needed.
  3. Export Data to Excel: Write the processed data into an Excel spreadsheet.
  4. Create Charts in Excel: Use Python Excel libraries (such as Openpyxl or xlsxwriter) to create charts in Excel, allowing for customized series names and axis titles.
  5. Integrate with PLAXIS Output App (Optional): Integrate this automation into the PLAXIS Output app workflow so that it triggers or accompanies PLAXIS results exporting.

Customizing Plots in Excel with Python

In this tutorial, we will create a new function called to compare results at different phases using plots in Excel with Openpyxl. This function will be used to extract the bending moment for 'Plate_1' from three specific phases: 'Installation of strut [Phase_3]', 'Second (submerged) excavation stage [Phase_4]', and 'Third excavation stage [Phase_5]'. The script will then create a plot using the first two columns (i.e. 'Y' and 'Bending Moment [kNm/m]_Installation of strut') and loop through the rest of the columns to add them as two extra series to the existing plot.

The script defines a file location: . You can choose any name for the script file.

Overcoming Challenges

While direct PLAXIS Output App documentation on this exact use case may not be found, this approach aligns with best practices for engineering software automation with Python combined with Excel manipulation tools. You may need to install and import suitable Python libraries, access PLAXIS results via the PLAXIS Python API, and then programmatically create Excel charts with your desired customizations.

Potential Improvements

There are three areas of improvement for data visualization in PLAXIS:

  1. Combining all data into one worksheet for plotting.
  2. Automating the process of selecting data series in Excel when creating plots.
  3. Creating plots with customized series names and axis titles.

By following these steps, you can automate the creation of plots in Excel with customized series names and axis titles using Python in combination with the PLAXIS Output app.

  1. In addition to automating the creation of plots in Excel, you might find it beneficial to explore data visualization in other areas of your lifestyle, such as home-and-garden projects or sustainable-living ventures, using technology like data-and-cloud-computing tools to analyze and present your data in a more digestible format.
  2. To expand upon your engineering skills, consider applying the principles learned from this tutorial to other areas of technology, such as developing home automation systems or creating applications for energy monitoring in a sustainable living environment.

Read also:

    Latest