plot positive vs negative in python

To plot positive vs negative numbers in python, you can use Matplotlib library to create a scatter plot.

Here's an example python code to plot positive and negative numbers on a scatter plot:

main.py
import matplotlib.pyplot as plt

# Create some data
x = [-2, 1, 3, -4, -1, 2]
y = [-1, -3, 2, 4, -2, -3]

# Create the scatter plot
plt.scatter(x, y)

# Adding labels to x and y axis
plt.xlabel('Positive vs Negative')
plt.ylabel('Negative vs Positive')

# Display the plot
plt.show()
284 chars
16 lines

This code snippet will create a scatter plot representing the positive and negative numbers. The x-axis represents positive and negative, while the y-axis represents negative and positive.

Positive vs Negative plot

In this plot, negative numbers are shown by green dots, while positive numbers are shown by blue dots.

gistlibby LogSnag