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

addToolTips keeps running #3

Open
johnnyzhz opened this issue Mar 18, 2015 · 0 comments
Open

addToolTips keeps running #3

johnnyzhz opened this issue Mar 18, 2015 · 0 comments

Comments

@johnnyzhz
Copy link

I am trying to add annotation to the points in a plot. But the code kept running forever. I'd appreciate if anyone can provide some insight on this. Thanks.

Eventually, I got this error:

Error in as(file[[1]], "XMLInternalDocument") : 
  no method or default for coercingXMLNodeSettoXMLInternalDocument
subcount<-sample(1:50,100,replace=T)
avgcount<-mean(subcount)
doc = svgPlot({
        plot(1:100, subcount, ylab='count', main="Daily analysis in the past 100 days")
     }
     )

ptz = getPlotPoints(doc)

tips = paste("Count: ", subcount)
addToolTips(ptz, tips, addArea = TRUE)

saveXML(doc, "test.svg")

The following code ran well.

subcount<-sample(1:50,100,replace=T)
avgcount<-mean(subcount)
doc = svgPlot({
        plot(1:100, subcount, ylab='count', main="Daily analysis in the past 100 days", type='h')
        points(1:100, subcount)
        abline(h=avgcount, lwd=2, col='red')
     }
     )

ptz = getPlotPoints(doc)

tips = paste("Count: ", subcount)
addToolTips(ptz, tips, addArea = TRUE)

saveXML(doc, "test.svg")
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

No branches or pull requests

1 participant