Hi
user
Hello! How can I help you today?
assistant
Could you please make me a python script that allows me to input 3 values, then displays them using matplotlib.
user
This script takes 3 float values as input, adds them to 3 separate lists, then plots them using Matplotlib. The plot displays each value as a line with a label, and adds a legend to identify each line.

<python>
import matplotlib.pyplot as plt

x = []
y = []
z = []

# Take input for 3 values
x.append(float(input("Enter first value: ")))
y.append(float(input("Enter second value: ")))
z.append(float(input("Enter third value: ")))

# Plot the values
fig, ax = plt.subplots()
ax.plot(x, label='First Value')
ax.plot(y, label='Second Value')
ax.plot(z, label='Third Value')

# Add labels and title
ax.set_xlabel('Index')
ax.set_ylabel('Value')
ax.set_title('Values Plot')

# Add legend
ax.legend()

# Show plot
plt.show()
</python>
assistant