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

added basic plot recipe #303

Merged
merged 3 commits into from Feb 13, 2017

Conversation

Projects
None yet
5 participants
@mkborregaard
Contributor

mkborregaard commented Feb 9, 2017

This adds basic plotting functionality to TimeArray objects, with a very light dependency (RecipesBase a single macro). It allows plotting as simply as plot(ohlc).
Discussed here JuliaPlots/StatPlots.jl#37 (comment) and here #302 .

The current recipe will plot all values in the array, which may not make sense if they are not on the same scale, but you can always plot(ohlcv["Volume"]).

@recipe function f{T<:TimeArray}(ta::T)
labels --> reshape(ta.colnames,1,length(ta.colnames))
seriestype --> :path
ta.timestamp, ta.values

This comment has been minimized.

@ararslan

ararslan Feb 9, 2017

Member

Please use 4 space indents for consistency with the rest of the repository

@coveralls

This comment has been minimized.

coveralls commented Feb 9, 2017

Coverage Status

Coverage decreased (-0.8%) to 96.275% when pulling d732cc6 on mkborregaard:recipe-for-time-arrays into 7928b8f on JuliaStats:master.

@milktrader milktrader merged commit 4720863 into JuliaStats:master Feb 13, 2017

1 of 2 checks passed

coverage/coveralls Coverage decreased (-0.8%) to 96.275%
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@milktrader

This comment has been minimized.

Contributor

milktrader commented Feb 13, 2017

Coverage will be fine maybe increase with some tests

@mkborregaard mkborregaard deleted the mkborregaard:recipe-for-time-arrays branch Feb 13, 2017

@mkborregaard

This comment has been minimized.

Contributor

mkborregaard commented Feb 13, 2017

Do you need me to write a line for the docs (in which case where?) or will you leave this implicit?

@milktrader

This comment has been minimized.

Contributor

milktrader commented Feb 14, 2017

If you can think of a reasonable test it would be great. But if it doesn't do anything but move the coverage then no.

@dourouc05

This comment has been minimized.

Contributor

dourouc05 commented Feb 14, 2017

@mkborregaard: As a user, I'd appreciate a bit of doc about this (at least, say that it exists, maybe briefly how to make a basic plot — i.e. using Plots and plot(time series) — and a link to Plots).

@mkborregaard

This comment has been minimized.

Contributor

mkborregaard commented Feb 14, 2017

Sure - where in the docs should it go?

@dourouc05

This comment has been minimized.

Contributor

dourouc05 commented Feb 14, 2017

In getting started? Customize how TimeArray is displayed could also be interesting, but I don't feel at ease with the idea of putting plots there.

@milktrader

This comment has been minimized.

Contributor

milktrader commented Feb 14, 2017

I was planning a new section called simply Plotting

@milktrader

This comment has been minimized.

Contributor

milktrader commented Feb 14, 2017

If you want to start a file called plotting.rst I can make the links. I would copy an existing .rst file for the format template.

@mkborregaard

This comment has been minimized.

Contributor

mkborregaard commented Feb 14, 2017

No probs. It will be a little while cause I'm going on holiday now.

@mkborregaard mkborregaard restored the mkborregaard:recipe-for-time-arrays branch Feb 20, 2017

@mkborregaard

This comment has been minimized.

Contributor

mkborregaard commented Feb 21, 2017

Here you are #305
I have started it up, can you take it from here?

@mkborregaard mkborregaard deleted the mkborregaard:recipe-for-time-arrays branch Feb 21, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment