Apr-02-2024, 08:49 AM
Using matplotlib or another graphing library -
Let's say you have a dataframe with cols Time, A, and B.
Time is just seconds - let's say 1-60. This will be our x axis.
A is a series of numbers from -100 to +100, and B is a series of numbers from 285-295. A and B are both going to be on Y axis. The two lines are A vs Time and B vs time.
Lets say we make the graph 10 units high.
Now I know that I can just go ahead and plot two lines on a single graph. However, the data that I want to visualize are the slopes of the lines relative to each other for the same time period. If one line is down in the -100 to 100 range, and the other is up at 285-295... well it's just harder to look at.
So what I want to do is to have two independent y-ranges on the graph - one from -100 to 100 and the other from 285 to 295 superimposed on top of each other - so if my graph is 10 units tall, the vertical center, at unit 5, will be at value 0 for graph A and at value 290 for graph B - hence they are superimposed on each other. The scaling between the two y-series will be different, but since I'm interested in visually comparing the slopes of the lines, the scaling is irrelevant as the slopes will remain the same.
So is it possible to graph this type of superimposition? If so then how do you do it?
Let's say you have a dataframe with cols Time, A, and B.
Time is just seconds - let's say 1-60. This will be our x axis.
A is a series of numbers from -100 to +100, and B is a series of numbers from 285-295. A and B are both going to be on Y axis. The two lines are A vs Time and B vs time.
Lets say we make the graph 10 units high.
Now I know that I can just go ahead and plot two lines on a single graph. However, the data that I want to visualize are the slopes of the lines relative to each other for the same time period. If one line is down in the -100 to 100 range, and the other is up at 285-295... well it's just harder to look at.
So what I want to do is to have two independent y-ranges on the graph - one from -100 to 100 and the other from 285 to 295 superimposed on top of each other - so if my graph is 10 units tall, the vertical center, at unit 5, will be at value 0 for graph A and at value 290 for graph B - hence they are superimposed on each other. The scaling between the two y-series will be different, but since I'm interested in visually comparing the slopes of the lines, the scaling is irrelevant as the slopes will remain the same.
So is it possible to graph this type of superimposition? If so then how do you do it?