Skip to content
Prev 180366 / 398503 Next

plotting multiple data sources

It is not recommended to plot variables on different scales on the same graph.  You can use something like par(mfrow=...) (see ?par) to stack graphs on top of each other (or next to each other, or both) for easy comparison, but each with their own scales/axes.

If you have considered all that and still feel the need to put the data in the same graph, look at the updateusr function in the TeachingDemos package as a way to convert the scales/axis range from the original (date) version to that matching your new data.

For the labeling of the axis, you can use the axis command and tell it exactly which ticks and labels to use (you can have it do every other label, then do the skipped ones down 1 line with a second call), or you can rotate the labels (often ugly, be careful) or other things.  There are also some tools in the plotrix package that help with long labels (and probably other packages as well).

Hope this helps,