• <tfoot id='fF0US'></tfoot>
      <bdo id='fF0US'></bdo><ul id='fF0US'></ul>

    1. <legend id='fF0US'><style id='fF0US'><dir id='fF0US'><q id='fF0US'></q></dir></style></legend>
      <i id='fF0US'><tr id='fF0US'><dt id='fF0US'><q id='fF0US'><span id='fF0US'><b id='fF0US'><form id='fF0US'><ins id='fF0US'></ins><ul id='fF0US'></ul><sub id='fF0US'></sub></form><legend id='fF0US'></legend><bdo id='fF0US'><pre id='fF0US'><center id='fF0US'></center></pre></bdo></b><th id='fF0US'></th></span></q></dt></tr></i><div id='fF0US'><tfoot id='fF0US'></tfoot><dl id='fF0US'><fieldset id='fF0US'></fieldset></dl></div>

        <small id='fF0US'></small><noframes id='fF0US'>

        修复标题在两行上拆分时的 plotly ggplotly() 标题重叠图

        Fix plotly ggplotly() Title Overlapping Plot When Title is Split on Two Lines(修复标题在两行上拆分时的 plotly ggplotly() 标题重叠图)

            <bdo id='UXe4X'></bdo><ul id='UXe4X'></ul>

            <small id='UXe4X'></small><noframes id='UXe4X'>

            <tfoot id='UXe4X'></tfoot>

                <tbody id='UXe4X'></tbody>
                <legend id='UXe4X'><style id='UXe4X'><dir id='UXe4X'><q id='UXe4X'></q></dir></style></legend>

                  <i id='UXe4X'><tr id='UXe4X'><dt id='UXe4X'><q id='UXe4X'><span id='UXe4X'><b id='UXe4X'><form id='UXe4X'><ins id='UXe4X'></ins><ul id='UXe4X'></ul><sub id='UXe4X'></sub></form><legend id='UXe4X'></legend><bdo id='UXe4X'><pre id='UXe4X'><center id='UXe4X'></center></pre></bdo></b><th id='UXe4X'></th></span></q></dt></tr></i><div id='UXe4X'><tfoot id='UXe4X'></tfoot><dl id='UXe4X'><fieldset id='UXe4X'></fieldset></dl></div>

                  本文介绍了修复标题在两行上拆分时的 plotly ggplotly() 标题重叠图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  在下面的示例中,标题的第二行与情节略有重叠.有没有办法通过增加标题和情节之间的间距来解决这个问题?

                  In the example below, the second line of the title overlaps slightly with the plot. Is there a way to fix this by increasing the spacing between the title and plot?

                  library(ggplot2)
                  library(plotly)
                  library(magrittr)
                  
                  p1 <- ggplot(iris, aes(x = Sepal.Length, y = Petal.Length)) +
                    geom_point() + 
                    ggtitle("A REALLY, REALLY, REALLY LONG TITLE THAT I WANT TO
                  SPLIT INTO TWO LINES")
                  p1
                  
                  ggplotly() %>% config(collaborate=FALSE, cloud=FALSE, displaylogo=FALSE, modeBarButtonsToRemove=c("select2d", "sendDataToCloud", "pan2d", "resetScale2d", "hoverClosestCartesian", "hoverCompareCartesian", "lasso2d", "zoomIn2d", "zoomOut2d"))
                  

                  推荐答案

                  Plotly 忽略尾随换行符,还需要 HTML 换行符 <br/> 而不是 换行(见最后的例子).

                  Plotly ignores trailing new line characters and also needs HTML breaks <br /> instead of for new lines (see example at the end).

                  添加 <br/> 以手动打破标题并在布局中添加顶部 margin (layout(gp, margin=list(t= 75))).

                  Add <br /> to manually break your title and add a top margin to your layout (layout(gp, margin=list(t = 75))).

                  library(ggplot2)
                  library(plotly)
                  library(magrittr)
                  
                  p1 <- ggplot(iris, aes(x = Sepal.Length, y = Petal.Length)) +
                    geom_point() + 
                    ggtitle("A REALLY, REALLY, REALLY LONG TITLE THAT I WANT TO <br />
                  SPLIT INTO TWO LINES<br />
                  ")
                  p1
                  
                  gp <- ggplotly() %>% config(collaborate=FALSE, cloud=FALSE, displaylogo=FALSE, modeBarButtonsToRemove=c("select2d", "sendDataToCloud", "pan2d", "resetScale2d", "hoverClosestCartesian", "hoverCompareCartesian", "lasso2d", "zoomIn2d", "zoomOut2d"))
                  gp <- layout(gp, margin=list(t = 75))
                  gp
                  

                  <小时>

                  ggplot

                  情节

                  这篇关于修复标题在两行上拆分时的 plotly ggplotly() 标题重叠图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  业务场景:使用update语句去更新数据库字段。 原因:update接收值不正确。原来代码: $query = "UPDATE student SET date = now() WHERE id = $id";$result = $mysqli-query($query2) or die($mysqli-error); // 问题出现了在这句 $data = $result-fetch_ass
                  在layui树状组件tree中,勾选问题可以通过以下方法解决: 通过tree的oncheck事件来监听勾选操作,然后根据勾选状态进行相应的处理。例如: tree.on('check', function(obj) { // 获取勾选状态 var isChecked = obj.checked; // 获取当前节点数据 var data =
                  经常用到layui的朋友都知道,layui tree默认是不能自定义图标的,那么我们要自定义的话要怎么操作呢? 首先用编辑器软件(修改时候用编辑器记得编码),打开layui.js。搜索: i class="layui-icon layui-icon-file" 改为如下代码: i class="'+ (i.icon || "l
                  在开发JS过程中,会经常遇到两个小数相运算的情况,但是运算结果却与预期不同,调试一下发现计算结果竟然有那么长一串尾巴。如下图所示: 产生原因: JavaScript对小数运算会先转成二进制,运算完毕再转回十进制,过程中会有丢失,不过不是所有的小数间运算会
                  append() 方法在被选元素的结尾(仍然在内部)插入指定内容。 语法: $(selector).append( content ) var creatPrintList = function(data){ var innerHtml = ""; for(var i =0;i data.length;i++){ innerHtml +="li class='contentLi'"; innerHtml +="a href
                  问题描述: 在javascript中引用js代码,然后导致反斜杠丢失,发现字符串中的所有\信息丢失。比如在js中引用input type=text onkeyup=value=value.replace(/[^\d]/g,) ,结果导致正则表达式中的\丢失。 问题原因: 该字符串含有\,javascript对字符串进行了转
                    <bdo id='cfrYY'></bdo><ul id='cfrYY'></ul>
                      <tbody id='cfrYY'></tbody>
                      <i id='cfrYY'><tr id='cfrYY'><dt id='cfrYY'><q id='cfrYY'><span id='cfrYY'><b id='cfrYY'><form id='cfrYY'><ins id='cfrYY'></ins><ul id='cfrYY'></ul><sub id='cfrYY'></sub></form><legend id='cfrYY'></legend><bdo id='cfrYY'><pre id='cfrYY'><center id='cfrYY'></center></pre></bdo></b><th id='cfrYY'></th></span></q></dt></tr></i><div id='cfrYY'><tfoot id='cfrYY'></tfoot><dl id='cfrYY'><fieldset id='cfrYY'></fieldset></dl></div>
                        <tfoot id='cfrYY'></tfoot>

                          <small id='cfrYY'></small><noframes id='cfrYY'>

                        • <legend id='cfrYY'><style id='cfrYY'><dir id='cfrYY'><q id='cfrYY'></q></dir></style></legend>