Matplotlib - Ishikawa Diagram



An Ishikawa diagram, also known as a fishbone diagram or cause-and-effect diagram, is a visual representation used to identify and analyze the possible causes of a specific problem or effect. The diagram looks like a fish skeleton, with the "head" representing the problem or effect, and the "bones" (branches extending from it) representing different categories of potential causes.

Imagine you work in a restaurant and customer complaints about long waiting times have increased. You can use an Ishikawa diagram to identify possible causes. The fishbone structure might include categories like "Processes," "Staff," "Equipment," and "Management." By visually mapping these factors, you can systematically analyze and address the root causes of the prolonged waiting times, leading to more improved service −

Ishikawa Diagram

Ishikawa Diagram in Matplotlib

We can create an Ishikawa diagram in Matplotlib using a bar plot to represent the main categories (bones) and subcategories within each category. Each subcategory may contain potential causes contributing to the observed problem or effect. This diagram helps us to understand the root causes of issues in a structured way.

Now, let us learn and implement various categories and subcategories of the Ishikawa Diagram using Matplotlib.

Ishikawa Diagram - Software Development Issues

The Ishikawa diagram titled "Software Development Issues" in matplotlib is a visualization used to identify and categorize potential causes of problems within the domain of software development.

Example

In the following example, we are creating an Ishikawa diagram to represent potential causes of issues in software development. The diagram categorizes causes into People, Process, Product, and Technology. Subcategories within each category help identify specific factors that impact software development −

import matplotlib.pyplot as plt

# Defining categories and subcategories for software development issues
categories = ['People', 'Process', 'Product', 'Technology']
subcategories = {
    'People': ['Skills', 'Team Dynamics', 'Communication'],
    'Process': ['Requirements', 'Planning', 'Testing'],
    'Product': ['Functionality', 'Usability', 'Performance'],
    'Technology': ['Tools', 'Frameworks', 'Integration']
}

# Creating a Matplotlib figure and axis
fig, ax = plt.subplots(figsize=(10, 6))

# Plotting Ishikawa diagram for software development issues
for i, category in enumerate(categories):
    ax.barh(category, 1, color='white', edgecolor='black')
    for j, subcategory in enumerate(subcategories[category]):
        ax.plot([0, 1], [i + (j + 1) / (len(subcategories[category]) + 1)] * 2, color='black')

# Customizing plot appearance and displaying it
ax.set_xlim(0, 1)
ax.set_yticks(range(len(categories)))
ax.set_yticklabels(categories)
ax.set_title('Ishikawa Diagram - Software Development Issues')
ax.grid(axis='x', linestyle='--', alpha=0.7)
plt.show()

Output

After executing the above code, we get the following output −

Software Development Issues

Ishikawa Diagram - Manufacturing Defects

The Ishikawa Diagram titled "Manufacturing Defects" in Matplotlib is like a visual map that helps us understand why defects might happen during the manufacturing process.

Example

In here, causes of manufacturing defects are categorized into Materials, Machines, Methods, Manpower, and Measurement. Each category breaks down into subcategories, allowing a detailed analysis of potential issues contributing to defects in the manufacturing process.

For instance, It checks if materials are good quality, machines are well-maintained, methods are followed correctly, workers are skilled and not overloaded, and measurements are accurate −

import matplotlib.pyplot as plt

# Defining categories and subcategories for manufacturing defects
categories = ['Materials', 'Machines', 'Methods', 'Manpower', 'Measurement']
subcategories = {
    'Materials': ['Quality', 'Compatibility', 'Availability'],
    'Machines': ['Equipment', 'Maintenance', 'Calibration'],
    'Methods': ['Procedures', 'Standards', 'Workflows'],
    'Manpower': ['Skills', 'Training', 'Workload'],
    'Measurement': ['Tools', 'Accuracy', 'Frequency']
}

# Creating a Matplotlib figure and axis
fig, ax = plt.subplots(figsize=(10, 6))

# Plotting Ishikawa diagram for manufacturing defects
for i, category in enumerate(categories):
    ax.barh(category, 1, color='white', edgecolor='black')
    for j, subcategory in enumerate(subcategories[category]):
        ax.plot([0, 1], [i + (j + 1) / (len(subcategories[category]) + 1)] * 2, color='black')

# Customizing plot appearance and show it
ax.set_xlim(0, 1)
ax.set_yticks(range(len(categories)))
ax.set_yticklabels(categories)
ax.set_title('Ishikawa Diagram - Manufacturing Defects')
ax.grid(axis='x', linestyle='--', alpha=0.7)
plt.show()

Output

Following is the output of the above code −

Manufacturing Defects

Ishikawa Diagram - Project Management Challenges

The "Project Management Challenges" Ishikawa Diagram in Matplotlib acts like a visual map to understand the potential challenges faced in project management. It is organized like a fish skeleton, with different categories such as People, Process, Tools, and Communication. Under each category, it explores specific factors such as team dynamics, planning, software tools, and communication methods.

Example

Now, we are creating the Ishikawa diagram for project management challenges, with categories and subcategories providing a structured way to analyze and address the identified challenges −

import matplotlib.pyplot as plt

# Defining categories and subcategories for project management challenges
categories = ['People', 'Process', 'Tools', 'Communication']
subcategories = {
    'People': ['Skills', 'Team Dynamics', 'Leadership'],
    'Process': ['Planning', 'Execution', 'Monitoring'],
    'Tools': ['Software', 'Hardware', 'Productivity Apps'],
    'Communication': ['Internal', 'External', 'Documentation']
}

# Creating a Matplotlib figure and axis
fig, ax = plt.subplots(figsize=(10, 6))

# Plotting Ishikawa diagram for project management challenges
for i, category in enumerate(categories):
    ax.barh(category, 1, color='white', edgecolor='black')
    for j, subcategory in enumerate(subcategories[category]):
        ax.plot([0, 1], [i + (j + 1) / (len(subcategories[category]) + 1)] * 2, color='black')

# Customizing plot appearance and show it
ax.set_xlim(0, 1)
ax.set_yticks(range(len(categories)))
ax.set_yticklabels(categories)
ax.set_title('Ishikawa Diagram - Project Management Challenges')
ax.grid(axis='x', linestyle='--', alpha=0.7)
plt.show()

Output

Output of the above code is as follows −

Project Management Challenges

Ishikawa Diagram - Customer Service Issues

The "Customer Service Issues" Ishikawa Diagram in Matplotlib is a visual map to understand and tackle potential challenges in customer service. Resembling a fishbone, it categorizes issues into key areas: People, Process, Policies, and Technology. Within these categories, it searches specific factors like training, response time, policies, and technology usage.

Example

In the example below, we are creating the Ishikawa diagram for customer service issues as discussed above −

import matplotlib.pyplot as plt

# Definng categories and subcategories for customer service issues
categories = ['People', 'Process', 'Policies', 'Technology']
subcategories = {
    'People': ['Training', 'Customer Interaction', 'Communication'],
    'Process': ['Response Time', 'Issue Resolution', 'Feedback Handling'],
    'Policies': ['Return Policies', 'Refund Procedures', 'Complaint Handling'],
    'Technology': ['Software', 'Hardware', 'Communication Channels']
}

# Creating a Matplotlib figure and axis
fig, ax = plt.subplots(figsize=(10, 6))

# Plotting Ishikawa diagram for customer service issues
for i, category in enumerate(categories):
    ax.barh(category, 1, color='white', edgecolor='black')
    for j, subcategory in enumerate(subcategories[category]):
        ax.plot([0, 1], [i + (j + 1) / (len(subcategories[category]) + 1)] * 2, color='black')

# Customizing plot appearance and show it
ax.set_xlim(0, 1)
ax.set_yticks(range(len(categories)))
ax.set_yticklabels(categories)
ax.set_title('Ishikawa Diagram - Customer Service Issues')
ax.grid(axis='x', linestyle='--', alpha=0.7)
plt.show()

Output

The output obtained is as shown below −

Customer Service Issues
Advertisements