Skip to content

addToolTips keeps running #3

@johnnyzhz

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 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")

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