waffle-chart

Can not load Font Awesome in R and RStudio

橙三吉。 提交于 2020-12-12 10:52:11
问题 I'm following this instruction : link and I have this code: library(waffle) library(extrafont) font_import() # use this if things look odd in RStudio under Windows loadfonts(device = "win") waffle(c(50, 30, 15, 5), rows = 5, use_glyph = "fa-car", glyph_size = 40, title = "Look I made an infographic using R!") And I get this as result: "Error: FontAwesome not found. Install via: https://github.com/FortAwesome/Font-Awesome/tree/master/fonts" I also check if I Font Awesome installed or not with

Create waffle chart in ggplot2

梦想与她 提交于 2020-07-09 06:23:56
问题 I'm trying to create a graph like this: in ggplot2 . The idea is to visualize the distribution of True/False values, i.e. in the upper bar 3 out of 80 and in the lower bar 2 out of 280. How would one do this in ggplot2 ? 回答1: You can use the waffle package. library(waffle) parts <- c('TRUE' = 3, 'FALSE' = 77) p <- waffle(parts, rows = 8, colors = c("black", "grey70")) p class(p) #[1] "gg" "ggplot" This is how you could combine two charts like in the graph above iron( waffle( c('TRUE' = 3,

Wanted: repeated-pictogram visualization of population split

依然范特西╮ 提交于 2020-01-10 14:40:49
问题 I am looking for a way to do a (actually quite common) visualization, whereby the split of a population of, say, N units into several categories is shown via a set of N pictograms - I'd prefer filled squares; in a newspaper, etc., one might see little humanoid shapes - with each pictogram colored according to the category of n'th unit. N fixed to 1 or 100, and the chart displaying fractions or percentages rather than counts, would be OK. The colored "stripes" would have to wrap to multiple

Wanted: repeated-pictogram visualization of population split

孤街浪徒 提交于 2020-01-10 14:39:27
问题 I am looking for a way to do a (actually quite common) visualization, whereby the split of a population of, say, N units into several categories is shown via a set of N pictograms - I'd prefer filled squares; in a newspaper, etc., one might see little humanoid shapes - with each pictogram colored according to the category of n'th unit. N fixed to 1 or 100, and the chart displaying fractions or percentages rather than counts, would be OK. The colored "stripes" would have to wrap to multiple

Compile RMarkdown PDF with Waffle Chart and Glyphs FAILURE. MWE included

偶尔善良 提交于 2019-12-12 02:17:22
问题 I am unable to compile PDF using RMarkdown, the waffle package, and glyphs It doesn't matter if I use the TIKZ device or PDF rendering. The document compiles without a problem to HTML. The only work around I can think of right now is to create SVG graphic with the HTML compiler, then to reference those files in my intermediate .TEX file. Notice that if you simply run the code below the line that says, " ## ---- waffle_figure ---- ". It should create the chart given that you've previously

Waffle & font family not found in Windows font database

雨燕双飞 提交于 2019-12-11 05:09:36
问题 I am trying to get the folowing code to work so that it will display the glyph medkit or any other icons from the FontAwesome font inside my waffle plot. library(waffle) library(extrafont) font_import() loadfonts(device = "postscript") which does display Registering font with R using postscriptFonts(): FontAwesome parts <- c(`Un-breached\nUS Population`=(318-11-79), `Premera`=11, `Anthem`=79) waffle(parts/10, rows=3, colors=c("#969696", "#1879bf", "#009bda"), use_glyph="medkit", size=8) When

How to do waffle charts in python? (square piechart)

谁都会走 提交于 2019-11-30 12:04:31
问题 Something like this: There is a very good package to do it in R. In python, the best that I could figure out is this, using the squarify package (inspired by a post on how to do treemaps): import numpy as np import pandas as pd import matplotlib as mpl import matplotlib.pyplot as plt import seaborn as sns # just to have better line color and width import squarify # for those using jupyter notebooks %matplotlib inline df = pd.DataFrame({ 'v1': np.ones(100), 'v2': np.random.randint(1, 4, 100)})

Wanted: repeated-pictogram visualization of population split

核能气质少年 提交于 2019-11-30 09:29:04
I am looking for a way to do a (actually quite common) visualization, whereby the split of a population of, say, N units into several categories is shown via a set of N pictograms - I'd prefer filled squares; in a newspaper, etc., one might see little humanoid shapes - with each pictogram colored according to the category of n'th unit. N fixed to 1 or 100, and the chart displaying fractions or percentages rather than counts, would be OK. The colored "stripes" would have to wrap to multiple lines. Is anyone aware of this chart available in an R package? To take a specific example, x = sample(c(

How to do waffle charts in python? (square piechart)

独自空忆成欢 提交于 2019-11-30 03:40:15
Something like this: There is a very good package to do it in R . In python, the best that I could figure out is this, using the squarify package (inspired by a post on how to do treemaps ): import numpy as np import pandas as pd import matplotlib as mpl import matplotlib.pyplot as plt import seaborn as sns # just to have better line color and width import squarify # for those using jupyter notebooks %matplotlib inline df = pd.DataFrame({ 'v1': np.ones(100), 'v2': np.random.randint(1, 4, 100)}) df.sort_values(by='v2', inplace=True) # color scale cmap = mpl.cm.Accent mini, maxi = df['v2'].min()