Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8408371
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T23:36:50+00:00 2026-06-09T23:36:50+00:00

I created a radar chart using the function of radarchart from the fmsb package

  • 0

I created a radar chart using the function of “radarchart” from the “fmsb” package in R software.

The matrix I am using is as follows:

x<-c(c(rep(4.5,7),c(rep(0,7)), 3.34, 3.28, 1.37, 1.12, 3.52, 4.07, 3.66));
a<-as.data.frame(matrix(x,nrow=3, ncol=7,byrow=T))
radarchart(a,axistype=4,seg=3,cglty=3,pty=32,cglcol=1,plwd=3,pcol=1,axislabcol=1)

I would like to show the range of c(0,5) on the axis instead of c(0,100) or c(0,1).
I really appreciate it if any body can guide me.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T23:36:52+00:00Added an answer on June 9, 2026 at 11:36 pm

    By using a rather quick tweak, radarchart now has an additional argument which allows you to manually specify the numbers on the axes:

    require(fmsb)
    x = c(rep(4.5,7),rep(0,7), 
          3.34, 3.28, 1.37, 1.12, 3.52, 4.07, 3.66)
    a = as.data.frame(matrix(x,nrow=3, ncol=7,byrow=T))
    radarchart(a, axistype = 4, seg = 3, cglty = 3, 
               pty = 32, cglcol = 1, plwd = 3, pcol = 1, axislabcol = 1,
               labels = seq(from = min(x), to = max(x), length = 4))
    

    enter image description here

    The updated source code, my additions are marked by comments:

    radarchart = function (df, axistype = 0, seg = 4, pty = 16, pcol = 1:8, plty = 1:6, 
              plwd = 1, cglty = 3, cglwd = 1, cglcol = "navy", axislabcol = "blue", 
              title = "", maxmin = TRUE, na.itp = TRUE, labels = NULL, ...) 
    {
      if (!is.data.frame(df)) {
        cat("The data must be given as dataframe.\n")
        return()
      }
      if ((n <- length(df)) < 3) 
        return()
      if (maxmin == FALSE) {
        dfmax <- apply(df, 2, max)
        dfmin <- apply(df, 2, min)
        df <- rbind(dfmax, dfmin, df)
      }
      plot(c(-1.2, 1.2), c(-1.2, 1.2), type = "n", frame.plot = FALSE, 
           axes = FALSE, xlab = "", ylab = "", main = title, asp = 1, 
           ...)
      theta <- seq(90, 450, length = n + 1) * pi/180
      theta <- theta[1:n]
      xx <- cos(theta)
      yy <- sin(theta)
      for (i in 0:seg) {
        polygon(xx * (i + 1)/(seg + 1), yy * (i + 1)/(seg + 1), 
                lty = cglty, lwd = cglwd, border = cglcol)
        if (axistype == 1 | axistype == 3) 
         ## Changes by me  
         if(is.null(labels)) labels = paste(i/seg * 100, 
                                             "(%)")
          text(-0.05, (i + 1)/(seg + 1), labels[i+1], col = axislabcol)
        if (axistype == 4 | axistype == 5) 
          ## Changes by me
          if(is.null(labels)) labels = sprintf("%3.2f", i/seg)
          text(-0.05, (i + 1)/(seg + 1), labels[i+1], 
               col = axislabcol)
      }
      arrows(xx/(seg + 1), yy/(seg + 1), xx * 1, yy * 1, lwd = cglwd, 
             lty = cglty, length = 0, col = cglcol)
      if (axistype == 2 | axistype == 3 | axistype == 5) {
        text(xx[1:n], yy[1:n], df[1, 1:n], col = axislabcol)
      }
      text(xx * 1.2, yy * 1.2, colnames(df))
      series <- length(df[[1]])
      if (length(pty) < (series - 2)) {
        ptys <- rep(pty, series - 2)
        pcols <- rep(pcol, series - 2)
        pltys <- rep(plty, series - 2)
        plwds <- rep(plwd, series - 2)
      }
      else {
        ptys <- pty
        pcols <- pcol
        pltys <- plty
        plwds <- plwd
      }
      for (i in 3:series) {
        xxs <- xx
        yys <- yy
        scale <- 1/(seg + 1) + (df[i, ] - df[2, ])/(df[1, ] - 
          df[2, ]) * seg/(seg + 1)
        if (sum(!is.na(df[i, ])) < 3) {
          cat(sprintf("[DATA NOT ENOUGH] at %d\n%g\n", i, df[i, 
                                                             ]))
        }
        else {
          for (j in 1:n) {
            if (is.na(df[i, j])) {
              if (na.itp) {
                left <- ifelse(j > 1, j - 1, n)
                while (is.na(df[i, left])) {
                  left <- ifelse(left > 1, left - 1, n)
                }
                right <- ifelse(j < n, j + 1, 1)
                while (is.na(df[i, right])) {
                  right <- ifelse(right < n, right + 1, 1)
                }
                xxleft <- xx[left] * (1/(seg + 1) + (df[i, 
                                                        left] - df[2, left])/(df[1, left] - df[2, 
                                                                                               left]) * seg/(seg + 1))
                yyleft <- yy[left] * (1/(seg + 1) + (df[i, 
                                                        left] - df[2, left])/(df[1, left] - df[2, 
                                                                                               left]) * seg/(seg + 1))
                xxright <- xx[right] * (1/(seg + 1) + (df[i, 
                                                          right] - df[2, right])/(df[1, right] - 
                                                            df[2, right]) * seg/(seg + 1))
                yyright <- yy[right] * (1/(seg + 1) + (df[i, 
                                                          right] - df[2, right])/(df[1, right] - 
                                                            df[2, right]) * seg/(seg + 1))
                if (xxleft > xxright) {
                  xxtmp <- xxleft
                  yytmp <- yyleft
                  xxleft <- xxright
                  yyleft <- yyright
                  xxright <- xxtmp
                  yyright <- yytmp
                }
                xxs[j] <- xx[j] * (yyleft * xxright - yyright * 
                  xxleft)/(yy[j] * (xxright - xxleft) - xx[j] * 
                  (yyright - yyleft))
                yys[j] <- (yy[j]/xx[j]) * xxs[j]
              }
              else {
                xxs[j] <- 0
                yys[j] <- 0
              }
            }
            else {
              xxs[j] <- xx[j] * (1/(seg + 1) + (df[i, j] - 
                df[2, j])/(df[1, j] - df[2, j]) * seg/(seg + 
                1))
              yys[j] <- yy[j] * (1/(seg + 1) + (df[i, j] - 
                df[2, j])/(df[1, j] - df[2, j]) * seg/(seg + 
                1))
            }
          }
          polygon(xxs, yys, lty = pltys[i - 2], lwd = plwds[i - 
            2], border = pcols[i - 2])
          points(xx * scale, yy * scale, pch = ptys[i - 2], 
                 col = pcols[i - 2])
        }
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Created .NET WCF service, tested it - works. Generated schemas from Data and service
Created a views.py method to get the data posted from an html form. As
I created a python server on port 8000 using python -m SimpleHTTPServer . When
I created a PHP Drop Down which is populated from a MySql Database and
Created an Accordion side bar using jQuery 1.2.6. I cannot access newer version of
created a singleview application with storyboard. Added three viewcontrollers apart from the one view
Created basic C++ DLL and exported names using Module Definition file (MyDLL.def). After compilation
Created using Sphinx 0.6.5. I know Python's documentation uses reStructuredText , but it has
Created a phonegap application using jQuery Mobile. Everything is working great for the most
Could you advise some library to create a radar chart in my desktop java

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.