Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprenda Visualizing Material Properties | Materials and Construction Data Analysis
Python for Civil Engineers

bookVisualizing Material Properties

Data visualization is a powerful tool in material testing, especially when you need to understand the distribution of properties such as compressive strength, density, or modulus of elasticity. In civil engineering, visualizing these distributions helps you quickly spot trends, identify anomalies, and make informed decisions about material quality. Two of the most common plots for this purpose are histograms and boxplots. Histograms show how test results are distributed across different value ranges, while boxplots summarize the spread and highlight potential outliers. Both are essential for assessing quality control in construction materials.

123456789101112
import matplotlib.pyplot as plt # Example compressive strength test results (MPa) compressive_strength = [28, 30, 32, 29, 31, 30, 35, 33, 30, 29, 28, 34, 36, 28, 27, 29, 32, 31, 30, 33] plt.figure(figsize=(8, 5)) plt.hist(compressive_strength, bins=6, color='skyblue', edgecolor='black') plt.title('Histogram of Compressive Strength Test Results') plt.xlabel('Compressive Strength (MPa)') plt.ylabel('Frequency') plt.grid(axis='y', linestyle='--', alpha=0.7) plt.show()
copy

When you look at a histogram, you can quickly see the most common test result ranges and whether the data is skewed or evenly spread. However, histograms do not always make it easy to spot outliers or summarize the overall spread. This is where boxplots become valuable. A boxplot displays the median, quartiles, and highlights any values that fall outside the typical range (outliers). By comparing both visualizations, you can better assess the consistency of your material properties and detect any results that may require further investigation. Consistent, tightly grouped results generally indicate good quality control, while outliers or a wide spread might signal issues in the material or testing process.

123456789
import seaborn as sns import matplotlib.pyplot as plt # Reusing the compressive_strength data plt.figure(figsize=(6, 4)) sns.boxplot(data=compressive_strength, color='lightgreen') plt.title('Boxplot of Compressive Strength Test Results') plt.xlabel('Compressive Strength (MPa)') plt.show()
copy

1. What type of plot is best for identifying outliers in material test data?

2. Which library provides a simple function for creating boxplots?

3. Fill in the blank: A ______ plot shows the frequency distribution of data values.

question mark

What type of plot is best for identifying outliers in material test data?

Select the correct answer

question mark

Which library provides a simple function for creating boxplots?

Select the correct answer

question-icon

Fill in the blank: A ______ plot shows the frequency distribution of data values.

plot shows the frequency distribution of data values.
Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 2. Capítulo 2

Pergunte à IA

expand

Pergunte à IA

ChatGPT

Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo

bookVisualizing Material Properties

Deslize para mostrar o menu

Data visualization is a powerful tool in material testing, especially when you need to understand the distribution of properties such as compressive strength, density, or modulus of elasticity. In civil engineering, visualizing these distributions helps you quickly spot trends, identify anomalies, and make informed decisions about material quality. Two of the most common plots for this purpose are histograms and boxplots. Histograms show how test results are distributed across different value ranges, while boxplots summarize the spread and highlight potential outliers. Both are essential for assessing quality control in construction materials.

123456789101112
import matplotlib.pyplot as plt # Example compressive strength test results (MPa) compressive_strength = [28, 30, 32, 29, 31, 30, 35, 33, 30, 29, 28, 34, 36, 28, 27, 29, 32, 31, 30, 33] plt.figure(figsize=(8, 5)) plt.hist(compressive_strength, bins=6, color='skyblue', edgecolor='black') plt.title('Histogram of Compressive Strength Test Results') plt.xlabel('Compressive Strength (MPa)') plt.ylabel('Frequency') plt.grid(axis='y', linestyle='--', alpha=0.7) plt.show()
copy

When you look at a histogram, you can quickly see the most common test result ranges and whether the data is skewed or evenly spread. However, histograms do not always make it easy to spot outliers or summarize the overall spread. This is where boxplots become valuable. A boxplot displays the median, quartiles, and highlights any values that fall outside the typical range (outliers). By comparing both visualizations, you can better assess the consistency of your material properties and detect any results that may require further investigation. Consistent, tightly grouped results generally indicate good quality control, while outliers or a wide spread might signal issues in the material or testing process.

123456789
import seaborn as sns import matplotlib.pyplot as plt # Reusing the compressive_strength data plt.figure(figsize=(6, 4)) sns.boxplot(data=compressive_strength, color='lightgreen') plt.title('Boxplot of Compressive Strength Test Results') plt.xlabel('Compressive Strength (MPa)') plt.show()
copy

1. What type of plot is best for identifying outliers in material test data?

2. Which library provides a simple function for creating boxplots?

3. Fill in the blank: A ______ plot shows the frequency distribution of data values.

question mark

What type of plot is best for identifying outliers in material test data?

Select the correct answer

question mark

Which library provides a simple function for creating boxplots?

Select the correct answer

question-icon

Fill in the blank: A ______ plot shows the frequency distribution of data values.

plot shows the frequency distribution of data values.
Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 2. Capítulo 2
some-alt