我正在尝试使用//Sample data
int items = 8;
//Initial class
static string cssclass = "active item";
protected void ShowSlides()
{
DataTable dt = SlideManager.GetSlidesDynamically(items);
Literal str = new Literal();
str.Visible = true;
str.Text = "<br/>";
if (dt.Rows.Count > 0)
{
foreach (DataRow dr in dt.Rows)
{
Panel item = new Panel();
item.Visible = true;
item.CssClass = cssclass;
Literal img = new Literal();
img.Visible = true;
img.Text = "<img runat='server' " +
"src='data:image/jpeg;base64," +
dr[0].ToString() +
"' class='carouselImage' />";
item.Controls.Add(img);
Panel caption = new Panel();
caption.Visible = true;
caption.CssClass = "carousel-caption";
Literal title = new Literal();
title.Visible = true;
title.Text = "<h3 runat='server'>" + dr[2].ToString() + "</h3>";
Literal capt = new Literal();
capt.Visible = true;
capt.Text = "<p runat='server'>" + dr[3].ToString() + "</p>";
caption.Controls.Add(title);
caption.Controls.Add(capt);
item.Controls.Add(caption);
//Invoke all controls to slider
carousel_inner.Controls.Add(item);
cssclass = "item";
}
}
}
按R
按小组绘制线图,如下所示。它适用于灰度打印。
ggplot2
然而,由于涉及10个小组,因此在结果图中缺乏清晰度。如何在ggplot2中调整颜色/ pch / line样式,以便在涉及大量组的情况下提高可读性?
答案 0 :(得分:2)
我倾向于使用这样的方面:
ggplot(mry, aes(x=year, y=number))+
geom_line() +
scale_color_grey() +
theme_bw() +
facet_grid(rating~.)
显然这在纵向模式下会更好,但即使在这个微小的比例下你也可以看出1,2,3,9和10的等级是非常罕见的,并且最常见的等级是6和7(在至少最近)。这远远超过你可以从彼此之上绘制所有东西。
答案 1 :(得分:1)
提高可读性的一个选项是使用linetype
代替colour
。但仍然有10个团体可能太多了。您可以尝试使用geom_point
p <- ggplot(mry, aes(x=year, y=number, linetype =factor(rating)))
p + geom_line() + scale_color_grey() + theme_bw()