Git Product home page Git Product logo

circlize_book's Introduction

circlize_book's People

Contributors

jokergoo avatar kant avatar tayaza avatar tlaus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

circlize_book's Issues

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

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

Repeated calculation

Thanks for your wonderful book, I got two questions here,

In 14.4 Put horizontally or vertically symmetric

Q1.
I was wondering if the following codes are calculating the same thing?

row_sum = sum(rowSums(abs(mat)))
col_sum = sum(colSums(abs(mat)))

They both calculate the total sum of the matrix?

Q2.
row_sector_degree = (360 - small_gap*(n_sector - 2) - big_gap*2) * (row_sum/(row_sum + col_sum)) + small_gap*(nr-1)

Since the situation in above Q1, so row_sum/(row_sum + col_sum) is actually 0.5, which makes sense since it's symmetric.

My question is small_gap*(n_sector - 2)(degree that small gaps take) big_gap*2 (degree that big gaps take) plus the row_sector_degree already take up all 360. (In your example, n_sector is 9, which means there are in total 9 intervals between sectors, plus the intervals' own degree, they should take up the whole circle.) So, I wonder what's this small_gap*(nr-1) for ?

Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.