pie-chart

How to avoid pie chart labels overlapping in MatPlotLib ver.2.0.2?

蓝咒 提交于 2021-02-19 03:58:06
问题 There were a lot of questions posted regarding labels overlap for pie chart plotting. However, I couldn't find automated solution except for converting them to the legend. This solution doesn't work for me as I have a lot of values (around 60), and conversion to a legend will make the plot look very messy and unclear. So my question, if I want to label pie wedges around the pie, is the any automated solution for MatPlotLib version 2.0.2 that enables labels to have a good spacing (no

How can I improve the rotation of fraction labels in a pyplot pie chart

风流意气都作罢 提交于 2021-02-19 03:52:25
问题 I copied the following example code with a minor change. I want to rotate the fractions in a certain angle. I achived my goal but my question is if there is an easier way to rotate the fractions: import matplotlib.pyplot as plt import matplotlib # Data to plot labels = 'Python', 'C++', 'Ruby', 'Java' sizes = [215, 130, 245, 210] colors = ['gold', 'yellowgreen', 'lightcoral', 'lightskyblue'] explode = (0.1, 0, 0, 0) # explode 1st slice # Plot pie_properties = plt.pie(sizes, labels=labels,

Matplotlib - Move labels into middle of pie chart

一个人想着一个人 提交于 2021-02-16 11:21:15
问题 I've got my pie chart working but I noticed that the text boxes for the actual chart doesn't seem to be working correctly. They are just clustered so I was wondering is there any way for me to move the labels into the middle where the white circle is and have the matching colour beside it or not? crimeTypes = dict(crimeData["Crime type"].value_counts()) crimeType = [] totalAmount = [] numberOfCrimes = 14 for key in sorted(crimeTypes, key=crimeTypes.get, reverse=True): crimeType.append(key)

Matplotlib - Move labels into middle of pie chart

隐身守侯 提交于 2021-02-16 11:20:17
问题 I've got my pie chart working but I noticed that the text boxes for the actual chart doesn't seem to be working correctly. They are just clustered so I was wondering is there any way for me to move the labels into the middle where the white circle is and have the matching colour beside it or not? crimeTypes = dict(crimeData["Crime type"].value_counts()) crimeType = [] totalAmount = [] numberOfCrimes = 14 for key in sorted(crimeTypes, key=crimeTypes.get, reverse=True): crimeType.append(key)

Move labels in ggplot2 pie graph

守給你的承諾、 提交于 2021-02-11 10:33:48
问题 I know from How to avoid label overlap in pie chart that I can use ggrepel to make labels not overlap in a pie graph. I would like percentages less than 7% moved to the outside and numbers 7% or more on top of their slice of the pie. Any ideas? library( ggrepel ) library( ggplot2) library( dplyr) library( scales ) library( reshape ) y <- data.frame( state = c( "AR" ) , ac = c( 0.43 ) , man = c( 0.26 ) , ltc = c( 0.25 ) , care = c( 0.05 ) , dsh = c( 0.01 ) ) y2 <- melt( y , id.var="state" )

Move labels in ggplot2 pie graph

怎甘沉沦 提交于 2021-02-11 10:31:27
问题 I know from How to avoid label overlap in pie chart that I can use ggrepel to make labels not overlap in a pie graph. I would like percentages less than 7% moved to the outside and numbers 7% or more on top of their slice of the pie. Any ideas? library( ggrepel ) library( ggplot2) library( dplyr) library( scales ) library( reshape ) y <- data.frame( state = c( "AR" ) , ac = c( 0.43 ) , man = c( 0.26 ) , ltc = c( 0.25 ) , care = c( 0.05 ) , dsh = c( 0.01 ) ) y2 <- melt( y , id.var="state" )

Creating pie chart in python

隐身守侯 提交于 2021-02-10 12:13:25
问题 I have created my pie chart but right now I am using a range of cells like this: chart3.add_series({ 'name': 'Pie data', 'categories': '=Pivots!$A$3:$A$10', 'values': '=Pivots!$F$3:$F$10'}) which gives me a pie chart with the categories that are found in A3-A10 and values that correspond from cells F3-F10. The problem I am having is unfortunately I am not always going to have data in each of these cells. so I may have data in one worksheet that has categories and values that may range from A3

How to use R to plot a pie plot with different radius?

a 夏天 提交于 2021-02-08 11:04:18
问题 For example, pie(1:3) But the radius is constant. How to make the pie plot which the radius is 1,2,3 respectively? 回答1: Check radial.pie function in plotrix package install.packages("plotrix") library(plotrix) radial.pie(c(1,2,3), labels=c("One", "Two", "Three"), radlab=TRUE) would produce following figure 来源: https://stackoverflow.com/questions/33343463/how-to-use-r-to-plot-a-pie-plot-with-different-radius

How to use R to plot a pie plot with different radius?

倖福魔咒の 提交于 2021-02-08 11:03:06
问题 For example, pie(1:3) But the radius is constant. How to make the pie plot which the radius is 1,2,3 respectively? 回答1: Check radial.pie function in plotrix package install.packages("plotrix") library(plotrix) radial.pie(c(1,2,3), labels=c("One", "Two", "Three"), radlab=TRUE) would produce following figure 来源: https://stackoverflow.com/questions/33343463/how-to-use-r-to-plot-a-pie-plot-with-different-radius

Creating Pie chart / progressbar like arc in andorid

馋奶兔 提交于 2021-02-08 07:32:08
问题 I am working on a project where I want to show a pie chart like the image added. Already have searched google and other posts in stackoverflow, but could not find a solution. any solution is appreciated. Note: suggestions of third-party library are also welcome. Also please do not suggest MPAndroidChart as I think my query can be implemented using simpler method. 回答1: You can use the library https://github.com/PhilJay/MPAndroidChart to achieve this. Add below in xml: <com.github.mikephil