Skip to content

polar.plot() behaves differently between versions 3.8-4 and 3.8-13 #19

Description

@MikeSilberbauer

polar.plot - I don't have enough knowledge about what is going on in the background to suggest what is causing this

# 2026-02-13 simplified example to illustrate plotrix polar.plot error message after change from plotrix version 3.8-4 to plotrix 3.8-13

# libraries used
library(plotrix)
library(viridis)
library(colorspace)
library(svglite)
library(openxlsx2)

rad_0 <- 0.5
rad_1 <- 1

results <- c(1, 2, 0.1, 4)
degrees <- c(20, 30, 40, 50)
colours <- c("red", "green", "blue", "orange")

polar.plot(rescale(results, newrange = c(rad_0, rad_1)), polar.pos = degrees, clockwise = TRUE,
           labels="", rp.type="", radial.labels = "", show.radial.grid = TRUE, rad.col = colours,
           grid.col = "grey", mar =c (4,4,4,4), title = "plotrix 3.8-4")

# plotrix 3.8-4
# runs and produces circular grid with four coloured radial lines

# plotrix 3.8-13:
# runs and produces circular grid only, then stops on error
# Error in segments(0, 0, xpos, ypos, col = rad.col) : 
#   cannot mix zero-length and non-zero-length coordinates

# after removal of **labels=""**  polar.plot runs but produces a different output from above
polar.plot(rescale(results, newrange = c(rad_0, rad_1)), polar.pos = degrees, clockwise = TRUE,
           rp.type="", radial.labels = "", show.radial.grid = TRUE, rad.col = colours,
           grid.col = "grey", mar =c (4,4,4,4), title = "plotrix 3.8-4")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions