我正在尝试使用ggplot2制作图形,我设想这是这两个图形之间的组合:
本质上,我要寻找的是第一张图片在背景中,所有数据都在前部。
到目前为止我尝试过的:
使用第一张图片作为ggplot的背景。
使用+ geom_poly()
或胖+ geom_segment()
但是无法使其中任何一项工作都达到我想要的无缝状态。
点数据如下:
input2 <- read.table(
text = "rowname key variable value
1 January 2016 8233
2 February 2016 11573
3 March 2016 23016
4 April 2016 32029
5 May 2016 51280
6 June 2016 30652
7 July 2016 62877
8 August 2016 80680
9 September 2016 60807
10 October 2016 74004
11 November 2016 60995
12 December 2016 39608",
header = T,
stringsAsFactors = F)
我的绘图代码如下:
library(ggplot2)
ggplot(input2, aes(x=key, y=value, color=variable))+
geom_point(aes(size=value)) +
scale_x_discrete(limits=c("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December")) +
#annotation_custom(g, xmin=-Inf, xmax=Inf, ymin=-Inf, ymax=Inf) +
#geom_segment(aes(x = x1, y = y1, xend = x2, yend = y2, colour = "segment"), data = grass) +
scale_colour_manual(values=c("#CC6600", "#999999", "#FFCC33")) +
ggtitle("Number of Images per month\n") +
labs(x="Month",y="Number of images", fill="Legend")
被注释掉的东西是我失败的尝试。
答案 0 :(得分:0)
您可以像这样使用 <?php
session_start();
?>
<?php
$pn = $item['pn'];
// Set session variables
$_SESSION["partnumber1"] = "$pn";
$_SESSION["partnumber2"] = "$pn"; //Obviously at the moment this would just overwrite partnumber1 twice so I need a way to register more than once
?>
和geom_rect
来接近理想的情节。
geom_text
不确定您所指的是什么事,但希望能有所帮助。让我知道您是否坚持执行它。