Skip to content
Prev 2073 / 15274 Next

plot.zoo axis labels/ticks

Markus,

I can't necessarily help with the zoo example, but...

The quantmod package has a charting facility that does what I think you want.

Generally speaking you can pass any zoo object into chartSeries() and
it will draw an OHLC style chart (if it has OHLC qualities/columns),
or a line-chart if it is a univariate object.

The labeling is handled inside the main chartSeries call by a local
function called ticks().  Basically uses some formatting functions
inside of quantmod and xts to find a suitable looking set of tickmarks
- both major (with labels) and minor (lighter color and _no_ labels).
The labels even get formatted based on the underlying periodicity of
the data, as well as the level of detail (intraday will work, as will
yearly...).

chartSeries itself may do all you need.  If not feel free to take the
ticks code and the associated xts/quantmod functions and copy to your
own solution.

If you need more assistance, I can probably elaborate here, or email
me directly.

Jeff
On Feb 1, 2008 7:03 PM, Markus Loecher <markus at insightfromdata.com> wrote: