data-visualization

How to set values in x axis MSChart using C#

╄→гoц情女王★ 提交于 2019-11-28 09:26:36
I have these XY values: Series S1 = new Series() S1.Points.AddXY(9, 25); S1.Points.AddXY(10, 35); S1.Points.AddXY(11, 15); chart1.Series.Add(S1); but I need to show the X values in the graph like this: X="9-10" X="10-11" X="11-12" How can I achieve that? So far this is what I've found: and here is the code: private void Form1_Shown(object sender, EventArgs e) { chart1.ChartAreas[0].AxisX.Minimum = 7; chart1.ChartAreas[0].AxisX.Maximum = 15; Series S1 = new Series(); S1.Points.AddXY(9, 25); S1.Points.AddXY(10, 35); S1.Points.AddXY(11, 15); chart1.Series.Add(S1); chart1.Series[0].Points[0]

X scale function in D3.js keeps returning undefined

心已入冬 提交于 2019-11-28 08:50:44
问题 I am new to D3.js and trying to make a bar chart with GDP on Y axis and date on X axis. I am trying to make a xScale with d3.timeScale() but for some reason the code keeps returning undefined when using it. Below is my code, what am I doing wrong? var data = [ [ "2011-01-01", 15238.4 ] , ["2015-07-01", 18064.7 ] ]; var w = 1000; var h = 300; var barPadding = 1; var svg = d3.select("#chart") .append("svg") .attr("height", h); var maxDate = d3.max(data, function(d){ return d[0]; }); var minDate

Matplotlib Colormap with two parameter

[亡魂溺海] 提交于 2019-11-28 07:58:06
问题 I am trying to represent two variables x and y on a map using colours. So far the best I can acheive is using color for one variable and transparancy for another. plt.Polygon(shape.points, fill=False, color=cmap(y), alpha=x) Is it possible to create a 2D colormap in matplotlib that takes two variables? 回答1: In general colormaps in matplotlib are 1D, i.e. they map a scalar to a color. In order to obtain a 2D colormap one would need to somehow invent a mapping of two scalars to a color. While

D3.js, force-graph, cannot display text/label of nodes

自作多情 提交于 2019-11-28 07:41:08
问题 I cannot display labels of nodes using a force-layout in d3.js. I'm trying with this example http://d3js.org/d3.v3.min.js I updated that code only adding zoom, like this: var svg = d3.select("body").append("svg").attr("width", width).attr("height", height).append('svg:g').call(d3.behavior.zoom().on("zoom", redraw)); function redraw() { console.log("here", d3.event.translate, d3.event.scale); svg.attr("transform", "translate(" + d3.event.translate + ")" + " scale(" + d3.event.scale + ")");

ggplot scale color gradient to range outside of data range

一世执手 提交于 2019-11-28 07:24:56
I am looking for a way to stretch a color gradient between two values and label the legend, regardless of the range of data values in the dataset. Essentially, is there a functional equivalent to ylim() for color gradients? Given code which plots a z value typically between -1 and 1, I can plot and label a gradient if the breaks are within the data range: library(ggplot2) #generator from http://docs.ggplot2.org/current/geom_tile.html pp <- function (n, r = 4) { x <- seq(-r * pi, r * pi, len = n) df <- expand.grid(x = x, y = x) df$r <- sqrt(df$x^2 + df$y^2) df$z <- cos(df$r^2) * exp(-df$r / 6)

How to plot non-square Seaborn jointplot or JointGrid

别等时光非礼了梦想. 提交于 2019-11-28 07:16:03
问题 I am trying to plot my non-symmetric data using Seaborn's JointGrid. I can get it to use an equal aspect ratio, but then I have unwanted whitespace: How do you remove the padding? The documentation for both jointplot and JointGrid simply say size : numeric, optional Size of the figure (it will be square). I also tried going into feeding the extent kwarg to both jointplot and JointGrid, as well as ylim with no luck. import numpy as np import seaborn as sns import matplotlib.pyplot as plt x =

Collapsible D3 force directed graph with non-tree data

半腔热情 提交于 2019-11-28 06:05:14
问题 I have a D3 force directed graph using non-tree data and ID associations vs index. I cannot seem to find an example of this structure of data in a collapsible force layout. Basically, when you click a node, the data for that node should collapse/expand like this example: http://bl.ocks.org/mbostock/1062288. The last answer to this questions got close but is linking nodes by index rather than id: How to create d3.js Collapsible force layout with non tree data? Here is a fiddle of my code https

How to render audio waveform?

让人想犯罪 __ 提交于 2019-11-28 04:26:55
问题 Is there any audio/programming-related stack-exchange site? I'm trying to make a wave form in WinForms What algorithm should I use? For example, if I have 200 samples per pixel (vertical line), should I draw the lowest and the highest sample from that portion of 200 samples? Or should I draw average of low and high samples? Maybe both in different colors? 回答1: Try dsp.stackexchange.com At 200 samples per pixel, there are several approaches you can try. Whatever you do, it often works best to

What techniques exists in R to visualize a “distance matrix”?

谁都会走 提交于 2019-11-28 02:49:07
I wish to present a distance matrix in an article I am writing, and I am looking for good visualization for it. So far I came across balloon plots (I used it here , but I don't think it will work in this case), heatmaps (here is a nice example , but they don't allow to present the numbers in the table, correct me if I am wrong. Maybe half the table in colors and half with numbers would be cool) and lastly correlation ellipse plots (here is some code and example - which is cool to use a shape, but I am not sure how to use it here). There are also various clustering methods but they will

dimple js straight line y-axis over bar chart

删除回忆录丶 提交于 2019-11-28 02:12:29
问题 I am trying to draw Average, High and Low value straight line on a dimple js bar chart. I have no clue how they can be drawn on y-axis (cost) as straight line that will cut through the bars. Here is the fiddle that has high, low and average values saved into corresponding variable that needed to be drawnon the chart. Any solution? jsfiddle link: http://jsfiddle.net/Ra2xS/14/ var dim = {"width":590,"height":450}; //chart container width var data = [{"date":"01-02-2010","cost":"11