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

Error in polygon(polar2Cartesian(d2), ...) : plot.new has not been called yet #9

Open
danli349 opened this issue Nov 17, 2023 · 1 comment

Comments

@danli349
Copy link

Hi:
Thanks for the nice package!
When I run the code in chapter 1:

set.seed(999)
n = 1000
df = data.frame(sectors = sample(letters[1:8], n, replace = TRUE),
    x = rnorm(n), y = runif(n))
library(circlize)
circos.par("track.height" = 0.1)
circos.par("points.overflow.warning" = FALSE)
circos.initialize(df$sectors, x = df$x)
circos.track(df$sectors, y = df$y,
    panel.fun = function(x, y) {
        circos.text(CELL_META$xcenter, 
            CELL_META$cell.ylim[2] + mm_y(5), 
            CELL_META$sector.index)
        circos.axis(labels.cex = 0.6)
})

I got this error:

Error in polygon(polar2Cartesian(d2), ...) :
plot.new has not been called yet

How should I fix it? Thanks a lot

@danli349
Copy link
Author

danli349 commented Nov 17, 2023

Hi: Thanks for the nice package! When I run the code in chapter 1:

set.seed(999)
n = 1000
df = data.frame(sectors = sample(letters[1:8], n, replace = TRUE),
    x = rnorm(n), y = runif(n))
library(circlize)
circos.par("track.height" = 0.1)
circos.par("points.overflow.warning" = FALSE)
circos.initialize(df$sectors, x = df$x)
circos.track(df$sectors, y = df$y,
    panel.fun = function(x, y) {
        circos.text(CELL_META$xcenter, 
            CELL_META$cell.ylim[2] + mm_y(5), 
            CELL_META$sector.index)
        circos.axis(labels.cex = 0.6)
})

I got this error:

Error in polygon(polar2Cartesian(d2), ...) :
plot.new has not been called yet

How should I fix it? Thanks a lot

I am sorry, I found I have to run all the code together in the same Chunk in Rmd file. Then there is no error anymore.
Thanks

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