I have been using the following code in my programs to set the range of an axis so that the graph looks more aesthetically pleasing.
plot.set_ylim([0,a+(a*15/100)])
It is specifically this:
a+(a*15/100)
that i'm interested in.
Is there a function which exists which simplifies this?
The reason being is that when my graph is created in a for loop, and the value of a is the maximum value of a list (and so on) the whole thing starts to look messy. E.g from:
a+(a*15/100)
max(listA[x])+(max(listA[x]))*15/100
Anyone aware of a simplification?
You could use the *= operator
Beware that the *= operator may do different things for different types (i.e. strings and lists).