Skip to content

add ishikawa diagram to examples #26064

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 6, 2023
Merged

add ishikawa diagram to examples #26064

merged 3 commits into from
Jun 6, 2023

Conversation

saranti
Copy link
Contributor

@saranti saranti commented Jun 4, 2023

PR summary

Closes #25222. Adds a fishbone plot to the specialty plots example in the docs. This PR is a continuation of #25248 except the plot is different. It's a simple representation of a fishbone plot which takes the input data as a dictionary of nested lists or tuples. The diagram will scale depending on the number of arguments that are passed to it.

ishikawa

PR checklist

ax.set_xlim(-5, 5)
ax.set_ylim(-5, 5)
ax.axis('off')
COLOR = 'C0'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about using a non-default color to make it clear your doing this so that you use a consistent color through out?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use "tab:blue" to get the same color by a fixed name.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah so my point is use a color that's not the matplotlib default 'cause that's gonna make it crystal clear that the point of this variable is to keep the color in sync (and the blue isn't an artifact of it being the default)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like keeping the default colors in the examples. This makes for a homogeneous visual impression and "brand identity". If there is a dedicated color configuration, its correct usage is implied. We don't have to choose another color just for the purpose of proving that this is properly applied.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be honest, I only made that variable to make it easier to experiment with different colours. I can just as easily remove it since it's only being used in 3 places.

Comment on lines 189 to 197
method = ['Method', ['Time consumption', 'Cost', 'Procedures',
'Inefficient process', 'Sampling']]
machine = ['Machine', ['Faulty equipment', 'Compatibility']]
material = ['Material', ['Poor-quality input', 'Raw materials', 'Supplier',
'Shortage']]
measure = ['Measurement', ['Calibration', 'Performance', 'Wrong measurements']]
env = ['Environment', ['Bad conditions']]
people = ['People', ['Lack of training', 'Managers', 'Labor shortage',
'Procedures', 'Sales strategy']]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a dictionary - is there an advantage to this format?

Copy link
Member

@timhoffm timhoffm Jun 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, you can make this a single dict (problem: list of causes) and pass it to draw_body().

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no advantage to it. I chose lists over a dictionary because @QuLogic disapproved of that format in the old PR.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have not followed the whole topic, but my impression was that the no-dict comment refers to passing all data around through all functions as dict.

A dict as the top-level structure defining the diagram is much more concise:

categories = {
    'Method': ['Time consumption', 'Cost', 'Procedures', 'Inefficient process', 'Sampling'],
    'Machine': ['Faulty equipment', 'Compatibility'],
    'Material': ['Poor-quality input', 'Raw materials', 'Supplier',  'Shortage'],
    'Measurement': ['Calibration', 'Performance', 'Wrong measurements'],
    'Environment': ['Bad conditions'],
    'People': ['Lack of training', 'Managers', 'Labor shortage', 'Procedures', 'Sales strategy'],
}

@timhoffm timhoffm added this to the v3.8.0 milestone Jun 6, 2023
@timhoffm timhoffm merged commit 053e529 into matplotlib:main Jun 6, 2023
@saranti saranti deleted the fishbone branch June 23, 2023 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ENH]: add organizational charts to supported plots
3 participants