Modified the matplotlib script