Message Boards Message Boards

0
|
12070 Views
|
8 Replies
|
9 Total Likes
View groups...
Share
Share this post:
GROUPS:

Is it possible to combine two graphs into one?

Posted 9 years ago

I'd like to produce a graph comparing South African gdp per capita with the ZAR/USD exchange rate on a single graph. Is this possible, and if so, how would I do it? Or do I have to go back to R?

I have tried variations of: south africa gdp, ZAR USD exchange rate

POSTED BY: Evan Dembskey
8 Replies
Posted 9 years ago

Thanks - I really need to get a full copy of Mathematica!

POSTED BY: Evan Dembskey

Though @Sean Clarke has a good point, I would like to add, that it is sometimes used in a legitimate way, just to align two datasets, not to compare them, or to compare trends. See the figure below, which I made and published. The difference between the blue data and the black lines is given as a percentage with the green dots, on a separate scale.

enter image description here

This time I did not make the right part of the frame green (they probably won't like that at the journal), but used an arrow to indicate that you should look at the right axis.

POSTED BY: Sander Huisman
Posted 9 years ago

This is exactly the sort of thing I am looking for. Did you do this in Mathematica? I've figured out a rough and ugly way to do it in R and Julia, but I do like Alpha's look & feel a lot.

POSTED BY: Evan Dembskey

Hi Evan,

I just put custom FrameTicks on it:

rticks=Table[{10i,i},{i,1,2}]
ListPlot[Range[5]^2,Frame->True,FrameTicks->{{Automatic,rticks},{Automatic,Automatic}}]

this is a minimal example:

enter image description here

Of course you have two tweak it to fit your needs.

POSTED BY: Sander Huisman
Posted 9 years ago

Fair enough, thanks.

POSTED BY: Evan Dembskey

These kinds of graphs, time series with two different y axis values, are notoriously deceptive (example https://twitter.com/BrendanNyhan/status/649026039906238464 ). A fair number of people believe these charts just shouldn't exist, so there's some hesitation to make a package for this.

No, I don't believe you can make these with Wolfram|Alpha. You would use Mathematica or Mathematica online instead.

You can see some examples of how this is done here: http://mathematica.stackexchange.com/questions/627/1-plot-2-scale-axis

POSTED BY: Sean Clarke
POSTED BY: Marco Thiel
Posted 9 years ago
POSTED BY: David Keith
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