data-visualization

How can I fill the background with a color scale in function of a lineal model?

拟墨画扇 提交于 2019-12-12 11:52:48
问题 I'm analysing an example of datavis in "The Functional Art " of Alberto Cairo (I recomend to you) In that book, there are this example And I try in R. In the bottom left graph (scatter plot) I use the data from the book, and i calculate the efectives militaries in function of population with lm(efect ~ pop) and the budget in function of population + efect And here is the question: How can I paint the background of the scatterplot with colorscale (gradient) where the color represent the value

R and googleVis - possible to make a “motion map”?

淺唱寂寞╮ 提交于 2019-12-12 11:21:34
问题 I am typically using R to do statistical analysis, and rather new to the data visualization capabilities. I'm trying to figure out if there is some way to marry the motion chart package gvisMotionChart with the mapping package, gvisGeoMap . I'd like to display a video of events over time, appearing on a map on their date of occurrence at lat/lon coordinates and then fading out. Anyone know if it's possible to do this? Any additional concerns if I have over 50,000 records (daily over 5 years)

How to hide legend with Plotly Express and Plotly

时间秒杀一切 提交于 2019-12-12 11:19:25
问题 I am trying to learn Plotly by firstly creating a simple bar chart in Plotly Express and then updating it with Plotly to finesse it. I would like to hide the legend. I am trying to update the original figure by hiding the legend, and I can't get it to work. This is my traceback error. And my code import plotly.plotly as py import plotly.graph_objs as go import plotly_express as px import pandas as pd df = pd.read_csv('C:/Users/Documents/Python/CKANMay.csv') fig = px.bar(df, x="Publisher", y=

How do I extract data from a Bokeh ColumnDatasource

元气小坏坏 提交于 2019-12-12 10:54:43
问题 I was trying to avoid using a ColumnDataSource and instead of that I was passing pandas dataframe columns directly to Bokeh plots. Soon though I had to implement a HoverTool which requires to have the data in a ColumnDataSource. So, I started using ColumnDataSource. Now, I was creating a box annotation and I had to use the maximum value of a certain column from my data to define the top border of the box. I can do that easily using pandas: low_box = BoxAnnotation( top=flowers['petal_width']

Placing a circle over a sparkline when the user changes the ordering of the data

喜欢而已 提交于 2019-12-12 08:19:51
问题 I created this question a few days ago regarding the ordering of sparklines when the user chooses to change the order of the data. The answer has solved the problem but remains the correct positioning of the red circles that highlight where the user place the mouse. This is the code: PLUNKER. I thought about how to change the code to reposition the sparkline circles when the data sort changes. I didn't understand where and how to change the code. Below I try to explain my reasoning based on

Single column stacked bar chart in dc.js

不打扰是莪最后的温柔 提交于 2019-12-12 05:56:40
问题 I've been working with dc.js and quite enjoyed the multiple time series, visualised as stacked charts. However, I cannot figure out how to do a single-column stacked chart. My dataset details air strikes. One row per strike, identifying a country, location, and all that stuff. The idea is to have on a single column a stacks of different importance (area) depending on the number of strikes by each country. Such as in this image: Thanks so much for your help! 来源: https://stackoverflow.com

Bokeh figure doesn't show

梦想的初衷 提交于 2019-12-12 04:32:55
问题 I am new to python. I tried the example given in here http://docs.bokeh.org/en/latest/docs/gallery/color_scatter.html with my own dataset, which looks like this Unnamed: 0 fans id stars 0 0 69 18kPq7GPye-YQ3LyKyAZPw 4.14 1 1 1345 rpOyqD_893cqmDAtJLbdog 3.67 2 2 105 4U9kSBLuBDU391x6bxU-YA 3.68 3 3 2 fHtTaujcyKvXglE33Z5yIw 4.64 4 4 5 SIBCL7HBkrP4llolm4SC2A 3.80 here's my code: import pandas as pd from bokeh.plotting import figure, show, output_file op = pd.read_csv('FansStars.csv') x = op.stars

Seasborn Distplot goes unresponsive

你。 提交于 2019-12-12 03:36:57
问题 I am trying to plot a simple Distplot using pandas and seaborn to understand the density of the datasets. Input #Car,45 #photo,4 #movie,6 #life,1 #Horse,14 #Pets,20 #run,67 #picture,89 The dataset has above 10K rows, no headers and I am trying to use col[1] code import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns df = pd.read_csv('keyword.csv', delimiter=',', header=None, usecols=[1]) #print df sns.distplot(df) plt.show() No error as I can print the

remove data points when using stat_summary to generate mean and confidence band

空扰寡人 提交于 2019-12-12 01:26:39
问题 I am using qplot to summarize a dataset and generate a plot for 2 ACL injured athletes that shows the mean EMG and 95% confidence interval band for different phases of a continuous jumping movement. Each athlete performed 20 jumps so this provides a summary of all 20 jumps for each athlete. Is there a straightforward method in qplot to generate a figure that shows only the mean value and the confidence band (i.e. that removes the individual data points)? I think this is a cleaner way of

Plotting horizontal lines across histogram bars

心不动则不痛 提交于 2019-12-12 01:07:33
问题 I have an experiment where I measured the performance of some algorithms relative to three baselines. I'd therefore like to plot histograms for the algorithms, with horizontal lines of various styles drawn through the histogram bars to show the baselines. Below is an example which I produced by manually drawing horizontal lines on a graph produced by Gnuplot. The histograms "sentence" and "document" represent the algorithms I tested, and "mono", "random", and "MFS" are the baselines. Is there