How do I get a matplot lib plot to display?

Viewed 38

I'm running all of this via Sublime Text and terminal:

import matplotlib.pyplot as plt
import numpy as np
import pandas as pd

#Functional Plot
x_1 = np.linspace(0,5,10) #10 float from 0 to 5 
y_1 = x_1 ** 2 #Y values are squared x value 

plt.plot(x_1, y_1) #display plot
plt.title('Days Squared') #Add title
plt.xlabel('X label') 
plt.ylabel('Y label') 
plt.show()

In Terminal I get this: zsh: segmentation fault python3 mplintro.py

And then an error message saying python shut down and do I want to restart it??

0 Answers
Related