I want to plot the difference between two variables, i.e. y = A - B. I expect that in some regions of the x-axis one variable will be orders of magnitude higher than the other, and in other regions it'll be the other way round. So in some regions of the x-axis the difference will be massively positive and in others it will be massively negative. Normally when there is such a huge range, a log scale is appropriate... but I don't know if that is possible since negatives are involved. I can visualize what I want (the y-axis would be like: -1000, -100, -10, -1, 0, 1, 10, 100, 1000, etc.) but I don't know how to make this happen in code or in Google Sheets or whatever. Any advice? Is there a name for this sort of thing and I just don't know what it is?
Asked
Active
Viewed 31 times
0
-
1you are probably looking for a log scale – lmaosome Jan 21 '21 at 15:06
-
1Bit more subtle than that. a) you can't get a $0$ on a log scale, and b) you can't do negatives either. – Prime Mover Jan 21 '21 at 15:08
-
1Why would you stop the powers of $10$ at $1$? What do you know about the scale of the data? You could take the absolute value, use a regular log scale, and plot the points of different signs in different colors. You could make a separate graph for the sign. Alternately, you can divide everything by the largest value and use a linear scale. If the points have values of $\pm 1,000,000$, does the difference between $1$ and $10$ matter? – Ross Millikan Jan 21 '21 at 15:08
-
Thanks Ross, that's a good suggestion. I bet I can figure out how to color different parts of a graph differently. I think I'll go with this unless someone comes up with something better. (Alas, the difference between 1 and 10 does matter for my purposes, but the difference between 0 and 1 doesn't.) – Daniel Kokotajlo Jan 21 '21 at 15:19