如何使垃圾箱在ggplot2中排队?

时间:2017-11-30 19:59:34

标签: r ggplot2

我使用ggplot2绘制如下所示的直方图。我将bin的宽度设置为5或10.但是,图表中的第一个bin似乎只是bin宽度的一半。 5-2.5和10-5。是什么导致了这个问题,我该如何解决?

Histogram

1 个答案:

答案 0 :(得分:0)

您可以控制分档与#tags<head> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css"> <script src="https://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js" integrity="sha256-VazP97ZCwtekAsvgPBSUwPFKdrwD3unUfSGVYrahUqU=" crossorigin="anonymous"></script> </head> <body> <div class="dropdown bigdiv"> <button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">Dropdown Example <span class="caret"></span></button> <ul class="dropdown-menu bigul"> <li><a href="#">dumped_li</a></li> <li class="ui-widget"> <label for="tags">Tags: </label> <input id="tags"> </li> </ul> </div> <br/> <br/> <br/> <br/> <br/> <div class="anotherdiv" style="background-color: #447e9b; height: 200px;"> GoesHere: <br/> <ul></ul> </div> </body> <script> var availableTags = [ "ActionScript", "AppleScript", "Asp", "BASIC", "C", "C++", "Clojure", "COBOL", "ColdFusion", "Erlang", "Fortran", ]; $('#tags').autocomplete({ search: function(event, ui) { $('.anotherdiv ul').empty(); }, source: availableTags }).data('autocomplete')._renderItem = function(ul, item) { return $('<li></li>') .data('item.autocomplete', item) .append(item.value) .appendTo($('.anotherdiv ul')); }; </script> 参数对齐的方式。在这种情况下,您可能需要center


boundary