data-visualization

R: plotting graphs (ggplot vs autoplot)

随声附和 提交于 2021-01-05 08:57:34
问题 I am following a R tutorial over here https://rviews.rstudio.com/2017/09/25/survival-analysis-with-r/ The computer I use for work does not have internet access nor a USB port - it only has R with some preinstalled libraries. The tutorial requires "survival", "ggplot2", "ranger", "dplyr" and "ggfortify". The computer I use for work has all of these libraries EXCEPT ggfortfiy. Apparently, a function called "autoplot" is required from the ggfortify library to make some of the plots in this

R: plotting graphs (ggplot vs autoplot)

谁说胖子不能爱 提交于 2021-01-05 08:56:05
问题 I am following a R tutorial over here https://rviews.rstudio.com/2017/09/25/survival-analysis-with-r/ The computer I use for work does not have internet access nor a USB port - it only has R with some preinstalled libraries. The tutorial requires "survival", "ggplot2", "ranger", "dplyr" and "ggfortify". The computer I use for work has all of these libraries EXCEPT ggfortfiy. Apparently, a function called "autoplot" is required from the ggfortify library to make some of the plots in this

Regular Graph Plot Works, Interactive Shows up Blank

谁说我不能喝 提交于 2021-01-05 08:53:14
问题 I am able to produce a regular plot just fine, but for some reason when I pass it through an interactive plotting function - there is a blank output. Does anyone know what I am doing wrong? library(igraph) library(visNetwork) #create relationships data_a <-data.frame( "source" = c("123","124","123","125","123"), "target" = c("126", "123", "125", "122", "111")) #create edges Nodes <-data.frame( "source" = c("123","124","125","122","111", "126"), "Country" = c("usa", "uk", "uk", "usa", "uk",

R: plot larger components (clarifying another stackoverflow post)

点点圈 提交于 2021-01-05 07:16:05
问题 I am looking at this stackoverflow plot over here: How to plot only large communities/clusters in R library(igraph) set.seed(1) g1 <- erdos.renyi.game(100, 1 / 70) cls <- clusters(g1) g2 <- delete_vertices(g1, V(g1)[cls$membership %in% which(cls$csize <= 10)]) plot(g2) It seems that first a random graph is created (called "g1"). Then the "cluster()" function is used to find out "isolated subgraphs" of "g1". All the "isolated subgraphs of g1" are stored in another object called "cls". The user

Plotting two variables then coloring by a third variable

不打扰是莪最后的温柔 提交于 2021-01-04 02:36:09
问题 I have a dataset from an aircraft flight and I am trying to plot the position of the plane (longitude x latitude) then color that line by the altitude of the plan at those coordinates. My code looks like this: lat_data = np.array( [ 39.916294, 39.87139 , 39.8005 , 39.70801 , 39.64645 , 39.58172 , 39.537853, 39.55141 , 39.6787 , 39.796528, 39.91702 , 40.008347, 40.09513 , 40.144157, 40.090584, 39.96447 , 39.838924, 39.712112, 39.597103, 39.488377, 39.499096, 39.99354 , 40.112175, 39.77281 , 39

Plotting two variables then coloring by a third variable

醉酒当歌 提交于 2021-01-04 02:35:26
问题 I have a dataset from an aircraft flight and I am trying to plot the position of the plane (longitude x latitude) then color that line by the altitude of the plan at those coordinates. My code looks like this: lat_data = np.array( [ 39.916294, 39.87139 , 39.8005 , 39.70801 , 39.64645 , 39.58172 , 39.537853, 39.55141 , 39.6787 , 39.796528, 39.91702 , 40.008347, 40.09513 , 40.144157, 40.090584, 39.96447 , 39.838924, 39.712112, 39.597103, 39.488377, 39.499096, 39.99354 , 40.112175, 39.77281 , 39

R: connect points on a graph (ggplot2)

孤街浪徒 提交于 2021-01-01 09:26:53
问题 Suppose I have data in the following form: library(ggplot2) Data <- data.frame( "ID" = c("ABC111", "ABC111", "ABC111", "ABC111", "ABC112", "ABC112", "ABC112", "ABC113", "ABC113", "ABC114", "ABC115"), "color" = c("red", "red", "red", "red", "blue", "blue", "blue", "green", "green", "black", "yellow"), "start_date" = c("2005/01/01", "2006/01/01", "2007/01/01", "2008/01/01", "2009/01/01", "2010/01/01", "2011/01/01", "2012/01/01", "2013/01/01", "2014/01/01", "2015/01/01"), "end_date" = c("2005/09

How to plot multiple figures in a row using seaborn

谁说胖子不能爱 提交于 2020-12-30 02:14:50
问题 I have a dataframe df that looks like this: df.head() id feedback nlp_model similarity_score 0xijh4 1 tfidf 0.36 0sdnj7 -1 lda 0.89 kjh458 1 doc2vec 0.78 .... I want to plot similairty_score versus feedback in a boxplot form using seaborn for each of the unique values in the model column: tfidf , lda , doc2vec . My code for this is as follows: fig, ax = plt.subplots(figsize=(10,8)) ax = sns.boxplot(x="feedback", y="similarity_score", data=df[df.nlp_model=='tfidf']) ax = sns.swarmplot(x=

Visualise word2vec generated from gensim

≯℡__Kan透↙ 提交于 2020-12-27 08:20:30
问题 I have trained a doc2vec and corresponding word2vec on my own corpus using gensim. I want to visualise the word2vec using t-sne with the words. As in, each dot in the figure has the "word" also with it. I looked at a similar question here : t-sne on word2vec Following it, I have this code : import gensim import gensim.models as g from sklearn.manifold import TSNE import re import matplotlib.pyplot as plt modelPath="/Users/tarun/Desktop/PE/doc2vec/model3_100_newCorpus60_1min_6window

Visualise word2vec generated from gensim

。_饼干妹妹 提交于 2020-12-27 08:18:05
问题 I have trained a doc2vec and corresponding word2vec on my own corpus using gensim. I want to visualise the word2vec using t-sne with the words. As in, each dot in the figure has the "word" also with it. I looked at a similar question here : t-sne on word2vec Following it, I have this code : import gensim import gensim.models as g from sklearn.manifold import TSNE import re import matplotlib.pyplot as plt modelPath="/Users/tarun/Desktop/PE/doc2vec/model3_100_newCorpus60_1min_6window