小编tut*_*ies的帖子

使用g中的ggplot2更改geom_bar中的条形图颜色

我有以下内容,以条形图数据框.

c1 <- c(10, 20, 40)
c2 <- c(3, 5, 7)
c3 <- c(1, 1, 1)
df <- data.frame(c1, c2, c3)
ggplot(data=df, aes(x=c1+c2/2, y=c3)) +
  geom_bar(stat="identity", width=c2) +
  scale_fill_manual(values=c("#FF6666"))
Run Code Online (Sandbox Code Playgroud)

我最终只有灰色条纹:条形图的灰色条纹

我想改变酒吧的颜色.我已经尝试过来自http://www.cookbook-r.com/Graphs/Colors_(ggplot2)/的不同scale_fill_manual, 但仍然有灰色条.

谢谢您的帮助.

r colors ggplot2 geom-bar

29
推荐指数
1
解决办法
14万
查看次数

来自R的htmlwidget的savewidget,无法将html文件保存在另一个文件夹中

我有一个地图传单,我想保存在特定文件夹中的html文件中.我使用的是Windows 7.

我尝试了以下方法:

library(htmlwidgets)
saveWidget(map_leaflet, file="ressources/test.html")

library(htmlwidgets)
saveWidget(map_leaflet, file="ressources\\test.html")

library(htmlwidgets)
path_name <- file.path("ressources", "test.html", fsep="\\")
saveWidget(map_leaflet, file=path_name)

library(htmlwidgets)
path_name <- paste("ressources", "test.html", sep="/")
saveWidget(map_leaflet, file=path_name)
Run Code Online (Sandbox Code Playgroud)

作为错误消息,取决于Rstudio会话,我要么

1)setwd(dir)错误:无法更改工作目录

2)找不到路径

当我只保存这样:

library(htmlwidgets)
saveWidget(map_leaflet, file="test.html")
Run Code Online (Sandbox Code Playgroud)

它完美地运作.

预先感谢您的帮助.

html r save htmlwidgets

13
推荐指数
1
解决办法
5075
查看次数

在TestResults的deploymentFolder中的“Out”文件夹中使用UnitTest的输出,在Visual Studio中使用MSTest

我对视觉工作室很陌生。我有 Visual Studio 社区 2015。

我想做的是在使用 MSTest 在我的单元测试中输出特定数据时,我想将输出保存到一个文件中。

我已经看到,在每次运行测试时,都会在TestResuls/Deploy_username date hour/out. 我正在寻找一种将测试输出保存在该文件夹中的方法。

这是可能的还是有其他方法可以复制文件或报告我的数据?我查看了以下链接:https : //msdn.microsoft.com/en-us/library/microsoft.visualstudio.testtools.unittesting.deploymentitemattribute.aspx

https://msdn.microsoft.com/en-us/library/ee256991.aspx

DeploymentItem 未部署文件

在 Visual Studio 2013 中生成单元测试报告

这些链接都没有帮助我实现我想要的。

预先感谢您的帮助。

c# mstest visual-studio visual-studio-2015

5
推荐指数
1
解决办法
4294
查看次数

pip install getch:clang错误

我试图getch通过pip 安装,我有一个clang错误:

python -m pip install getch
Collecting getch
  Using cached getch-1.0.tar.gz
Installing collected packages: getch
  Running setup.py install for getch ... error
    Complete output from command /usr/local/opt/python/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/qm/gj1n93fd7rg8rgz1ldq19gm80000gn/T/pip-build-RYKX8n/getch/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/qm/gj1n93fd7rg8rgz1ldq19gm80000gn/T/pip-uEGRgA-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_ext
    building 'getch' extension
    creating build
    creating build/temp.macosx-10.10-x86_64-2.7
    clang -fno-strict-aliasing -fno-common -dynamic -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/local/include -I/usr/include -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/2.7.10/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c getchmodule.c -o build/temp.macosx-10.10-x86_64-2.7/getchmodule.o …
Run Code Online (Sandbox Code Playgroud)

python pip getch python-2.7

3
推荐指数
1
解决办法
4918
查看次数