data-visualization

Plotly - Create Pie Chart with continuous color scale

笑着哭i 提交于 2019-12-11 03:07:41
问题 I'm looking to create a plotly chart where the colors of each slice another variable in the dataframe. This is pretty simple to do in ggplot2, however, I'm struggling to convert this to plotly. My sample code is here: Product <- c("Product1","Product2","Product3","Product4","Product5","Product6","Product7") Value <- c(1000000,200002,599996,1399994,2199992,2999990,3799988) Rating = c(0.24, 0.28, 0.17, 0.1, 0.5, 0.6, 0.34) df <- data.frame(Product,Value, Rating) plot_ly(df, labels = ~Product,

visualizing RDF query result

元气小坏坏 提交于 2019-12-11 03:03:24
问题 My SPARQL Query returns a set of results, I want to visualize the Query results using an RDF Visualization algorithm, such that the results are related together and also I retrieve some more info about it. Example: if My domain is Movie industry, and I query about all movies directed by James Cameron, I get about 10 or 11 results, something like, 'The Terminator' 'Rambo: First Blood Part II' 'Aliens' 'The Abyss' 'Terminator 2: Judgment Day ' 'True Lies' 'Titanic' 'Avatar' I want to make a

How to use a colored shape as yticks in matplotlib or seaborn?

人走茶凉 提交于 2019-12-11 02:46:33
问题 I am working on a task called knowledge tracing which estimates the student mastery level over time. I would like to plot a similar figure as below using the Matplotlib or Seaborn. It uses different colors to represent a knowledge concept, instead of a text. However, I have googled and found there is no article is talking about how we can do this. I tried the following # simulate a record of student mastery level student_mastery = np.random.rand(5, 30) df = pd.DataFrame(student_mastery) #

D3 scatterplot using time scale on x-axis — not working in Firefox

心不动则不痛 提交于 2019-12-11 02:43:04
问题 I've created a pretty simple scatterplot showing a person's weightlifting progress over time. The x-axis is a time scale in days (there's one circle for each day) and the y-axis is the number of pounds lifted that day. The scatterplot works in Chrome, but not Firefox. It has something to do with using a date object as the x-position of the circles. Take a look at the chart in Chrome Here are two rows of my dataset, to show how it is formatted (the date is the first item of each row): ["2011

Return Value first time condition is met

血红的双手。 提交于 2019-12-11 01:28:20
问题 I have a calculation, and I only want to return the left most value ie, the first time the condition is met. In the images it shows 95% 96% etc etc I only care for the column 5 where the condition of 95 is met. EDIT(more info) Ok so the percentages are calculated this way. ROUND( RUNNING_SUM( SUM( [days_to_close_cnt] ) )/ SUM([newo_dt_cnt]),2 ) Using and the "Days to Close" gives me the column information. The Line graph looks like this. if [% Completed] >= .98 and [% Completed] < 1 then INT(

Scatter plot with color of data points specified with the data

风流意气都作罢 提交于 2019-12-11 00:44:36
问题 This question was migrated from Cross Validated because it can be answered on Stack Overflow. Migrated 7 years ago . I'm trying to create a pretty simple scatter plot with two data series. I would like to specify the color of each point through a fourth column in the dataframe I'm using. I've got the scatter plot itself close to where I want it, with two different glyphs for the two series, but the colors are not being assigned to the right points. I'm pretty new to R so I'm not sure where to

custom axis labels plotting a forecast in R

坚强是说给别人听的谎言 提交于 2019-12-11 00:41:48
问题 This question was migrated from Cross Validated because it can be answered on Stack Overflow. Migrated 5 years ago . I'm trying to get some sensible labels on a forecast. Here's my code: library("forecast") t <- ts( c( 4410.0, 6435.0, 4939.0, 6487.0, 25521.0, 18764.0, 12223.0, 18590.0, 36898.0, 28826.0, 20329.0 ) , frequency = 4 , start=c(2011, 7, 1) ) cast <- meanf(t,h=4) par(mfrow=c(1,1),xaxt="n") plot(cast) ticks <- seq(as.POSIXct("2011-07-01"), by = "3 month", length.out=length(cast) + 4)

How does one include sparklines and other per-row graphics in a Google Table (or similar)?

江枫思渺然 提交于 2019-12-11 00:32:15
问题 I have a table that makes extensive use of the features in Google Charts' Table Chart, notably, sorting by selected column and color gradients. I'd like to add a sparkline column. Can anyone suggest methods for doing so? Google Sparkline doesn't appear to be at all integrable. The only method I've come up with (I haven't tried it) is to create a set of images and set them as the CSS background, one cell at a time. Blecch. I also have a need to show something like a pie chart or stacked bar

D3 nodes and links from JSON with nested arrays of children

≯℡__Kan透↙ 提交于 2019-12-10 23:58:18
问题 I've got a JSON file that looks like this: { Object: { children: Array[4] ... Object: { children: Array[1] Object: { children: Array[3] ... }, Object: { children: Array[1] ... }, ... } ... } The array is a bunch of objects that have arrays of children that contain arrays of children going a few levels deep. My problem is when I try to turn this into a set of nodes and links for use in a d3 force layout, I can't get it to display properly. I've tried using array.map or forEach to recursively

Geo heat map(google) with large data

岁酱吖の 提交于 2019-12-10 23:19:59
问题 I want to plot a heat map in google map to show the taxi-ride distribution of a city. I got around 4000 data of the taxi-ride starting location(latitude and longitude). Here are some of my script: First I set up the google map: var hongkong = new google.maps.LatLng(22.28552,114.15769 ); map = new google.maps.Map(document.getElementById('map'), { center: hongkong, zoom: 11, }); Then, I read the data from JSON file and make a heat map: jQuery.getJSON("data.json", function(data) { var