rcdimple. How to wrap long data labels when plotting? The Next CEO of Stack OverflowHow to join (merge) data frames (inner, outer, left, right)How to plot two histograms together in R?How to set limits for axes in ggplot2 R plots?How to increase font size in a plot in R?How to save a plot as image on the disk?Text wrap for plot titlesWhen to use cla(), clf() or close() for clearing a plot in matplotlib?In R base plot, move axis label closer to axisModifying plot title and Y axis label when plotting acf & ccfReplacing legend with labels in multilevel ggplot2 plot

Is it a bad idea to plug the other end of ESD strap to wall ground?

Could you use a laser beam as a modulated carrier wave for radio signal?

Planeswalker Ability and Death Timing

Is a linearly independent set whose span is dense a Schauder basis?

That's an odd coin - I wonder why

Would a grinding machine be a simple and workable propulsion system for an interplanetary spacecraft?

Horror film about a man brought out of cryogenic suspension without a soul, around 1990

Compensation for working overtime on Saturdays

Early programmable calculators with RS-232

Upgrading From a 9 Speed Sora Derailleur?

What did the word "leisure" mean in late 18th Century usage?

Small nick on power cord from an electric alarm clock, and copper wiring exposed but intact

Why was Sir Cadogan fired?

My boss doesn't want me to have a side project

How do I secure a TV wall mount?

Why does freezing point matter when picking cooler ice packs?

How do I keep Mac Emacs from trapping M-`?

Can this transistor (2n2222) take 6V on emitter-base? Am I reading datasheet incorrectly?

Is it okay to majorly distort historical facts while writing a fiction story?

Why doesn't Shulchan Aruch include the laws of destroying fruit trees?

Mathematica command that allows it to read my intentions

How dangerous is XSS

Why can't we say "I have been having a dog"?

Traveling with my 5 year old daughter (as the father) without the mother from Germany to Mexico



rcdimple. How to wrap long data labels when plotting?



The Next CEO of Stack OverflowHow to join (merge) data frames (inner, outer, left, right)How to plot two histograms together in R?How to set limits for axes in ggplot2 R plots?How to increase font size in a plot in R?How to save a plot as image on the disk?Text wrap for plot titlesWhen to use cla(), clf() or close() for clearing a plot in matplotlib?In R base plot, move axis label closer to axisModifying plot title and Y axis label when plotting acf & ccfReplacing legend with labels in multilevel ggplot2 plot










0















I have the following data and plot:



library(rcdimple)
df<- data.frame(values=rnorm(5, mean = 5,sd = 2),
labels=c("Short Label", "Medium Laaabel", "Looonnnnnggg Laaaaabbbeeeell",
"The quick brown fox jumped over the lazy dog",
"noSpacesLongLabelThatCanHopefullyBeSplitToo"))

dimple(
labels ~ values,
groups = "labels",
data = df,
type = "bar"
) %>%
xAxis(type = "addMeasureAxis", title="Just An Axis Label") %>%
#good test of orderRule on y instead of x
yAxis(type = "addCategoryAxis", orderRule = "values", title="Wrap These Labels") %>%
add_legend(
x = 0,
y = 10,
width = "100%",
height = 30,
horizontalAlign = "right"
) %>%
rcdimple::set_bounds("40.5%", "8.5%", "90%", "85%") %>%
rcdimple::add_title(html=paste0("<h4>How Could I wrap long labels?</h4>" ))


In order to fit the labels, I have had to give a considerably large chunk of the plotting area (40.5%) to the labels, and not the bars. I would love to be able to wrap the labels and give the bars in the bar plot more space.



I am wondering if it is possible to do this, and if anyone may have a solution? So far I have tried, to no avail:



# 1. Putting in a "<br>" where desired after a space

df$labels<-stringr::str_replace_all(stringr::str_wrap(df$labels, width = 25), "\n", " <br> ")

# Wrapping it all in HTML, even putting that inside eval(parse(text=df$labels))....

df$labels<- shQuote(paste0('htmltools::HTML("',stringr::str_replace_all(stringr::str_wrap(df$labels, width = 25), "\n", " <br> "),'")'), type = "cmd")


Any help is greatly appreciated. Thank you in advance. -NF










share|improve this question


























    0















    I have the following data and plot:



    library(rcdimple)
    df<- data.frame(values=rnorm(5, mean = 5,sd = 2),
    labels=c("Short Label", "Medium Laaabel", "Looonnnnnggg Laaaaabbbeeeell",
    "The quick brown fox jumped over the lazy dog",
    "noSpacesLongLabelThatCanHopefullyBeSplitToo"))

    dimple(
    labels ~ values,
    groups = "labels",
    data = df,
    type = "bar"
    ) %>%
    xAxis(type = "addMeasureAxis", title="Just An Axis Label") %>%
    #good test of orderRule on y instead of x
    yAxis(type = "addCategoryAxis", orderRule = "values", title="Wrap These Labels") %>%
    add_legend(
    x = 0,
    y = 10,
    width = "100%",
    height = 30,
    horizontalAlign = "right"
    ) %>%
    rcdimple::set_bounds("40.5%", "8.5%", "90%", "85%") %>%
    rcdimple::add_title(html=paste0("<h4>How Could I wrap long labels?</h4>" ))


    In order to fit the labels, I have had to give a considerably large chunk of the plotting area (40.5%) to the labels, and not the bars. I would love to be able to wrap the labels and give the bars in the bar plot more space.



    I am wondering if it is possible to do this, and if anyone may have a solution? So far I have tried, to no avail:



    # 1. Putting in a "<br>" where desired after a space

    df$labels<-stringr::str_replace_all(stringr::str_wrap(df$labels, width = 25), "\n", " <br> ")

    # Wrapping it all in HTML, even putting that inside eval(parse(text=df$labels))....

    df$labels<- shQuote(paste0('htmltools::HTML("',stringr::str_replace_all(stringr::str_wrap(df$labels, width = 25), "\n", " <br> "),'")'), type = "cmd")


    Any help is greatly appreciated. Thank you in advance. -NF










    share|improve this question
























      0












      0








      0








      I have the following data and plot:



      library(rcdimple)
      df<- data.frame(values=rnorm(5, mean = 5,sd = 2),
      labels=c("Short Label", "Medium Laaabel", "Looonnnnnggg Laaaaabbbeeeell",
      "The quick brown fox jumped over the lazy dog",
      "noSpacesLongLabelThatCanHopefullyBeSplitToo"))

      dimple(
      labels ~ values,
      groups = "labels",
      data = df,
      type = "bar"
      ) %>%
      xAxis(type = "addMeasureAxis", title="Just An Axis Label") %>%
      #good test of orderRule on y instead of x
      yAxis(type = "addCategoryAxis", orderRule = "values", title="Wrap These Labels") %>%
      add_legend(
      x = 0,
      y = 10,
      width = "100%",
      height = 30,
      horizontalAlign = "right"
      ) %>%
      rcdimple::set_bounds("40.5%", "8.5%", "90%", "85%") %>%
      rcdimple::add_title(html=paste0("<h4>How Could I wrap long labels?</h4>" ))


      In order to fit the labels, I have had to give a considerably large chunk of the plotting area (40.5%) to the labels, and not the bars. I would love to be able to wrap the labels and give the bars in the bar plot more space.



      I am wondering if it is possible to do this, and if anyone may have a solution? So far I have tried, to no avail:



      # 1. Putting in a "<br>" where desired after a space

      df$labels<-stringr::str_replace_all(stringr::str_wrap(df$labels, width = 25), "\n", " <br> ")

      # Wrapping it all in HTML, even putting that inside eval(parse(text=df$labels))....

      df$labels<- shQuote(paste0('htmltools::HTML("',stringr::str_replace_all(stringr::str_wrap(df$labels, width = 25), "\n", " <br> "),'")'), type = "cmd")


      Any help is greatly appreciated. Thank you in advance. -NF










      share|improve this question














      I have the following data and plot:



      library(rcdimple)
      df<- data.frame(values=rnorm(5, mean = 5,sd = 2),
      labels=c("Short Label", "Medium Laaabel", "Looonnnnnggg Laaaaabbbeeeell",
      "The quick brown fox jumped over the lazy dog",
      "noSpacesLongLabelThatCanHopefullyBeSplitToo"))

      dimple(
      labels ~ values,
      groups = "labels",
      data = df,
      type = "bar"
      ) %>%
      xAxis(type = "addMeasureAxis", title="Just An Axis Label") %>%
      #good test of orderRule on y instead of x
      yAxis(type = "addCategoryAxis", orderRule = "values", title="Wrap These Labels") %>%
      add_legend(
      x = 0,
      y = 10,
      width = "100%",
      height = 30,
      horizontalAlign = "right"
      ) %>%
      rcdimple::set_bounds("40.5%", "8.5%", "90%", "85%") %>%
      rcdimple::add_title(html=paste0("<h4>How Could I wrap long labels?</h4>" ))


      In order to fit the labels, I have had to give a considerably large chunk of the plotting area (40.5%) to the labels, and not the bars. I would love to be able to wrap the labels and give the bars in the bar plot more space.



      I am wondering if it is possible to do this, and if anyone may have a solution? So far I have tried, to no avail:



      # 1. Putting in a "<br>" where desired after a space

      df$labels<-stringr::str_replace_all(stringr::str_wrap(df$labels, width = 25), "\n", " <br> ")

      # Wrapping it all in HTML, even putting that inside eval(parse(text=df$labels))....

      df$labels<- shQuote(paste0('htmltools::HTML("',stringr::str_replace_all(stringr::str_wrap(df$labels, width = 25), "\n", " <br> "),'")'), type = "cmd")


      Any help is greatly appreciated. Thank you in advance. -NF







      r plot axis-labels htmlwidgets






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 21 at 19:17









      natenate

      512418




      512418






















          0






          active

          oldest

          votes












          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55287801%2frcdimple-how-to-wrap-long-data-labels-when-plotting%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55287801%2frcdimple-how-to-wrap-long-data-labels-when-plotting%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

          은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현