5. Plot Controls

5.1. XML Input File

The basename for this file is intro_5_plotting.xml. The file can be run using this command:

microstructpy --demo=intro_5_plotting.xml

The full text of the file is given below.

<?xml version="1.0" encoding="UTF-8"?>
        <material_type> matrix </material_type>
        <fraction> 2 </fraction>

        <shape> circle </shape>
            <dist_type> uniform </dist_type>
            <loc> 0 </loc>
            <scale> 1.5 </scale>
        <color> pink </color>

        <fraction> 1 </fraction>
        <shape> circle </shape>
        <diameter> 2 </diameter>
        <color> lime </color>

        <shape> square </shape>
        <side_length> 20 </side_length>
        <corner> (0, 0) </corner>

            <seeds_plot> png </seeds_plot>
            <poly_plot> png, pdf </poly_plot>
            <tri_plot> png </tri_plot>
            <tri_plot> eps </tri_plot>
            <tri_plot> pdf </tri_plot>

        <directory> intro_5_plotting </directory>
        <verbose> True </verbose>

            <alpha> 0.5 </alpha>
            <edgecolors> none </edgecolors>

            <linewidth> 3 </linewidth>
            <edgecolors> #A4058F </edgecolors>

            <linewidth> 0.2 </linewidth>
            <edgecolor> navy </edgecolor>

        <plot_axes> False </plot_axes>

5.2. Materials

There are two materials, in a 2:1 ratio based on volume. The first is a pink matrix, which is represented with small circles.

The second material consists of lime green circular inclusions with diameter 2.

5.3. Domain Geometry

These two materials fill a square domain. The bottom-left corner of the rectangle is the origin, which puts the rectangle in the first quadrant. The side length is 20, which is 10x the size of the inclusions.

5.4. Settings

PNG files of each step in the process will be output, as well as the intermediate text files. They are saved in a folder named intro_5_plotting, in the current directory (i.e ./intro_5_plotting). PDF files of the poly and tri mesh are also generated, plus an EPS file for the tri mesh.

The seeds are plotted with transparency to show the overlap between them. The poly mesh is plotted with thick purple edges and the tri mesh is plotted with thin navy edges.

In all of the plots, the axes are toggles off, creating image files with minimal borders.

5.5. Output Files

The three plots that this file generates are the seeding, the polygon mesh, and the triangular mesh. These three plots are shown in Fig. 5.1 - Fig. 5.3.

Seed geometries.

Fig. 5.1 Introduction 5 - seed geometries.

Polygonal mesh.

Fig. 5.2 Introduction 5 - polygonal mesh.

Triangular mesh.

Fig. 5.3 Introduction 5 - triangular mesh.