So an exemplar format would be:
plt.plot([1],[1],'rs')
In this circumstance the marker would be a red square, however, I'm not sure how to do this with a defined variable (ex: markershape = 's')
So an exemplar format would be:
plt.plot([1],[1],'rs')
In this circumstance the marker would be a red square, however, I'm not sure how to do this with a defined variable (ex: markershape = 's')
Use f-Strings for this and it's pretty simple and easy too.
>>> markershape = 's'
>>> plt.plot(np.arange(10), f'r{markershape}')
In fact you can do it with most of the stuff. Like with color and markershape as well:
>>> color = 'g'
>>> markershape = 'v'
>>> plt.plot(np.arange(10), f'{color}{markershape}')