Usually it is clearly defined which variable is the dependent and which is the independent one. In the case of price elasticity, the price is the independent and the quantity is the dependent variable. For the mathematical representation of functions, the notation already suggests the correct allocation. However, for the graphical representation it must be considered that in market diagrams, the price variable is plotted on the y-axis - exactly the opposite way around as usually for graphs of functions. In addition, usually a falling demand curve is considered, so that the elasticity should be negative. However, it has become common practice to reverse the negative sign in the case of demand elasticity and to consider the decrease in demand in the case of a price increase, i.e.
To illustrate this, I have depicted again both elasticities for any function in the graph below.