Skip to content

added basic plot recipe - #303

Merged
milktrader merged 3 commits into
JuliaStats:masterfrom
mkborregaard:recipe-for-time-arrays
Feb 13, 2017
Merged

added basic plot recipe#303
milktrader merged 3 commits into
JuliaStats:masterfrom
mkborregaard:recipe-for-time-arrays

Conversation

@mkborregaard

Copy link
Copy Markdown
Contributor

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 https://github.com/JuliaPlots/StatPlots.jl/issues/37#issuecomment-278708392 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"]).

Comment thread src/plotrecipes.jl Outdated
@recipe function f{T<:TimeArray}(ta::T)
labels --> reshape(ta.colnames,1,length(ta.colnames))
seriestype --> :path
ta.timestamp, ta.values

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@coveralls

Copy link
Copy Markdown

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
@milktrader

Copy link
Copy Markdown
Contributor

Coverage will be fine maybe increase with some tests

@mkborregaard
mkborregaard deleted the recipe-for-time-arrays branch February 13, 2017 22:41
@mkborregaard

Copy link
Copy Markdown
Contributor Author

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

@milktrader

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Contributor

@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

Copy link
Copy Markdown
Contributor Author

Sure - where in the docs should it go?

@dourouc05

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Contributor

I was planning a new section called simply Plotting

@milktrader

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Contributor Author

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

@mkborregaard
mkborregaard restored the recipe-for-time-arrays branch February 20, 2017 08:56
@mkborregaard

Copy link
Copy Markdown
Contributor Author

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

@mkborregaard
mkborregaard deleted the recipe-for-time-arrays branch February 21, 2017 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants