data-visualization

Matplotlib Colormap with two parameter

放肆的年华 提交于 2019-11-29 14:20:22
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? ImportanceOfBeingErnest 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 this is in principle possible, it's not as convenient as the usual colormaps. An

Auto-Interval precision in MS Chart

*爱你&永不变心* 提交于 2019-11-29 12:35:01
问题 I'm currently using the charting within .NET using System.Windows.Forms.DataVisualization.Charting.Chart . Thus far it seems very powerful, and works great. However, there is a huge problem in terms of how it is auto-calculating intervals. I use a lot of double values, and in libraries like ZedGraph, it handles this perfectly. It selects min/max/interval just fine. However, in MS Chart, it may select 206.3334539832 as a minimum, and intervals of a similar decimal precision. Obviously this

How to render audio waveform?

浪子不回头ぞ 提交于 2019-11-29 11:02:52
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? Try dsp.stackexchange.com At 200 samples per pixel, there are several approaches you can try. Whatever you do, it often works best to draw each vertical line both above and below 0, ie. treat positive and negative sample values seperately.

R: ggplot display all dates on x axis

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-29 10:10:37
问题 I have the following data set structure(list(Date = structure(c(16636, 16667, 16698, 16728, 16759, 16789, 16820, 16851, 16880, 16911, 16636, 16667, 16698, 16728, 16759, 16789, 16820, 16851, 16880, 16911, 16636, 16667, 16698, 16728, 16759, 16789, 16820, 16851, 16880, 16911, 16636, 16667, 16698, 16728, 16759, 16789, 16820, 16851, 16880, 16911, 16636, 16667, 16698, 16728, 16759, 16789, 16820, 16851, 16880, 16911), class = "Date"), Wheel = structure(c(5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 12L,

ggplot2 log transformation for data and scales

谁说胖子不能爱 提交于 2019-11-29 08:30:24
This is a follow-up to my previous question Integrating ggplot2 with user-defined stat_function() , which I've answered myself yesterday. My current problem is that, in the following reproducible example, lines, which are supposed to plot components of the data values' mixture distribution , neither appear in the expected places, nor they're of expected shape, as shown below (see the red lines at y=0 in the second figure). Complete reproducible example : library(ggplot2) library(scales) library(RColorBrewer) library(mixtools) NUM_COMPONENTS <- 2 set.seed(12345) # for reproducibility data

Matplotlib scatter plot - Remove white padding

梦想与她 提交于 2019-11-29 08:20:53
I'm working with matplotlib to plot a variable in latitude longitude coordinates. The problem is that this image cannot include axes or borders. I have been able to remove axis, but the white padding around my image has to be completely removed (see example images from code below here: http://imgur.com/a/W0vy9 ) . I have tried several methods from Google searches, including these StackOverflow methodologies: Remove padding from matplotlib plotting How to remove padding/border in a matplotlib subplot (SOLVED) Matplotlib plots: removing axis, legends and white spaces but nothing has worked in

Adding Image inside Linechart points in ChartJs

陌路散爱 提交于 2019-11-29 07:08:25
问题 I'm developing a project using ChartJs. I am trying to add icon image inside the line chart instead of points . I'm attaching an image in which I demonstrate the above requirements. In that image, there is a ChartJs image and a reference image. I would like to add an image inside the line chart of ChartJs exactly like in the reference image(sun and cloud icon). Is it possible in ChartJs? 回答1: As said in the Chart.js line chart data structure ( pointStyle attribute ) : pointStyle String, Array

Connect ggplot boxplots using lines and multiple factor

≡放荡痞女 提交于 2019-11-29 05:20:45
I'm trying to connect ggplot2 boxplots with geom_lines for multiple factors. I'd been able to accomplish so far to connect all the boxplot with lines, see attach picture. But I wish to connect the only boxplots by their corresponding factor. For example for my variable FL, I want to connect only those two boxplot, without connecting them with the remaining variables. Similarly for the variable RW, connecting those two sex boxplot without the remaining others. library("MASS") data(crabs) melt_crabs <- melt(crabs,id.var=c("sp","sex","index")) ggplot(melt_crabs, aes(x = variable, y = value)) +

Force a gap between points on the x axis (MS .Net Chart Controls, Column Chart)

你。 提交于 2019-11-29 04:49:20
I have a column chart with multiple series each containing multiple points. Currently the columns all touch each other. I want to force a gap between each column. How can I achieve this? I found that applying a PointWidth ( Chart1.Series[seriesName]["PointWidth"] = (0.6).ToString(); ) gives me a separation between the x value groups but not between each series point in an individual group (which I need). Using an empty spacer series as suggested elsewhere does not solve the problem. I am using .Net 4, VS 2010, Web Application. My chart code follows: using System; using System.Collections

making an arc in d3.js

百般思念 提交于 2019-11-29 03:28:36
I am using the javascript library d3.js ( http://d3js.org/ ) to create canvas data visualizations. I'm trying to make an arc, but it's not accepting the data parameters from my array. Does anyone know what I'm doing wrong? This is my code: var chartConfig = { "canvasSize" : 800 } var radius = chartConfig.canvasSize / 2; var pi = Math.PI; var vis = d3.select("#chart").append("svg") .attr("width", radius * 2) .attr("height", radius * 2) .append("g") .attr("transform", "translate(" + radius + "," + radius + ")"); var arcData = [ {aS: 0, aE: 45,rI:radius/2,rO:radius} ]; var arc = vis.selectAll(