data-visualization

3d Vector plotting and visualization in R

半腔热情 提交于 2019-12-10 15:08:53
问题 This question was migrated from Cross Validated because it can be answered on Stack Overflow. Migrated 5 years ago . Anyone know of any packages in R that can plot 3D vectors? I would like to plot some vectors over a 3 dimensional data set. I know scatterplot3d looks like it should be able to do the job, but I didn't see any documentation for vectors specifically (I would like to be able to change the origin of vectors as well). 回答1: rgl is a great package for 3d plotting. It is very like 2d

Stacked bar plot in R with multiple rows per day

旧巷老猫 提交于 2019-12-10 14:54:50
问题 I would like to display work done in a day as a stacked bar plot, in order to see, day by day, how much activity I've done in each category, with the Y-axis representing time from 0:00 to 23:59. # day tstart tend duration category 1 2012-10-01 13:40 14:16 36 Recreation 2 2012-10-02 10:15 10:57 42 Work 3 2012-10-02 13:23 13:47 24 Chores 4 2012-10-02 13:47 14:48 61 Work 5 2012-10-03 09:09 11:40 151 Work 6 2012-10-03 13:33 14:04 31 Recreation 7 2012-10-03 17:00 19:40 160 Recreation I know I will

alternative to foreignObject for IE9

强颜欢笑 提交于 2019-12-10 14:44:13
问题 i really like foreignObject to show HTML regions over svg, but today i found out that it doesnt work in IE9 (why am i not surprised) ok. So i am looking for an alternative that works in IE9, but it seems difficult. The great thing of using foreignObject to display multiple HTML elements. My D3.js Force layout graph is working great in chrome and FF , but in IE9 it fail because of foreignObject . i add many HTML elements in to Div and also more CSS stuff. I try to replace foreignObject with

Histogram of two variables in R

这一生的挚爱 提交于 2019-12-10 12:38:55
问题 I have two variables that I want to compare in a histogram like the one below. For each bin of the histogram the frequency of both variables is shown what makes it easy to compare them. 回答1: You can use the add parameter to hist (see ?hist , ?plot.histogram ): hist(rnorm(1000, mean=0.2, sd=0.1), col='blue', xlim=c(0, 1)) hist(rnorm(1000, mean=0.8, sd=0.1), col='red', add=T) To find out about the add parameter I noticed that in ?hist the ... argument says that these are arguments passed to

d3.js tree diagram - expand only next level nodes when clicking on root node

末鹿安然 提交于 2019-12-10 11:46:41
问题 I have a tree diagram I'm trying to adapt here, but the problem is that it automatically expands all root nodes in the tree when I click on a collapsed node, rather than just expanding the immediate children. Here's a fiddle. How do I resolve this? http://jsfiddle.net/heaversm/nw577/ The function for handling the toggling / collapsing of the nodes: function toggleChildren(d) { if (d.children) { d._children = d.children; d.children = null; } else if (d._children) { d.children = d._children; d.

Eliminate sudden additions/deletions in D3 basis line chart transition

為{幸葍}努か 提交于 2019-12-10 10:57:28
问题 I have exactly similar SO question Eliminate sudden additions/deletions in D3 line chart transition One difference is that, I have line interpolated as "basis" var line = d3.svg.line().interpolate('basis') Struggling with this exactly 13 hours :/ please help <html> <head> <title>Chart</title> <style> path { stroke: #f00; } .line { stroke: #0f0; fill: none; stroke-width: 2px; } .rule { stroke: #ccc; stroke-width: 1px; } </style> </head> <body> <p>I want to get the chart below to transition

error: Aesthetics must either be length one, or the same length as the dataProblems:personCategoryz when omitting NA

流过昼夜 提交于 2019-12-10 10:38:37
问题 I'm trying to create a graph using titanic dataset that looks at women, children, and men and their survival rates. I've created new categories to read the data from, but keep coming up with error messages when i try to do more beyond that point. When I run a graph to show this, it comes up fine except it has a separate category for NA data, so I tried to omit the data and the error message "Aesthetics must either be length one, or the same length as the dataProblems:personCategoryz" comes up

D3js: How to interpolate datasets with irregular time intervals before stacking them?

徘徊边缘 提交于 2019-12-10 10:34:42
问题 UPDATE: The jsfiddle example illustrates the problem: http://jsfiddle.net/T8SuH/ I am new to both D3js and JavaScript but comfortable with Java. I have a large CSV dataset from a bike-sharing system organized as follows: event_id, station_id, timestamp, number_of_bikes, number_of_empty_docks To reduce file size, my data file contains only new events for individual stations. Therefore timestamps of different stations are neither in regular time intervals nor they coincide. For example

Multiple node selection in vis.js

a 夏天 提交于 2019-12-10 10:10:14
问题 I'm playing with vis.js because I like its Network Visualization module. I'd like to know, as I can't find it in documentation, if it's possibile to select multiple nodes. Cheers, Riccardo 回答1: Search for "selectable" property in documentation at http://visjs.org/docs/network/ If true, nodes in the network can be selected by clicking them. Long press can be used to select multiple nodes. 回答2: Update! the link for the documentation is http://visjs.org/docs/network/interaction.html set the

Relationship Graph with D3

你。 提交于 2019-12-10 10:05:12
问题 How would I create the following graph with D3? I don't know the name for this type of visualization, and the closest I could find were "force-directed" graphs. Legend: Filled nodes are people, non-filled nodes are attributes (e.g. favorite color). 回答1: This is my version: http://jsfiddle.net/doraeimo/JEcdS/embedded/result/ which is easy to show system performance and network flow. code is not here 回答2: Hacked together a gross but working version: http://bl.ocks.org/hijonathan/5793014