我需要在图表上绘制n个不同的对象.我想为每个颜色选择不同的颜色,以使它们可以区分.物体将被移动,所以我不能指望像"四色定理"这样的想法为不相邻的物品分配相同的颜色.到目前为止,我的问题需要最多20个不同的项目.
是否有一种很好的方法可以选择不同的颜色,使它们尽可能彼此区分?
使用pch我可以绘制任何符号并在图例中指定任何标签.但是如何为每个图例标签绘制两个符号?例如,在下面的图中,我想要■▲●与红色版本配对,所以我只有三个标签'a','b','c'显示在图例中,这六个符号.目前,基本的情节图例似乎只允许我为每个标签绘制一个符号:
plot(rnorm(50),pch=c(15:17),col=1:2)
legend('topleft',pch=c(15:17),col=1:2,legend=c("a","b","c"),cex=1.5)
Run Code Online (Sandbox Code Playgroud)

我正在使用Highcharts/Highstock来绘制相当大量的数据(~10,000点).数据由X轴上的Date对象和Y上的浮点组成,格式如下:[[(date), 1.728], [(date), 0.346], ...].日期总是相隔1小时,数据中没有间隙.
当图表的范围> = 21天(这样至少可以显示21天的数据)时,图表会正确显示.但是,只要范围小于该范围,图表就会变为空白,工具提示会将每个点显示为Y值为0.0.这些点的Y值确实存在于数组中(我可以在Firebug中看到它们),但它们不会显示在图表上.这是我如何初始化它:
mainChart = new Highcharts.StockChart({
chart: {
renderTo: 'linegraph'
},
rangeSelector: {
buttons: [{
type: 'day',
count: 1,
text: '1 d'
}, {
type: 'week',
count: 1,
text: '1 wk'
}, {
type: 'month',
count: 1,
text: '1 mo'
}, {
type: 'year',
count: 1,
text: '1 yr'
}, {
type: 'all',
text: 'All'
}],
selected: 2
},
series: [{
name: 'Electricity usage (kWh)',
data: graphData,
tooltip: {
valueDecimals: …Run Code Online (Sandbox Code Playgroud) 我有一个存储在我的数据库中的RBAC结构(使用Yii构建的项目).
我希望生成一个图形来可视化项目之间的关系,看看我是否犯了逻辑错误,并向其他团队成员展示.
我正在考虑创建一个生成图形/树的页面.我想我可以处理服务器端部分,但我不知道如何生成HTML/CSS(或图像).
图中的节点可以有多个子节点和多个父节点.箭头是直接的.例:
我不介意使用最新的CSS3和HTML5技术,因为它只会被选定的人使用.
html php graphics data-visualization directed-acyclic-graphs
我System.Windows.Controls.DataVisualization.Toolkit.dll用来为我的基于C#的wpf应用程序生成图表.这是我的图表的xaml.
<chartingToolkit:Chart Name="chartDailySales"
Title="Monthly Sales"
VerticalAlignment="Top" Margin="10,10,0,0"
Height="262"
BorderBrush="#00000000"
DataContext="{Binding}"
IsTabStop="True"
Background="#ffbcd5c7">
<!-- Plot area-->
<chartingToolkit:Chart.PlotAreaStyle>
<Style TargetType="Grid">
<Setter Property="Background" Value="White" />
</Style>
</chartingToolkit:Chart.PlotAreaStyle>
<!-- Hide Legend-->
<chartingToolkit:Chart.LegendStyle>
<Style TargetType="Control">
<Setter Property="Width" Value="0"/>
<Setter Property="Height" Value="0"/>
</Style>
</chartingToolkit:Chart.LegendStyle>
<chartingToolkit:ColumnSeries DependentValuePath="Value"
IndependentValuePath="Key"
ItemsSource="{Binding}"
IsSelectionEnabled="False"
>
<chartingToolkit:ColumnSeries.DataPointStyle>
<Style TargetType="chartingToolkit:ColumnDataPoint">
<Setter Property="Background" Value="#ff217346"/>
<Setter Property="BorderBrush" Value="#ff217346" />
<Setter Property="BorderThickness" Value="1" />
</Style>
</chartingToolkit:ColumnSeries.DataPointStyle>
</chartingToolkit:ColumnSeries>
</chartingToolkit:Chart>
Run Code Online (Sandbox Code Playgroud)
这是填充数据的代码.
List<KeyValuePair<string, double>> monthlySalesList = new List<KeyValuePair<string, double>>();
monthlySalesList.Add(new KeyValuePair<string, double>("JAN", 1234 ));
monthlySalesList.Add(new KeyValuePair<string, double>("FEB", …Run Code Online (Sandbox Code Playgroud) 我是画面新手,我有以下可视化,这是链接:
我的问题是我不知道如何在一个仪表板中添加多个仪表板作为选项卡.在我的可视化中,有三个仪表板"Nota total","Todos los cursos"和"Cursos por ciclo",其他标签只是表格.因此,如何仅使用我提到的三个仪表板来呈现我的可视化.
我想知道是否可以为绘图中的列名设置不同的形状而不是标签.我已经展示了一个可重复的例子来获得该图.
#dataset
mtcars
#split the data into different blocks
a<-mtcars[,1:3]
b<-mtcars[,4:6]
c<-mtcars[,7:9]
d<-mtcars[,10:11]
### create a list of dataframes
A<-list(blockA=a, blockB=b,blockC=c,blockD=d)
### design matrix
C <- matrix(c(0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
1, 1, 1, 1), 4, 4)
tau = c(1, 1, 1, 1)
library(mixOmics)
##### computing the sGCCA
wrap.result.sgcca = wrapper.sgcca(data = A, design = C, penalty = rep(1, length(A)),
ncomp = c(2, 2, 2,2), scheme = "centroid", verbose = FALSE)
##### visualization …Run Code Online (Sandbox Code Playgroud) 将ggplot样式保存到R中的对象的最佳方法是什么?我知道ggplot有自定义主题,但是有很多视觉设计不适合主题功能.
这是一些样本(融化)数据和我一直在研究的图表
library(ggplot2)
mdf <- structure(list(group = structure(c(2L, 3L, 1L, 2L, 3L, 1L), .Label = c("democrat",
"founder", "libertarian"), class = "factor"), variable = structure(c(1L,
1L, 1L, 2L, 2L, 2L), .Label = c("similar", "compete"), class = "factor"),
value = c(0.7, 0.2, 0.4, 0.3, 0.8, 0.6)), row.names = c(NA,
-6L), .Names = c("group", "variable", "value"), class = "data.frame")
ggplot(mdf, aes (x=group, y=value, fill = variable)) +
geom_bar(stat="identity", position="dodge", alpha = 0.8) +
geom_bar(stat="identity", position="dodge", color = "#A9A9A9", alpha = 0.8) +
scale_fill_manual(values=c("#05f2ae", …Run Code Online (Sandbox Code Playgroud) 链接中的散景0.12.1的官方文档提供了以下用于创建下拉列表的代码.
但是,当有人点击并从下拉列表中选择一个值时,它没有明确提到如何捕获下拉窗口小部件的值.
from bokeh.io import output_file, show
from bokeh.layouts import widgetbox
from bokeh.models.widgets import Dropdown
output_file("dropdown.html")
menu = [("Item 1", "item_1"), ("Item 2", "item_2"), None, ("Item 3", "item_3")]
dropdown = Dropdown(label="Dropdown button", button_type="warning", menu=menu)
show(widgetbox(dropdown))
Run Code Online (Sandbox Code Playgroud)
题
是看到有2个方法叫做on_click()&on_change()但是从文档中无法弄清楚如何捕获值.我们如何将选定的值分配给新变量?
编辑
根据@Ascurion的输入,我更新了我的代码,如下所示.但是当我在下拉列表中选择一个值时,Spyder的ipython控制台中不会打印任何内容.请指教.
from bokeh.io import output_file, show
from bokeh.layouts import widgetbox
from bokeh.models.widgets import Dropdown
output_file("dropdown.html")
menu = [("Item 1", "item_1"), ("Item 2", "item_2"), None, ("Item 3", "item_3")]
dropdown = Dropdown(label="Dropdown button", button_type="warning", menu=menu)
def function_to_call(attr, old, new):
print dropdown.value
dropdown.on_change('value', function_to_call) …Run Code Online (Sandbox Code Playgroud) 我无法改变我制作的谷歌饼图的大小.我正在尝试绘制多个饼图,每个图表的大小与我正在为其提供的数据总量成比例.我知道我们可以通过向图表添加选项来更改图表的div容器的大小,如下所示:
var options = {width: 400, height: 300};
Run Code Online (Sandbox Code Playgroud)
但是,我感兴趣的不是改变它的大小div,而是改变实际饼图本身的大小.
有什么办法可以改变饼图的半径吗?
我四处搜寻,但找不到任何东西.这是我的意思的快速描绘:

正如你所看到的,我想要的是div保持相同的尺寸,但要改变圆的大小,这取决于我喂它的值.
任何帮助表示赞赏
charts data-visualization google-api google-visualization pie-chart
r ×3
charts ×2
plot ×2
bokeh ×1
c# ×1
colors ×1
ggplot2 ×1
google-api ×1
graphics ×1
highcharts ×1
highstock ×1
html ×1
image ×1
javascript ×1
legend ×1
mschart ×1
pch ×1
php ×1
pie-chart ×1
python ×1
statistics ×1
symbols ×1
tableau-api ×1
widget ×1
wpf ×1