I have three arrays to use in a scatter plot: x, y, and z. x and y make up the data points, and z is an identifier for labeling. z ranges between 1 and 24.
I want to give my scatter plot different makers based on the z value. If z is less than or equal to 12, marker = '1'. Else, marker = 'o'. Here is a snippet of the code I'm trying to use.
import numpy as np
import matplotlib.pyplot as plt
x = np.arange(1, 13)
if z == x:
scatter = plt.scatter(x, y, c=z, cmap='jet', marker = '1')
else:
scatter = plt.scatter(x, y, c=z, cmap='jet', marker = 'o')
Unfortunately this code gives me a plot with only one marker type, regardless of the value of z for each x-y pair. I've also tried using a for loop to iterate through the z array, but that just gives me errors.