Versions: 2D 2017.01, 3D 2017
Introduction
The PLAXIS Output program offers the possibility using the command line to configure the plot settings in order to export this plot to a file for post-processing. In this article, different options are explained providing information on the relevant options that are available.
Plot settings
To view the current settings applied to the last plot created in Output, one can use the echo Plots[-1] command:
![1_echo_plot]()
Figure 1. Current settings of Plots[-1] (last plot created)
In the picture above you can identify different options that can be edited with the set command using the syntax below:
Show the rulers in your plot:
- set Plots[-1].DrawRulers True
Hide the axes:
- set Plots[-1].DrawAxes False
Exclude the legend of the plot:
- set Plots[-1].DrawLegend False
![2_plot_settings]()
Figure 2. Current view of the plot in PLAXIS Output
Below are some special items in the properties of a plot object that concern every plot to be exported:
- ResultTypes
- PlotType
- LegendSettings
- MeshSettings
These will be explained in more details below.
ResultTypes
The ResultTypes contain the different results that can be visualised in the plot. This is related to the numerous options available via the menus, e.g. Deformations, Stresses, Forces, etc..
Some examples are provided below:
Set the plot result to Total horizontal displacement ux:
- set Plots[-1].ResultType ResultTypes.Soil.Ux
Set the plot result to Incremental vertical cartesian strains: Δεyy:
- set Plots[-1].ResultType ResultTypes.Soil.dEpsyy
Set the plot results to Active pore pressures:
- set Plots[-1].ResultType ResultTypes.Soil.PActive
![3_pactive]()
Figure 3. Plot set to show the Active pore pressures
PlotType
For every plot you can also switch between the available visualisation options of the results:
Set the plot type to show the Contour lines instead of the Shadings:
- set Plots[-1].PlotType "ContourLines"
Set the plot type to show the Coloured principal directions of a plot. Note that this is relevant to some of the plots, such as the stresses and pore pressure plots:
- set Plots[-1].PlotType "PrincipalDirections"
In any case that a typo is made, the error message contains all allowed values for the command.
![4_principaldirection]()
Figure 4. Coloured principal direction with legend shown
![5_error_message]()
Figure 5. Error message displayed for assistance
LegendSettings
This allows for changing the settings of the legend that is next to the plot. For example:
Change the number of intervals of the legend to 10:
- set Plots[-1].LegendSettings.Intervals 10
Set the minimum value of the legend to -160 in project units:
- set Plots[-1].LegendSettings.MinValue -160
![6_minvalue_legend]()
Figure 6. Minimum value specified for legend
MeshSettings
Various options about the current visualisation of the mesh are stored in the MeshSettings of a plot. For example:
Show the Phreatic level in the plot:
- set Plots[-1].MeshSettings.PhreaticLevel True
Show the Fixities of the model:
- set Plots[-1].MeshSettings.Fixities True
Hide the Cluster contours of the model:
- set Plots[-1].MeshSettings.ClusterContours False
![7_fixities_no_waterlevel]()
Figure 7. Fixities displayed without a phreatic level representation
Export command
After setting up the plot the next step is to use the command line to export the plot to a file
The export command has the following structure:
- export ObservablePlot "full_path/to_the/file.png" 1920 1080
An example is given below:
- export Plots[-1] "C:/Plaxis/Plots/my_plot.png" 1920 1080
This command will export the lastly created plot (Plots[-1]) to the location specified within the quotation marks using the width of 1920 and height of 1080 pixels.
Note that the width and height are optional parameters which can be omitted. If those parameters are not mentioned the program will export the plot using 2880 x 2160 pixels.
![8_exported_plot]()
Figure 8. Exported plot
Comments
- More information on Output commands and objects can be found in our Command reference under the Help menu.
- Not all plot settings are automatically applied to the current plot PLAXIS Output is showing in the plot area
- Some plot settings require the presence of another setting to be applied correctly. For instance, this is the case of showing the results using the PrincipalDirections as a PlotType. For this, the ResultType should be set to a result that includes this visualisation, as the pore pressures or stresses do, for example.
- In case of multiple plots created any changes to the plot settings will be applied to the plot specified. Plots[-1] always refer to the lastly created plot.
- A structural plot is considered a new plot and should be treated as such. In this case, Plot_1 will refer to the soil view (e.g. deformed mesh or deformations plot) and Plot_2 will refer to the structures view of the selected structural element.
Here Plots[-1] refers to the structural plot.
- Not all commands are relevant for both PLAXIS 2D and PLAXIS 3D, e.g. ruler option is only available in PLAXIS 2D.
The post Set and export a plot in PLAXIS Output appeared first on Plaxis.