Home > Net >  Drawing four quadrants plot a scatter plot using matplotlib
Drawing four quadrants plot a scatter plot using matplotlib

Time:01-31

I wish to plot a 2D scatter plot with values in the range [-0.5, 0.5] and [-0.5,0.5] for x and y coordinates respectively

fig1 = plt.figure(figsize=[7,7])
axes1 = fig1.add_axes([1,1,1,1])
axes1.set_xlabel("xlabel")
axes1.set_ylabel("ylabel")
axes1.set_title("Emotions Quadrants")
axes1.spines['left'].set_position(('axes', 0.5))
axes1.spines['bottom'].set_position(('axes', 0.5))
axes1.scatter(x_vals, y_vals, label="test")

above code scales and x and y coordinates according to to the data. I wish to show x and y coordinates from -0.5 to 0.5 equally spaced for both the axes and then plot the scatter graph

enter image description here

  •  Tags:  
  • Related