data-visualization

Match two trellis pages between two different graphs

非 Y 不嫁゛ 提交于 2020-01-03 03:18:14
问题 I want to have on the same page a pie chart and a bar chart, with trellis pages. They both have 5 columns as trellis, so 5 different pages that you can visualize by scrolling down. However, I would like to display the same pages at the same time for both graphs. For instance, let's imagine I'm on the pie chart, I scroll down one page - and so my pie chart is on page2 - I want my bar chart to automatically go to page 2 as well I tried to use markings but although it links a bit the two graphs,

How to set node size and color in bokeh network graph?

柔情痞子 提交于 2020-01-03 01:44:31
问题 If we take the standard Karate Club example, how do I change the color and size of the nodes according to their degree? import networkx as nx from bokeh.io import show, output_file from bokeh.models import Plot, Range1d, MultiLine, Circle, HoverTool, TapTool, BoxSelectTool from bokeh.models.graphs import from_networkx, NodesAndLinkedEdges, EdgesAndLinkedNodes from bokeh.palettes import Spectral4 G=nx.karate_club_graph() plot = Plot(plot_width=400, plot_height=400, x_range=Range1d(-1.1,1.1), y

Pandas Seaborn Swarmplot doesn't plot

孤者浪人 提交于 2020-01-02 22:01:11
问题 I am trying to plot a seaborn swarmplot where col[2] is the freq and col[3] are the classes to be grouped by. Input is given below and the code too. Input tweetcricscore,51,high active tweetcricscore,46,event based tweetcricscore,12,event based tweetcricscore,46,event based tweetcricscore,1,viewers tweetcricscore,178,viewers tweetcricscore,46,situational tweetcricscore,23,situational tweetcricscore,1,situational tweetcricscore,8,situational tweetcricscore,56,situational Code: import numpy as

In a network graph, how do I highlight the network components when hovering over them?

↘锁芯ラ 提交于 2020-01-02 19:18:30
问题 I have made a network graph. Now I want to add 3 functionalities - when hovering over an edge, it should highlight the nodes connected with that edge when hovering over a node, it should highlight all the nodes and edges connected to that node when selecting a sub-area in the network (by dragging the mouse), instead of zooming into the graph, it should highlight the nodes and edges in that selected sub-area How do I do these? I found this pen, but I don't know how to adapt it to Python do

R: underscore letters in forest plot of meta-analysis using the metafor package

为君一笑 提交于 2020-01-02 08:56:30
问题 Is there a way to present symbols (e.g. greek letters, symbols or underscore/upperscore letters) as labels in a forest plot of an rma() object generated by the forest() function of the metafor package? 回答1: Here is a nonsense example but it hopefully illustrates the underlying idea: library(metafor) data(dat.bcg) labs <- paste(dat.bcg$author, dat.bcg$year) ## Replace the first label with a greek letter, a superscript and a subscript labs[1] <- expression(beta[123]^123) res <- rma(ai=tpos, bi

Scaling axis for a scatter plot in matlibplot in python

坚强是说给别人听的谎言 提交于 2020-01-02 06:51:38
问题 I am working with data visualization using matlibplot. My plot has a total of 6502 data values and is working fine, but the values are close and dense. For example my y axis values ranges between 3 and 10 and I need to get each point between them so clearly. i.e values like 9.2 and 9.8 are to be clearly distinguished with at least a scale of 1=0.5. i.e all values like 3,3.5,4,4.5...10,10.5 are all seen in the output figure Can some one explain me how it can be done. I tired setting range

Plotting a grouped pandas data in plotly

荒凉一梦 提交于 2020-01-02 05:13:24
问题 I have a pandas dataframe which looks like this: A B 1 USA Y 3 USA Y 4 USA N 5 India Y 8 India N 12 USA N 14 USA Y 19 USA Y I want to make a countplot for this dataframe. That is, the plot will have country names on X-axis and the counts for each category on Y-axis . I know I can do this in seaborn like this: sns.countplot(x='A', data=df, hue='B') But this will not be an interactive plot. I want to achieve the same thing in plotly but I am having a hard time figuring it out. Can anyone please

Can I use shingles from lattice in ggplot2 in R

ⅰ亾dé卋堺 提交于 2020-01-02 01:56:05
问题 It is possible to use the shingles to define specific ranges in ggplot2 . As far as i understand shingles are a way to generate groups. Can we create such shingle s and use them in ggplot2 facet_grid to obtain graphs? 回答1: Following up from the comments, ggplot can't draw shingles (in the way lattice draws shingles with special indicators in the strip) and by default doesn't have a means of producing the overlapping groups. However, I cam across this excellent PDF document which aims to

Illustrate mean and standard deviation in ggplot2 density plot

半腔热情 提交于 2020-01-01 19:21:07
问题 I'm trying to construct a plot where I plot normally distributed variables showing their mean on the x-axis and the standard deviation (SD) on the y-axis. Kinda like a density plot, but instead of having the density on the y-axis I want to have the SD (value). I'm working with the data below, set.seed(1) mu1 <- rnorm(10^5, mean = 1, sd = 1) mu3 <- rnorm(10^5, mean = 3, sd = 2) two normally distributed variables. Here their mean and sd, # install.packages("tidyverse", dependencies = TRUE)

How to make 3D plots with categorical data in R?

不想你离开。 提交于 2020-01-01 11:37:07
问题 I've been trying to create a 3D bar plot based on categorical data, but have not found a way. It is simple to explain. Consider the following example data (the real example is more complex, but it reduces to this), showing the relative risk of incurring something broken down by income and age, both categorical data. I want to display this in a 3D bar plot (similar in idea to http://demos.devexpress.com/aspxperiencedemos/NavBar/Images/Charts/ManhattanBar.jpg). I looked at the scatterplot3d