Skip to content

addToolTips keeps running #3

Description

@johnnyzhz

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 coercing “XMLNodeSet” to “XMLInternalDocument”
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")

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions