Since OP has asked me to elaborate, here's my take as an answer. Most generally, you're plotting the function s(x) = a sin(bx + c), where a, b and c come from the original problem. Later we will shift the sine curve by some offset Z but I'll leave it...

You're setting the positions of the text and node elements separately, but all you need to do it set the positions of the g elements that they are contained in: node.attr("transform", function(d) { return "translate(" + d.fisheye.x + "," + d.fisheye.y + ")"; }); Complete example here....

You can add another layer in the first plot that will add the points that have the same gears as the selected points: mtcars %>% ggvis(~mpg, ~wt) %>% layer_points(fill := lb$fill, fill.brush := "red") %>% lb$input() %>% set_options(width = 300, height = 300) %>% #the next line will add red...

Preliminary Note When looking at your data.frame, the group variable does not make any sense, as it is perfectly confounded with the x variable. Hence I adapted your data a bit, to show a full example: Data library(Rmisc) library(ggplot2) d <- expand.grid(x1 = paste0("a", 1:5), x2 = paste0("b", 1:5)) d...

Based on the gmodels' package documentation, function CrossTable() returns results as a list. Therefore, I don't see any problems with exporting the results to LaTeX format. You just need to convert that list into a data frame. Then you have a choice of various R packages, containing functions to convert...

The most obvious way is to add a VerticalLineAnnotation. Here is an example: First I set up a few things: int yourPointIndex = 635; Series S1 = chart1.Series[0]; ChartArea CA1 = chart1.ChartAreas[0]; Now I create the Annotation and style it a little: VerticalLineAnnotation LA = new VerticalLineAnnotation(); LA.LineColor = Color.Red;...

Unfortunately, AFAIK, you should keep track of what you draw. Canvas doesn't store drawn stuff as vector graphics(again, AFAIK), but on a raster, so there's no way to get it to tell you where the lines/points are. You could push each point you pass to ctx.moveTo and ctx.lineTo to a...

To calculate the Kernel density using kde2d you want to use, df = data.frame(x = c(1,2),y = c(3,1),count=c(2,1)) f1=kde2d(x=rep.int(df$x,df$count), y=rep.int(df$x,df$count)) # you probably also want to set the parameters h,n, and lims image(f1) see ?kde2d for other parameters....

To obtain such level of interaction, you can focus on the library C3.js which is based on D3. C3 provides a variety of APIs and callbacks to access the state of the chart. By using them, you can update the chart even if after it's rendered. A sample of code...

Ok I found the solution for my problem, the trick is to change the data directly through the pipeline. So in my code I just have to set the following command into the else segment: self.plot.parent.parent.scalar_data = self.p[self.n] ...

You can add mouseOver handler for the line and translate back the mouse y position to yAxis value using the .invert function of d3 linear scale. Now, you can dynamically add a tooltip text element and set the position, value to it Here is the updated Codepen link NOTE: You...

The col argument to par sets the default plotting colour (i.e. when col is not explicitly specified in plotting calls), but unfortunately col = "black" is hard-coded into the source of gaps.plot. You can make a modified copy of the function by either (1) viewing the source (F2 in RStudio,...

Perhaps use some kind of downsampling on A. To do it right you'd have to apply a low-pass filter followed by decimation, but the low-pass filter may take very long in your case. So, even if it's subject to possible aliasing, you can try to just take a sample out...

D3 can basically do anything ranging from 3d data visualizations to graphically representing data. Also, d3 uses a lot of SVG techniques. If you are looking to understand what all can be built out with d3, take a look at the below link: https://github.com/mbostock/d3/wiki/Gallery The best way to approach would...

Looking at your JSFiddle, there was a commented block which was close to the right answer, however you missed a couple of things. Firstly circles use the cx and cy properties rather than x and y so you need to refer to those for position. Secondly you were calling s.shapes.each...

You do need something else in your data which distinguishes the rows: e.g. Type Name X A Y A Z A X B Y B A C You could do it with: chart.addCategoryAxis("x", "Name"); chart.addMeasureAxis("y", "Type"); or add a count in: Name Count A 1 A 1 A 1 B...

There is only one dimension shown by the plot. Michael Friendly, in Corrgrams: Exploratory displays for correlation matrices (the corrplot documentation confusingly refers to this as his "job"), says: In the shaded row, each cell is shaded blue or red depending on the sign of the correlation, and with the...

R cannot tell which variable is which when you pass it an entire data.frame to plot. In this case, the error, 'height' must be a vector or a matrix is telling you you didn't give the plot function what it wanted. For a barplot, using ?barplot will tell you what...

If you are using funcion qtm() then you should add argument fill.style="fixed" to use your own fill scale and with argument fill.breaks= add break points. qtm(doe, fill = "sep12_PERC", fill.title = "Installs", fill.style="fixed",fill.breaks=c(0,25,50,75,100)) ...

So, it looks (as of 0.8.1) that we need to add some more convenient ways to set ranges with datetime values. That said, although this is a bit ugly, it does currently work for me: import time, datetime x_range = ( time.mktime(datetime.datetime(2014, 1, 1).timetuple())*1000, time.mktime(datetime.datetime(2016, 1, 1).timetuple())*1000 ) p =...

The state_machine gem (not to be confused with acts_as_state_machine) has this functionality. For example, from the docs: $ rake state_machine:draw FILE=vehicle.rb CLASS=Vehicle (NB: state_machine hasn't been updated since Sept. '13)...

Here is an example, for the line element you need to specify the option missing.gap() - I thought just deleting missing.wings() from the default code would work but maybe it is an internal default. You may want to consider changing Time_Period_Hours to a scale variable and doing the aggregation outside...

Try using the Graphite summarize() function. In Grafana you can find it under the "transform" functions when adding a Graphite metric. Use "1d" for aggregating by day. Then go to "Display Styles" and check only the "Bars" checkbox to get the bar plot. This won't give you nice Mo-Su labels...

Found it... The tree.nodes() method traverses the links and comes up with its own set of nodes. This is totally different than the list of nodes passed into the program by the user, which contains all the traits for each node. As a result, the original traits must be taken...

imshow expects RGB(A) values: http://matplotlib.org/api/axes_api.html?highlight=imshow#matplotlib.axes.Axes.imshow but the color module has a function to translate HSV to RGB: http://matplotlib.org/api/colors_api.html?highlight=hsv#matplotlib.colors.hsv_to_rgb so you'll want to make a MxNx3 array of your HSV data translated into RGB, and then imshow that. But hue doesn't have all the information needed to make an RGB value...

Your transitions are trouncing each other. If you look at the source code to the examples here, you'll notice this curious line in the tick function: function tick() { transition = transition.each(function() { ... According to docs: If type is not specified, behaves similarly to selection.each: immediately invokes the specified...

In fact, you can't apply CSS gradients to SVG elements. You have to use SVG gradients. To create an SVG gradient along a link in a graph, the general form would be: defs.append("linearGradient") .attr("id", gradient_id) .attr("gradientUnits", "userSpaceOnUse") .attr("x1", source.px) .attr("y1", source.py) .attr("x2", target.px) .attr("y2", target.py) .selectAll("stop") .data([ {offset: "0%", color:...

In the end, I came up with the following: Use scatterhist to create the scatter plot with marginal histograms. hold on Use convhull to get the convex hull for each group of points. Use fill to draw the convex hull. ...

You can try the heatmap.2 function from the gplots package which I like for heatmaps and it will give something very similar to the graph you are after (I rounded to second digit for the example below. Use as many digits as you want): Some data manipulation initially: mycor <-...

It would be best if you could somehow avoid plotting data that don't exist. Sometimes it gives a wrong impression. I personally disagree with @g-grothendieck's comment about the second plot, however only from an aesthetic perspective. There are indeed no points in September, but the line is slightly misleading. To...

I don't see anything major in your code. A couple of things: 1.) The sorting on your y-axis is fine. It's sorted in the order they appear in your data. As @mdml says in the comments, you can sort them differently if you desire. 2.) You have an "odd" point...

Unfortunately this functionality is baked into c3.js and the only way to change this (aside from working purely from d3) is monkey patching. You will find the offender on line 6814 of c3.js: tickExit = tick.exit().remove(), If you change this to: tickExit = function() {}, The ticks are no longer...

You need to load the tileLayer seperately so you can create a reference to it which you can then in turn use to create a layercontrol which can easily enable/disable layers: L.mapbox.accessToken = 'pk.eyJ1IjoicGF1bC12ZXJob2V2ZW4iLCJhIjoiZ1BtMWhPSSJ9.wQGnLyl1DiuIQuS0U_PtiQ'; // Create the tileLayer. var tileLayer = L.mapbox.tileLayer('examples.map-i86nkdio'); var map = L.mapbox.map('mapbox', null, { // Do...

Here's a JSFiddle with your solution: http://jsfiddle.net/ee2todev/z73u6mro/ I called the nested dataset arrayOfDatasets so the changes become more clear. First you have to call stack() for each of the datasets: arrayOfDatasets.forEach(function (dataset) {stack(dataset); }); Then you have to retrieve the max for xScale: var xScale = d3.scale.linear() .domain([0, d3.max(arrayOfDatasets, function...

With the LineCharts, you can annotate the axis values by adding an 'annotation' role column immediate after the domain (axis) column. You can add one or more rows to your DataTable that contain annotations on specific dates, even if those dates don't have any data at other points - just...

I would use a custom tooltip and render your confusion matrices in a column of the DataTable. https://developers.google.com/chart/interactive/docs/customizing_tooltip_content Here's an interactive demo with something like what you might like. Note that after converting the array to a data table I add role and html properties to the tooltip column. <!DOCTYPE...

Describe a polygon by listing its boundary vertices in order as you march around it. This polygon's boundary consists of the curve plus two more vertices at the bottom right and bottom left. To help you see them, I have overplotted the vertices, varying their colors by position in the...

You're using the wrong namespace for the div and a elements. By prefixing them with svg:, you're asking the browser to interpret them as SVG elements. The whole point of using foreignObject is to be able to use non-SVG elements though -- these are HTML elements and should be declared...

The problem is that your dataset variable is undefined when you try to access it outside of the callback function. Check out mbostock's answer to another question for the reason. Add the code for creating the representation within the callback function of the d3.csv method. To use the Total column...

When you say "color branches" I assume you mean color the edges. This seems to work, but I have to think there's a better way. Using the built-in mtcars dataset here, since you did not provide your data. plot.fan <- function(hc, nclus=3) { palette <- c('red','blue','green','orange','black')[1:nclus] clus <-cutree(hc,nclus) X <-...

If it helps anyone I used this code to remove the points: <Style TargetType="chartingToolkit:LineDataPoint"> <Setter Property="Opacity" Value="0" /> <Setter Property="Background" Value="Blue" /> </Style> The setVisibility property doesn't work and it's a known issue....

The problem is that the graph you are trying to emulate doesn't have a linear x-axis based on time (it's missing days). You'll need to use a linear scale based on the number of data points and then custom set the label values. I didn't really test this code so...

You can do this using matplotlib.pyplot.fillbetween to fill in the shaded areas. The code below is a toy example that does this for a simple quadratic. It iterates over vals and adds these to your original signal y and fills in between them. For each val in vals it modifies...

Yes, d3.nest() is what you want. d3.nest() .key(function(d) { return d.name; }) .entries(data) That will get the data into the form you need it to be; i.e. a 2D array (more accurately an array of objects with a lower-level array within each object), where the top level has 2 members...

As far as kibana is concerned it works on elastic search which operates on millions of records and pulls up the analytic numbers using aggregates and displays it as charts. Hue works on hadoop. So in short they get the stats on the bigdata using the backend support of elasticsearch(In...

Ordinal scales need to have their domain set explicitly, that is, there's no notion of "min" or "max" for an ordinal domain. You have to do something like x.domain(data[0].values.map(function (d) { return d.day; })); Complete demo here. As for the colours, you can set anything you want in CSS or...

Even though I'm not completely sure of your code I think this should work: updateActive = (id) -> node.classed("bubble-selected", (d) -> id == idValue(d)) if id for x in data when idValue(x) is id d3.select("#comment").html(commentValue(x)) else d3.select("#comment").html("<h3>Click on a bubble to read its comment.</h3>") Here data is what you supply...

You're setting the x and y attributes on the g elements to change their positions -- this won't do anything. You need to set the transform attribute instead, like you're doing when adding the g elements. So your tick handler function would contain node.attr("transform", function(d) { return "translate(" + d.x...

I suppose the first column is some threshold you varied between lines. The precision-recall graph is precision-vs-recall. Thus we can first retrieve those two columns from your data: (suppose your data are saved in prf.data). cat prf.data | awk '{print $3,$5}' You will get below two columns only and you...

A scatter plot matrix is a common way to plot multiple dimensions. Here's a plot of four continuous variables colored by a fifth categorical variable. To deal with the uneven spacing, it depends on the nature of the unevenness. You might plot it as-is if the unevenness is significant. You...

Networkx is a python module that specializes in graphs. For visualization, it uses matplotlib. in matplotlib you can either clear and re-draw the image, or use the animation functions. Clearing and re-drawing is trivial to code. I haven't used the animation functions, but I would expect faster/prettier results, at the...

You could use ggplot to do this, I transformed the data a bit, basically casted the data to add all possible trap dates to all individuals. If the individual was not trapped this add an NA in the casted data frame if the animal was not sighted. I then changed...

As @HYRY and @nicoguaro suggested in the comments above, Mayavi is much better suited for this type of work. There is a good set of examples here that I used for reference. Here is what I came up with import numpy as np from mayavi import mlab x = np.linspace(0,10,50)...

In order to display a 3D chart by setting property values at design time you need to work with the ChartArea property of the chart control. The ChartArea properties window can be displayed by clicking ChartArea collection in Chart1 properties. In the ChartArea properties window you need to set the...

Both @tom and @Joe Kington are right: this has been asked before. However, I tried to make an example with slighty less efforts as the linked answers. To use a colormap (which always maps values from [0,1] to color), you first need to normalize your data. For that you can...

I think you need to change the argument you pass to .size of pack to an array. and also add .value since your data doesn't have value attributes: https://github.com/mbostock/d3/wiki/Pack-Layout#value If value is specified, sets the value accessor to the specified function. If value is not specified, returns the current value...