Message Boards Message Boards

0
|
474 Views
|
2 Replies
|
1 Total Likes
View groups...
Share
Share this post:

How can I make a DateListPlot column with different Y-Axis?

Posted 3 months ago

Hi everyone!

I’m trying to create a simple graph showing both the prices and the number of houses sold in a city. I want to display both graphs in a column, but they keep sharing the same Y-axis, which doesn’t make sense because one plot range should be {0, 2000} and the other {0, 1000000}.

Here’s my code. I’ve been trying to adjust the PlotRange option, but I haven’t figured out a good solution yet.

DateListPlot[{a, b}, PlotLayout -> "Column"]

Any help would be appreciated!

Thank you,
David

POSTED BY: David Recio
2 Replies
Posted 3 months ago

Thank you for your answer Eric.

In case someone wonders, I finally made it using GraphicsGrid. You can include the DatelistPlots inside and arrange it as you would like to.

POSTED BY: David Recio
Posted 3 months ago

Since your PlotLayout is "Column", you could just have two separate plots and arrange them in a column.

For what it's worth, there is a MultiaxisArrangement option for plots, but it doesn't seem to work with DateListPlot. It does work with ListLinePlot, so you could translate your dates to some other numeric representation and use ListLinePlot. But MultiaxisArrangement doesn't seem to play nice with the PlotLayout -> "Column" option.

POSTED BY: Eric Rimbey
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract