Skip to content
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

invalid ylim when plotting an xts object of 0s #164

Closed
rossb34 opened this issue Jan 25, 2017 · 1 comment
Closed

invalid ylim when plotting an xts object of 0s #164

rossb34 opened this issue Jan 25, 2017 · 1 comment
Assignees

Comments

@rossb34
Copy link
Collaborator

rossb34 commented Jan 25, 2017

Reproducible example

plot(.xts(1:50, 1:50))
lines(.xts(rep(0,50), 1:50), on = NA)

We should check for this case and set the ylim to a reasonable value such as c(-1,1). We already do this in plot.xts so we should do it in addSeries as well.

@rossb34 rossb34 self-assigned this Jan 25, 2017
rossb34 pushed a commit that referenced this issue Jan 25, 2017
- calling lines, points, or more generally addSeries with an xts
  object of all 0s results in an invalid ylim of (0,0)
- this adds a check for a ylim of (0,0) and if true sets the ylim
  to c(-1,1)
- see #164
@joshuaulrich
Copy link
Owner

Closing, since the referenced commit fixed this issue.

joshuaulrich added a commit that referenced this issue Dec 19, 2017
Commit 8ab0ad3 addressed this for
addSeries(), but addPolygon() has the same code branching.

Incorporate this patch into addPolygon().

See #164.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants