I need to dynamically change plot properties based on an input where the user selects the property they want to change and enters the value they want to change it to. I thought I could accomplish this by performing the following:
Selected_Property is a plot parameter (e.g., xscale ect..)
Entered_Value is whatever the user wants to change the value to
import matplotlib.pyplot as plt
x = [1, 2, 3, 4, 5, 6]
y = [1, 10, 100, 1000, 10000, 100000]
plt.plot(x,y)
setattr(plt, Selected_Property, Entered_Value)
plt.show()
However, no matter what I put in setattr, no changes are applied to the plot. I cannot change plot properties using plt.(property to change) because this property is selected dynamically based on the user's input and I do not know how to access plot properties using variables and "." notation. Is there anything I can try to fix this issue?