-
-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple Y Axes sharing the same X Axis? #25
Comments
On Dec 30, 2017, at 13:41, evdubs ***@***.***> wrote:
Hello,
I would like to know if there is a way to have two datasets share an x-axis while using independent y-axes. My use case is to plot stock prices using a price axis and volumes or forward earnings on the same plot
so that they can all be viewed together. Currently, I have the following built where volume rectangles are just drawn on a line near the prices, but the values are obscured this way. I have also tried to look at just having two independent plots, but the x-axis in one does not perfectly align with the other.
Is there a way to do this?
Just to make sure: you’re looking for a way to display two simultaneous sets of axis labels, is that right?
John Clements
|
I noticed that there was a near-y-axis and far-y-axis notion in the documentation. However, this seems limited by just showing something like the decimal 1.0 or a currency $1.0. I want to have these axes scaled differently so that a y-axis shows prices from $50-$70 and the volumes can be shown on a separate, simultaneous y-axis that is, say, scaled from 0 million - 10 million with most of the rectangles at around 1 million (so that it is just in the bottom of the graph). Does this make sense? |
Here is a separate example of what I am trying to achieve. There are two separate data series shown with different y values but they share the same x-axis. Plotting this in racket/plot would instead have the blue line below at 0-11 and the red line way above at 36-52. |
I think you get what you want by setting Here's an example --- let me know if this doesn't make sense. The one really strange thing (IMO) is that the near and far axis need to plot the same number of major ticks.
|
@bennn thanks for the example. It looks like I will still need to try to normalize the data first so that it fits together and then change the ticks to fit the data. I think that will be workable, but of course it would be nice, I think, to just be able to dump the data as it is to racket/plot and have it figure out what the two different axes ticks should be (as in the Age Wave & Inflation chart). |
Perhaps |
Hm. Maybe not. It seems like what you want is to have something like |
Hello, Is it possible to add a 3rd y-axis? The ticks-scale example with the Celcius and Fahrenheit was very helpful and I was able to use it to make a similar plot like the one alex-hhh of the previous post shows, but now my problem requires a third different scaling and I cannot find how to do this with racket/plot. Thank you. |
Hello,
I would like to know if there is a way to have two datasets share an x-axis while using independent y-axes. My use case is to plot stock prices using a price axis and volumes or forward earnings on the same plot
so that they can all be viewed together. Currently, I have the following built where volume rectangles are just drawn on a line near the prices, but the values are obscured this way. I have also tried to look at just having two independent plots, but the x-axis in one does not perfectly align with the other.
Is there a way to do this?
The text was updated successfully, but these errors were encountered: