data-visualization

Scatter plot with variable marker size (seaborn)

半腔热情 提交于 2019-12-03 16:21:42
I am using a seaborn pairplot to plot a scatter plot of different dimensions of my datapoints. However, I want the markers of the datapoints to have a size that corresponds to one of the dimensions of the datapoints. I have the following code: markersize = 1000* my_dataframe['dim_size'] / sum(my_dataframe['dim_size']) sns.set_context("notebook", font_scale=1.5, rc={'figure.figsize': [11, 8]}) sns.set_style("darkgrid", {"axes.facecolor": ".9"}) kws = dict(s=markersize, linewidth=.5, edgecolor="w") sbax = sns.pairplot(my_dataframe, hue='dim_hue' x_vars=['dim_1', 'dim_2'], y_vars=['dim_3', 'dim_4

How to create a 'stacked waterfall' chart in R?

拥有回忆 提交于 2019-12-03 14:14:27
I was able to find several packages to create a waterfall chart in R which look like this: But I could not find a way to create a stacked waterfall charts which look like this: A work around is to use stacked bar chart. But that is not an elegant way. So, I wanted to know if there is a better way to create stacked waterfall chart in R. You can easily create the "main" plot with ggplot2 once you have the "right" data. To replicate the plot you want with the choices of color, text, lines, etc., takes more work, but is doable. The trick to plot waterfall charts with ggplot2 is to create a data

Python, Seaborn: how to replicate corrplot?

好久不见. 提交于 2019-12-03 13:36:50
问题 I'm taking a course on UDemy about data visualization (I'd recommend it to you, but it might look as spam), prior to that course, I've been using matplotlib to do my visualizations, so Seaborn is quite new to me. In the course they talk about corrplot() function, which can produce something like the following chart: But now, corrplot() has been deprecated. I've been looking in the Seaborn documentation, and some links on the web, and the "closer" I've done is this: Of course, I like much more

How do I control the bounce entry of a Force Directed Graph in D3?

∥☆過路亽.° 提交于 2019-12-03 13:31:08
I've been able to build a Force Directed Graph using a Force Layout. Most features work great but the one big issue I'm having is that, on starting the layout, it bounces all over the page (in and out of the canvas boundary) before settling to its location on the canvas. I've tried using alpha to control it but it doesn't seem to work: // Create a force layout and bind Nodes and Links var force = d3.layout.force() .charge(-1000) .nodes(nodeSet) .links(linkSet) .size([width/8, height/10]) .linkDistance( function(d) { if (width < height) { return width*1/3; } else { return height*1/3 } } ) //

Visual Treemap in Winforms

半腔热情 提交于 2019-12-03 12:47:23
问题 Are there any frameworks for building squarified treemaps in C# 2.0 WinForms? Something similar to this: (from http://www.codeproject.com/KB/recipes/treemaps.aspx) 回答1: Microsoft Research put one together. Don't know how easy it is use. http://research.microsoft.com/en-us/downloads/dda33e92-f0e8-4961-baaa-98160a006c27/default.aspx 回答2: I know you asked about WinForms, but I'm sure someone will hit this page when searching for WPF tree maps. This currently seems to be the best WPF freebie out

Add legend to geom_line() graph in r

纵饮孤独 提交于 2019-12-03 10:22:52
I've been trying to add legend to my ggplot, but failed miserably. I tried the function scale_colour_manual() , but the legend doesn't show up. ggplot()+ geom_line(data=Summary,aes(y=Y1,x= X),colour="darkblue",size=1 )+ geom_line(data=Summary,aes(y=Y2,x= X),colour="red",size=1 ) My dataframe 'Summary' is as follows: X Y1 Y2 139 1.465477e+16 7.173075e+15 277 1.044803e+16 9.275002e+15 415 1.059258e+16 8.562518e+15 553 1.033283e+16 8.268984e+15 691 9.548019e+15 1.022248e+16 830 1.008212e+16 8.641891e+15 968 9.822061e+15 9.315856e+15 1106 9.948143e+15 9.178694e+15 1244 1.013922e+16 8.825904e+15

Web visualisations for data?

余生长醉 提交于 2019-12-03 10:16:50
问题 I would like to display a bunch of data in a meaningful way through visualizations on a site. I have been experimenting with RaphaelJS library, but performance on IE8 is terrible , and HTML5 canvas is still not widely supported . So I'm left with Flash and any existing libraries. On the flash side there seem to be many, but because of this I am a bit lost and don't have the possibility to experiment with each one. ( I will list any libraries that people have pointed out here. ) Flash / Flex:

How to plot 3D scatter diagram using ggplot?

一笑奈何 提交于 2019-12-03 08:58:53
问题 I tried to use "plotly" function but It is not working in my case at all. "ggplot" is working is in a case of 2D but it is giving an error when adding one more axis. How to solve this issue? ggplot(data,aes(x=D1,y=D2,z=D3,color=Sample))+geom_point() How to add one more axis and get the 3D plot in this? Thank You. 回答1: Since you tagged your question with plotly and said that you've tried to use it with plotly, I think it would be helpful to give you a working code solution in plotly : Creating

How to capture value of dropdown widget in bokeh python?

不问归期 提交于 2019-12-03 08:50:10
The official documentation of bokeh 0.12.1 in the link give the below code for creating a dropdown. http://bokeh.pydata.org/en/latest/docs/user_guide/interaction/widgets.html#userguide-interaction-widgets But its doesn't clearly mention how to capture the value of the dropdown widget when someone click and selects a value from the dropdown. 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=

Fill under line curve

柔情痞子 提交于 2019-12-03 08:21:27
For the sample dataset below, I would like to just plot the y as a smooth line with fill under the line using R. I am able to get smooth line but not the color filled curve. Could someone please help me here? date, y 2015-03-11, 71.12 2015-03-10, 34.0 2015-03-09, 11.1 2015-03-08, 9.62 2015-03-07, 25.97 2015-03-06, 49.7 2015-03-05, 38.05 2015-03-04, 38.05 2015-03-03, 29.75 2015-03-02, 35.85 2015-03-01, 30.65 The code I used to plot the smooth line is as follows. I am unable to get fill the portion under the line with a color y <- df$y x <- 1:length(y) plot(x, y, type='n') smooth = smooth.spline