data-visualization

Aesthetics must be either length 1 or the same as the data (207): x, y

独自空忆成欢 提交于 2019-12-24 08:30:45
问题 I just merged two datasets horizontally in R, but when I consequently try to plot two variables (one from the first and one from the second dataset), I get the message 'Aesthetics must be either length 1 or the same as the data (207): x, y' TreismanData2<-read_dta("TreismanData.dta") library(ggplot2) TreismanData3<-merge(TreismanData2, QT_Row, by="wbcode") attach(TreismanData3) scatterGCBPI<-ggplot(TreismanData2, aes(cpi2007, GCB2013)) scatterGCBPI+geom_point(position = "jitter")+geom_smooth

What should I add to add red-markers on the orange curve in Matplotlib?

帅比萌擦擦* 提交于 2019-12-24 07:28:25
问题 Here is my code and I need put markers on the orange curve halflife = 0.25 resolution_per_second = 1000 values = np.concatenate([np.zeros(resolution_per_second), np.ones(resolution_per_second * 2), np.zeros(resolution_per_second), np.ones(resolution_per_second * 1), np.zeros(resolution_per_second * 2), ]) t_grid = np.arange(0, len(values)) / resolution_per_second step = 1.0 / resolution_per_second k = np.power(0.5, 1 / (halflife * resolution_per_second)) def ema_fixed_step(y, k): #ema method

How to plot several line charts in one figure (overlay/groupby)

醉酒当歌 提交于 2019-12-24 03:08:35
问题 I would like to illustrate the change in one variable for several persons in my data over time. I have several issues with basic commands here. Here is my data: import pandas as pd df = pd.DataFrame({'year': ['1988', '1989', '1990', '1988', '1989', '1990', '1988', '1989', '1990'], 'id': ['1', '1', '1', '2', '2', '2', '3', '3', '3'], 'money': ['5', '7', '8', '8', '3', '3', '7', '8', '10']}).astype(int) df.info() df I tried to make use of matplotlib and started to loop for each of my unique IDs

Group log file data by time interval in d3

故事扮演 提交于 2019-12-24 02:18:29
问题 I have some log file data that I would like to graph. For one log file, every time an event happens a line is added to the log file. I can get it so that the data looks like this: data = [ { "click": true, "date": "2013-06-23T14:37:27.000Z" }, { "click": true, "date": "2013-06-23T14:36:02.000Z" }, ... ... ... ] Now, what I would like to do is view this data on a time line, so I can see how many clicks happen over time. However, I think I need to group this data by intervals (1 minute or 15

Overlapping bar chart with multiple axis in PowerBi

喜你入骨 提交于 2019-12-24 01:37:28
问题 I would like to have a overlapping bar chart in PowerBi with multiple axis. I have an example from Excel which I would prefer to recreate in PowerBi if this is possible. Here the example: Is this possible in PowerBi? Maybe by using a custom visual I don't know off. Thanks in advance, 回答1: Multiple axes? Yes! Overlapping bars? No! Using a Line and Clustered Column Chart is the way to go: Here's a demo using some random numbers: Date A B C 07.08.2018 0,359008828 0,993689927 0,8 08.08.2018 0

d3.js Force layout only applied vertically

泄露秘密 提交于 2019-12-24 00:03:08
问题 I'm doing a data visualisation with d3. To give you some context, the graph contains about 400 nodes (all data is loaded from multiple json files) that are connected to each other they are all mapped by year in a timeline (x axis) the position in the y axis is completely randomized the nodes have all different sizes Now my question: How can I distribute the nodes in the y axis so that they don't overlap? You can checkout the full sourcecode on the GitHub Repository (work in progress -

Y axes on the logit scale and centered in gbm.plot

和自甴很熟 提交于 2019-12-23 22:59:55
问题 I am currently exploring the gbm functions in the package dismo to create boosted regression trees for species distribution modeling. I have been using the dismo vignettes as well as the 2008 paper "A working guide to boosted regression trees" by Elith et al., published in the Journal of Animal Ecology. On page 808:809 of the Elith et al. article, the authors explain partial dependence plots and give an example at the bottom of page 809 (Fig. 6). According to the dismo vignette "Boosted

Visualizing a chart using c3

依然范特西╮ 提交于 2019-12-23 22:34:19
问题 I am trying to reproduce some code to generate a chart using c3. This script does not render anything though. Why? (the files listed in href are in the same folder) <!DOCTYPE html> <html> <head> <!-- Load c3.css --> <link href="c3.css" rel="stylesheet" type="text/css"> <!-- Load d3.js and c3.js --> <script src="d3.v3.min.js" charset="utf-8"></script> <script src="c3.min.js"></script> <meta charset="UTF-8"> <title>title </title> </head> <body> <div id="chart"></div> <script> var chart = c3

Plotting a ROC curve from a random forest classification

自作多情 提交于 2019-12-23 21:40:03
问题 I'm trying to plot ROC curve of a random forest classification. Plotting works, but I think I'm plotting the wrong data since the resulting plot only has one point (the accuracy). This is the code I use: set.seed(55) data.controls <- cforest_unbiased(ntree=100, mtry=3) data.rf <- cforest(type ~ ., data = dataset ,controls=data.controls) pred <- predict(data.rf, type="response") preds <- prediction(as.numeric(pred), dataset$type) perf <- performance(preds,"tpr","fpr") performance(preds,"auc")

How to stop showing decimal points in Y Axis in WPF DataVisualization charts

前提是你 提交于 2019-12-23 21:01:11
问题 I am using WPF DataVisualization chart control to show some sample data. My problem is Y axis is showing decimal values. How can I make it show only integer values. This is my XAML code for the <chartingToolkit:Chart Margin="0,30,0,30" Name="columnChart" Title="" Foreground="Black" > <chartingToolkit:ColumnSeries DependentValuePath="Value" Background="Red" IndependentValuePath="Key" ItemsSource="{Binding}" > <chartingToolkit:ColumnSeries.DataPointStyle> <Style TargetType="Control"> <Setter