-
-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ENH: recession_bands now supports subplots
- Loading branch information
Showing
4 changed files
with
121 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
""" | ||
trace_map(p::Plot, axis::Symbol=:x) | ||
Return an array of `length(p.data)` that maps each element of `p.data` into an | ||
integer for which number axis of kind `axis` that trace belogs to. `axis` can | ||
either be `x` or `y`. If `x` is given, return the integer for which x-axis the | ||
trace belongs to. Similar for `y`. | ||
""" | ||
function trace_map(p::Plot, axis=:x) | ||
out = fill(1, length(p.data)) | ||
ax_key = axis == :x ? :xaxis : :yaxis | ||
for (i, t) in enumerate(p.data) | ||
if haskey(t, ax_key) | ||
out[i] = parse(Int, t[ax_key][2:end]) | ||
end | ||
end | ||
out | ||
end | ||
|
||
trace_map(p::SyncPlot, axis=:x) = trace_map(p.plot, axis) |