data-visualization

create wordcloud in python for foreign language (Hebrew)

纵然是瞬间 提交于 2019-12-21 21:35:18
问题 I want to create a wordcloud. When my string is in English, everything works fine: from wordcloud import WordCloud from matplotlib import pyplot as plt text="""Softrock 40 - close to the 6 MHz that the P6D requires (6.062 according) - https://groups.yahoo.com/neo/groups/softrock40/conversations/messages I want the USB model that has a controllable (not fixed) central frequency.""" wordcloud = WordCloud().generate(text) plt.imshow(wordcloud, interpolation='bilinear') plt.axis("off") plt.show()

Python: Barplot with colorbar

笑着哭i 提交于 2019-12-21 19:36:31
问题 I'm trying to make a bar plot with a color bar, each bar's hight is one variable (y) and each bar should have a color depending on another variable (c). What I've got to is this (simple example): data_x = [0,1,2,3] data_hight = [60,60,80,100] data_color = [1000,500,1000,900] data_color = [x / max(data_color) for x in data_color] fig, ax = plt.subplots(figsize=(15, 4)) my_cmap = plt.cm.get_cmap('GnBu') colors = my_cmap(data_color) rects = ax.bar(data_x, data_hight, color=colors) CS = plt

Python: Barplot with colorbar

只谈情不闲聊 提交于 2019-12-21 19:35:50
问题 I'm trying to make a bar plot with a color bar, each bar's hight is one variable (y) and each bar should have a color depending on another variable (c). What I've got to is this (simple example): data_x = [0,1,2,3] data_hight = [60,60,80,100] data_color = [1000,500,1000,900] data_color = [x / max(data_color) for x in data_color] fig, ax = plt.subplots(figsize=(15, 4)) my_cmap = plt.cm.get_cmap('GnBu') colors = my_cmap(data_color) rects = ax.bar(data_x, data_hight, color=colors) CS = plt

Hexbin: apply function for every bin

你说的曾经没有我的故事 提交于 2019-12-21 17:29:00
问题 I would like to build the hexbin plot where for every bin is the "ratio between class 1 and class2 points falling into this bin" is plotted (either log or not). x <- rnorm(10000) y <- rnorm(10000) h <- hexbin(x,y) plot(h) l <- as.factor(c( rep(1,2000), rep(2,8000) )) Any suggestions on how to implement this? Is there a way to introduce function to every bin based on bin statistics? 回答1: @cryo111's answer has the most important ingredient - IDs = TRUE . After that it's just a matter of

React Native Audio Visualization

安稳与你 提交于 2019-12-21 13:28:09
问题 So I am using the react-native-audio package to play preloaded audio files and capture the user's recorded audio. What I would like to do is convert the audio into some sort of data for visualization and analysis. There seems to be several options for web but not much in this direction specifically for React Native. How would I achieve this? Thank you. 回答1: I've just bump with this post, I am building a React Native Waveform visualiser, still work in progres with the android side, but its

Is It possible to integrate Python Seaborn with plotly

送分小仙女□ 提交于 2019-12-21 12:56:17
问题 I am looking for some guidance in python seaborn for plot.ly. Is it possible to have seaborn graphs on plot.ly ? Any example or tutorial available ? Please help. Thanks in advance. 回答1: Seaborn is based on matplotlib, and Plotly converts the matplotlib figures it can (where mpl figure obejcts expose sufficient information to make the conversion. Here are the mpl conversion docs: https://plot.ly/matplotlib/) Full coverage won't be available until mpl 2.0 release, when mpl figure objects are

How do I control the bounce entry of a Force Directed Graph in D3?

烈酒焚心 提交于 2019-12-21 04:43:14
问题 I've been able to build a Force Directed Graph using a Force Layout. Most features work great but the one big issue I'm having is that, on starting the layout, it bounces all over the page (in and out of the canvas boundary) before settling to its location on the canvas. I've tried using alpha to control it but it doesn't seem to work: // Create a force layout and bind Nodes and Links var force = d3.layout.force() .charge(-1000) .nodes(nodeSet) .links(linkSet) .size([width/8, height/10])

How to create a 'stacked waterfall' chart in R?

こ雲淡風輕ζ 提交于 2019-12-21 04:13:51
问题 I was able to find several packages to create a waterfall chart in R which look like this: But I could not find a way to create a stacked waterfall charts which look like this: A work around is to use stacked bar chart. But that is not an elegant way. So, I wanted to know if there is a better way to create stacked waterfall chart in R. 回答1: You can easily create the "main" plot with ggplot2 once you have the "right" data. To replicate the plot you want with the choices of color, text, lines,

How to create a 'stacked waterfall' chart in R?

冷暖自知 提交于 2019-12-21 04:13:18
问题 I was able to find several packages to create a waterfall chart in R which look like this: But I could not find a way to create a stacked waterfall charts which look like this: A work around is to use stacked bar chart. But that is not an elegant way. So, I wanted to know if there is a better way to create stacked waterfall chart in R. 回答1: You can easily create the "main" plot with ggplot2 once you have the "right" data. To replicate the plot you want with the choices of color, text, lines,

Double clicking Europe data visualization

老子叫甜甜 提交于 2019-12-21 02:56:17
问题 I would like to create a choropleth map of Europe with the possibility of zooming. I would also like to see that when the user double-clicks on a country, the country in question is zoomed and divided into regions (NUTS 2), each of which is colored according to a second measure. Here an example: Suppose that Europe is composed of 5 countries: Country1, ..., Country5. Each country is colored according to the first measure (suppose the number of inhabitants). When the user double-clicks on