Plots and saves a cross-correlation chart in SVG format, using ggplot2 and the base ccf function. For example, If we want to compare the sales between different product categories, product colour we can use this R bar chart. If you’re like me, your first exposure to data visualization was as a consumer. # -*- Mode:R; Coding:us-ascii-unix; fill-column:160 -*-##### ## # @file ggplot. pos: character specifying the position for labels. The activity / transport type is colour-coded the same as the pie chart above. If you have multiple layers w/ different groups & want to add something like a smoother, if you put the smoother in ggplot, it will create smoother for each observation * instead, define the group in the line. We add to the Roption[]y values to place the numbers above the bars. If labels are supplied, it will call pie3D. Another workaround consists in converting your legend into graphic element, ungroup then delete the parts that you don't want (but then you lose all link with the table of content, so you should do a maximum using the table of content and only convert to graphics for final "tuning" of the legend display). Customizing Tooltips in Power BI Desktop. It consists of tick marks and text labels that identify equal intervals of measure along the bottom or top of the graph when oriented horizontally or along the left or right of the graph when oriented vertically. such as pie charts, bar graphs and time series plots – can be enhanced by artificial intelligence methods that model human creative processes. The logic behind is to make two exactly same pie charts but with different labels. So if you use color, shape or alpha, a legend will be available. If you have a cheap SVGA monitor (like me) you will ## > ## probably find that numerically equispaced does not mean visually ## > ## equispaced. Incidentally, the pie chart has an annoying ring around # pie chart with labels # (side puzzle, which one of these. This page will show how to build up from the basic bar plot in R, adding another categorical separation to the summary, confidence intervals to the bars, and labels to the bars themselves. Consider the following bar chart which displays vertical bars. The function coord_polar() is used to produce a pie chart, which is just a stacked bar chart in polar coordinates. People often describe plots by the type of geom that the plot uses. 0023630484 0. Instead, we want one bar. Labels are used to indicate what a certain position on the axis means. Line 4: Displays the resultant line chart in python. This chapter covers foundational design principles and both general and more specific best practices, as well as explores popular visualization tools and some special topics relevant to the field of data visualization, and concludes with a discussion of what’s next for the field. To be clear, we are not advocating use of pie charts; there are typically better ways to demonstrate the needed information. Polar coordinates are also used to create some other circular charts (like bullseye charts). Additionally some of the most popular packages (e. Two pie charts and an overlay of two variants of a bar chart. Grouped Legend. Create a pie chart with labels that contain custom text and the precalculated percent values for each slice. Related course: Data Visualization with Matplotlib and Python; Matplotlib pie chart The code below creates a pie chart:. You can help protect yourself from scammers by verifying that the contact is a Microsoft Agent or Microsoft Employee and that the phone number is an official Microsoft global customer service number. On the design surface, right-click on the pie and select Show Data Labels. matplotlib-like plot functions for dygraphs. As you can see,I have all the labels in the top of the pie chart (indicated by the red box 1). we see: (0,0) lies outside the ellipse so we can reject \( H_0 \) the two abline commands produce the lines indicating the one-way confidence intervals, if they were tangential to the ellipse, the CIs would be jointly correct. The 1980's and 2010's will be missing years in terms of a "decade" due to the data provided (and it's only 2017). Pie chart able to shows the composition of data. If we supply a vector, the plot will have bars with their heights equal to the elements in the vector. Customizing Tooltips in Power BI Desktop. (a) The label name of each gene located in the chloroplast genome base on the position of the reference genome. R contains several systems for making graphs, but the ggplot2 system is one of the most beautiful and most versatile. 代码区软件项目交易网,CodeSection,代码区,Data Visualization Part 3,WhatTypeofDataVisualizationDoYouChoose(ifany. In a pie chart, I can show you relative percentiles but cover up the fact that pie isn't eaten all that often. Adding a third dimension to a chart is, in most cases, unnecessary and useless. adjust: numeric value, used to adjust label position when lab. graphics::barplot provides a flexability of different class/format of input; And this is good, in general; Ineed, all plotting function in graphics provide more or less flexability about the input data. This is a follow-up post to my current intro of pie charts. 객체지향 언어이고 인터프리터 언어이다. Barplot of counts. And now it is clear for me, why my data labels did not match. dimensional XY graph. Create a Bar of a Pie Chart - Duration: 10:11. But didn't find the answer. The wedges of these two pie charts are ordered (clockwise, from the top), but it’s not so easy to follow them. Incidentally, the pie chart has an annoying ring around # pie chart with labels # (side puzzle, which one of these. Pie charts are a very bad way of displaying information. I have been trying to make a pie chart in ggplot2 with a custom function to get percentage labels, but it doesn't seem to work and I'm not sure how to modify it to get it to work. Altman (1991) sought information about caffeine consumption and marital status from 3888 pregnant women. Here is my current nvd3 pie chart. Basic Terms and Terminology Relating to Interpreting Relevant Information From Tables, Charts and Graphs. Next, let's add percent labels to each segment. That is suppose both f1 and f2 are factor variables and each of them takes two values and boxthis is a continuous variable. ## ## Bronx Brooklyn Manhattan NA Outside NYC ## 0. For the umpteenth time, the pie chart plots proportions. Telling stories with data using the grammar of graphics. Master ggplot2 and the rich grammar that underlies it. try reproducing outside of. The legendgroup key groups legend entries so that clicking on one legend entry will hide or show all of the traces in that group. That is suppose both f1 and f2 are factor variables and each of them takes two values and boxthis is a continuous variable. If this is enabled with SVG tooltips, any overflow outside of the chart bounds will be cropped. Position and MapLayer. Pie charts work well when the main impression of relative proportions to the whole is obvious, and fine comparisons aren’t needed. Increase or decrease this value to see the effect. The Bar Chart in R Programming is very useful to compare the data visually, and we already explain in our example so, please refer Barplot in R Programming article. As can be seen from the figure, the charts tested encoded data in different ways. The popular ggplot2 package discourages the use of pie charts and there is no dedicated geom_pie for it. People often describe plots by the type of geom that the plot uses. adjust: numeric value, used to adjust label position when lab. Google Sheets does its best to figure out a label by default, but it often ends up being something helpful like “Monthly” – technically accurate, but not very illuminating to anyone looking at the chart. (c) Variants identified in indica subgroup. (f) Variants in wild rice. By default, ggplot2 will automatically build a legend on your chart as soon as a shape feature is mapped to a variable in aes() part of the ggplot() call. Remember that upon importing corpkit, any pandas. Question and answer forum for TIBCO Products. The idea is to split a graph into layers: for example axis, curve(s), labels. Syntax R Pie chart. Basic Terms and Terminology Relating to Interpreting Relevant Information From Tables, Charts and Graphs. -- Ivan CALANDRA PhD Student University of Hamburg Biozentrum Grindel und Zoologisches Museum Abt. The available titles are positioned above the axes in the center, flush with the left edge, and flush with the right edge. ggplot2 is a part of the tidyverse, an ecosystem of packages designed with common APIs and a shared philosophy. gnuplot le if none is found in the current directory. The different colors inside the pie chart denote the phyla. Dot plot charts. The subgroups are just displayed on top of each other, not beside. So if you use color, shape or alpha, a legend will be available. 41 alongside a. Problem with Plots or Graphics Device. By default, the layout engine will try to arrange the data labels so they do not overlap. As seen in the above figure, we have used the actual amount as labels. label: variable specifying the label of each slice. By changing property values, you can modify certain aspects of the legend. Learn about installing packages. Named List Members We can assign names to list members, and reference them by names instead of numeric indexes. But in fact, graphs share many common elements, such as coordinate systems and using geometric shapes to represent data. Instead, we want one bar. This make it difficult if we want to produce a map like the above screenshot, which was posted by Tyler Rinker, the author of R package pacman. A geom is the geometrical object that a plot uses to represent data. Package 'plotly' April 10, 2019 Title Create Interactive Web Graphics via 'plotly. Even the most experienced R users need help creating elegant graphics. We will not get into that right now as this is based on data being communicated which we will cover in level three. Use the discrete option to insure that only the values in the dataset for rep78 label slices in the pie chart. In order to make a pie chart, we first need to make a bar chart and add several pieces of code to change it into a pie chart. Note that pie plot with DataFrame requires that you either specify a target column by the y argument or subplots=True. that published the chart and several others. Of the more than 10,000 people interviewed very few had eaten pie that day. With the use of a polar chart or gauge this will create interesting examples which are described later. To keep the bar colors consistent with other color coded # plots in the same report (like the xy plots shown above). Labels may be placed within the pie (radius less than the pie radius), on the edge or outside as in the examples below. The additional parameters are used to control appearance of pie charts in R are labels, color, title etc. Given their low density and failure to order. Paper 90-30 Tips and Tricks: Using SAS/GRAPH® Effectively A. In the below example, I have shown how to show the composition of the car's speed in highway as a continues variable with grouping them based on FL of the car. Almost Pie Chart 3 PlotNine (ggplot2):. We desire a density plot to compare the circulations of the 3 columns utilizing ggplot. Labels may be placed within the pie (radius less than the pie radius), on the edge or outside as in the examples below. In the R code above, we used the argument stat = "identity" to make barplots. Simple Plot Examples in R Below are some simple examples of how to plot a line in R, how to fit a line to some points, and how to add more points to a graph. text is true, the row names of height will be used as labels if they are non-null. The ring width could be tuned by outradius>radius>innerradius. Create a pie chart. You may have run across a pie chart, or a bar chart, perhaps in a newspaper or a textbook. such as pie charts, bar graphs and time series plots – can be enhanced by artificial intelligence methods that model human creative processes. As you can see,I have all the labels in the top of the pie chart (indicated by the red box 1). 3 Data Visualization via ggplot2. 0445212014 pie(x,labels=round(x*100)) This pie chart is too simple that no legend can indicated which area it is and what does the number means. Below is the code for making a regular bar plot. creating a simple pie chart limits ggplot2. Other than their different default. Introduction. Box plots may also have lines extending vertically from the boxes (whiskers) indicating variability outside the upper and lower quartiles. 0445212014 pie(x,labels=round(x*100)) This pie chart is too simple that no legend can indicated which area it is and what does the number means. Keeping track of ordered categories in a pie chart is harder again, especially when we want to make a comparison between two distributions. Exploring scales. In a chart you create in Excel for the web, axis labels are shown below the horizontal axis and next to the vertical axis. Would you consider a small pull request adding a note to the docs in ?geom_bar that describes this behavior and makes it clear that the order of filled segments in a stacked bar chart will not respect the factor level ordering when stat = "identity" and instead the respect the order of the data in the data frame?. But I don't know how to fix it. 3D charts are often useless. Prerequisites. Completing the steps below will produce a stock market chart similar to the image shown here and help you make good decisions when planning your stock trades. A stacked bar chart is a bar chart that places related values atop one another. They both have the option of color, events, id, label and zIndex. Multiple plots in one page. #z indicates the portions of the pie charts filled by each given type, x & y are coordinates for the point, and radius is to designate the size of the circle for the pie chart #to plot all points, I run a loop to run through my data one point at a time and make each pie chart; there are most likely more efficient methods. Pie charts are a very bad way of displaying information. But this is a very real problem with every model: the model can never tell you if the behaviour is true when you start extrapolating outside the range of the data that you have seen. Axis scales. 2059912817 0. This package is an attempt to make direct labeling a reality in everyday statistical practice by making available a body of useful functions that make direct labeling of common plots easy to do with high-level plotting systems such as lattice and ggplot2. The key lies in par. text draws the strings given in the vector labels at the coordinates given by x and y. By visualizing our data, we will be able to gain valuable insights from our data that we couldn’t initially see from just looking at the raw data in spreadsheet form. R uses recycling of vectors in this situation to determine the attributes for each point, i. Is it possible to have a custom data table visible underneath a chart in MS Excel? Ask Question The only issue is if it is outside of the standard bounds of the. You want to name the axis in the ggplot definitions. Reader omegatron came back with another shocking instance of a pie chart: Here is the link to the AVERT organization in the U. Google Sheets does its best to figure out a label by default, but it often ends up being something helpful like “Monthly” – technically accurate, but not very illuminating to anyone looking at the chart. Hi, Apologies in advance for a long-winded mail. Ploting multiple graphs in single one page (or canvas) with classic R command is straightforward and easy. coords(x, y) is used for construction of the coordinates. The available titles are positioned above the axes in the center, flush with the left edge, and flush with the right edge. ggplot (Wage, aes (education, fill = education)) + geom_bar We will now modify two parts of the code. Pie charts are created by transforming a stacked bar chart using polar coordinates. 자세한 내용은 원형 차트 외부에 데이터 요소 레이블 표시(보고서 작성기 및 SSRS)를 참조하세요. 2-Pie Chart. By default, ggplot() simply uses your variable names as the axis titles. The bar shows the target value, and the shading represents the progress toward that goal. In this article we will show you, How to Create a Stacked Barplot in R, Format its colour, adding legends, adding names, creating. A coxcomb diagram. Creating a chart like this: Add Text Annotations. Now that required a bit of a code but i feel that it looks much better than what either Matplotlib or ggPlot2 could have rendered. 3 Data Visualization via ggplot2. This package is an attempt to make direct labeling a reality in everyday statistical practice by making available a body of useful functions that make direct labeling of common plots easy to do with high-level plotting systems such as lattice and ggplot2. Forums to get free computer help and support. Plotrix: A package in the red light district of R. Thankfully the new functionality is being achieved through new options for the existing pie chart, which means that those new features are available in R via googleVis as well, without the need of writing new code. Lets try to generate heat map using ggplot library. This R tutorial describes how to create a pie chart for data visualization using R software and ggplot2 package. Here are few of my suggestions for nice looking colors and backgrounds:. Dot plot charts. - Added stat="identity" to expressionBarplot to comply with ggplot 0. Ich versuche, ein facettiertes Tortendiagramm mit ggplot zu erstellen, und stelle dabei Probleme mit der Platzierung von Text in der Mitte jedes Slices:. Labels are taken from the data names but can be overridden by the labels argument. The ggplot2 implies " Grammar of Graphics " which believes in the principle that a plot can be split into the following basic parts -. value=inside causes the frequency count to be placed inside the pie slice. character specifying the position for labels. But, with geom_mark it is a simple as setting the label argument. The lowly pie chart is the subject of frequent abuse from data visualization experts. Tooltips are an elegant way of providing more contextual information and detail to data points on a visual. See Axes (ggplot2) for information on how to modify the axis labels. Write Text into the Margins of a Plot Description. So adding a ggplot2 dependency is unlikely to incur additional installation costs in most cases. ggplot (df, aes(age,height) + geom_line (aes(group=subject))+ geom_smooth(method="lm",size=2,se=F). The only pie chart you will see in this book. (c) Variants identified in indica subgroup. To convert the stacked bar chart into a pie chart, we simply add an additional ggplot command coord_polar to plot the data in polar coordinates. Frequencies and relative frequencies can be used to construct histograms to observe datasets in given populations. A stacked bar chart is a bar chart that places related values atop one another. 1) sets the bottom, left, top and right margins respectively of the plot region in number of lines of text. I also brought Georgia to the front, because most of it was hidden by Texas. Developed by Hadley Wickham , Winston Chang, Lionel Henry, Thomas Lin Pedersen, Kohske Takahashi, Claus Wilke, Kara Woo, Hiroaki Yutani. With shiny. csv file Thomas Roth (geb. This is partly because of the pie-ness of the chart, and partly because the color palette. Matplotlib Tick Label Format Scientific Notation. geom_text() adds text directly to the plot. I would like to stick to pie charts and want to find a solution to handling labels correctly/user-friendly. Standard parts of a ggplot are axes, which aren't usefull for pie charts. pos: character specifying the position for labels. Altman (1991) sought information about caffeine consumption and marital status from 3888 pregnant women. The basic syntax for creating a pie chart using the R is:. Basic Terms and Terminology Relating to Interpreting Relevant Information From Tables, Charts and Graphs. In the book, The Grammar of Graphics, Wilkinson showed how you could describe plots not as discrete types like bar plot or pie chart, but using a “grammar” that would work not only for plots we commonly use but for almost any conceivable graphic. Best How To : You're positioning the custom labels outside the visible plot range. Or copy & paste this link into an email or IM:. Axis in gauges are not the same as in the other basic chart types. Next we change the pie colors. Find the range of the eruption duration in the data set faithful. Few of us learned how to create charts from first principles. Legends can be placed in various positions: A legend can be placed inside or outside the chart and the position can be moved. igreg: I found this example to label a pie. Barplot of counts. Comparable to pie chart, the density plots are utilized to reveal the circulation of information. Otherwise, the city names would appear along the Y axis to the left of the bars. To turn it into bytecode, we first resolve the addresses of its labels (starting at address 0), then encode it into bytes using the addresses now known—a “two-pass assembler. But this is a very real problem with every model: the model can never tell you if the behaviour is true when you start extrapolating outside the range of the data that you have seen. 1 from the OTU table. Clustered Bar chart in excel is a bar chart which represents data virtually in horizontal bars in series, similar to clustered column charts these charts are easier to make but are visually complex and if there is a single category with multiple data it is easy to compare using this chart but as the categories increases the comparison becomes more complex. is more verbose for simple / canned graphics; is less verbose for complex / custom graphics; does not have methods (data should always be in a data. Please be aware that this is not about why we should use a barchart or should use a pie chart or better not use a pie chart, but this is about some of the not that obvious aspects of charts and in this special case about some unobvious aspects of a bar chart. Pie chart has been criticized for being a poor visualization and is not recommended in R community. You can help protect yourself from scammers by verifying that the contact is a Microsoft Agent or Microsoft Employee and that the phone number is an official Microsoft global customer service number. this chart shows the labels inside the pie chart (in power bi it shows outside). Grouped Legend. Use the discrete option to insure that only the values in the dataset for rep78 label slices in the pie chart. Finally, the geom tells ggplot what sort of graph we want. Developed by Hadley Wickham , Winston Chang, Lionel Henry, Thomas Lin Pedersen, Kohske Takahashi, Claus Wilke, Kara Woo, Hiroaki Yutani. Let's say you think it's overkill to label the x-axis twice and want to remove the axis from the second plot. The dataset provides appropriate party colors, and we use those directly with scale_fill_identity. RStudio Support more detail can be hidden or exposed such as labels, text, and points. © Copyright 2012, Cliburn Chan. Multiple Line chart in Python with legends and Labels: lets take an example of sale of units in 2016 and 2017 to demonstrate line chart in python. Monsters can also get genocided or extinct. ggplot2 implements the grammar of graphics, a coherent system for describing and building graphs. If using the ggplot2 package for plotting, fitted lines from simple models can be graphed using geom_smooth(). When y is specified, pie plot of selected column will be drawn. New RCommander with ggplot #rstats My favorite GUI (or one of them) R Commander has a relatively new plugin called KMGGplot2. For example, the following vectors u and v have different lengths, and their sum is computed by recycling values of the shorter vector u. Below image shows labels and index labels in a column chart. to slightly outside the ggplot2/R/facet. D3 also made it easier to be creative with design. The main function actually draw a bar chart and bend it into a ring, hence it is something between a pie chart and a bar chart. – Keks Dose May 21 '13 at 9:39. By default it will be colored in shades of a solid color, but it also supports color mapping by supplying the cmap argument. This is an excerpt from the Python Data Science Handbook by Jake VanderPlas; Jupyter notebooks are available on GitHub. Sometimes we may wish to use a legend to annotate a pie chart instead of using labels. Cela va déterminer la position de toutes les étiquettes simultanément, de sorte que cela pourrait ne pas être ce dont vous avez besoin. If FALSE, the columns of height are portrayed as stacked bars, and if TRUE the columns are portrayed as juxtaposed bars. Though R allows pie charts with the pie() function, even the help file for this function argues against their use. Here, I think the first graph makes the age pattern more obvious, whereas the second graph makes it a little easier to compare males and. This is useful for adding small annotations (such as text labels) or if you have your data in vectors, and for some reason don't want to put them in a data frame. legend() function in R makes graph easier to read and interpret in better way. The basic bar plot. The discrete axis. #Plot bands and plot lines. A coxcomb diagram. Once you have searched a Corpus object, you’ll want to be able to edit, visualise and store results. Spatial transcriptomics cluster analysis with SpatialCPie. While there is a lot of R code and charts, that’s just a result of me wanting to practice ggplot2. Completing the steps below will produce a stock market chart similar to the image shown here and help you make good decisions when planning your stock trades. Pie charts are created by transforming a stacked bar chart using polar coordinates. I would like to be able to place multiple pie charts in the window, but am having trouble with placement. Displaying Data in a Chart with ASP. Pie Chart Revisited Keon-Woong Moon 2018-06-20. By default, the categorical axis line is suppressed. Each bar chart however needs an x variable. You may want to change them. Here is my current nvd3 pie chart. Include the option axis. Course/Grammar of Graphics Intro 50 xp Familiarizing with disease data 100 xp Warming up data-wrangling 100 xp. Different types of graphs may, at first glance, appear completely distinct. Polar coordinates are also used to create some other circular charts (like bullseye charts). While they may see harmless enough, they actually present a problem in that humans are unable to judge angles well. Thanks to the power of the visual language, you got the message quickly, and moved on. Pie Charts: =====--> A pie-chart is a representation of values as slices of a circle with different colors. Is it possible to make automatic changing the color of label at pie chart? I know that Tableau auto change label color from white to black depending on the viz color, but it is not working for pie chart( 2. Using polar coordinates gives rise to pie charts and wind roses (from bar geoms), and radar charts (from line geoms). I am not able to shift the legend which is displayed on the right side of the chart at bottom area. I will use updated data that we used in our Cross talk dashboard. Remove grid and background from plot (ggplot2) remove grid (does not remove backgroud colour and border lines) remove grid, background color and top and right. This is a very old post. 3 Data Visualization via ggplot2. label to place these outside each sector. With the use of a polar chart or gauge this will create interesting examples which are described later. The graph below is a single layer where both the bottom X axis and the top X axis are displayed. By default, ggplot() simply uses your variable names as the axis titles. If you use a line graph, you will probably need to use scale_colour_xxx and/or scale_shape_xxx instead of scale_fill_xxx. Displaying labels inside bars. So please any body knows how to resolve this problem as i need very urgent basis. Below is the code for making a regular bar plot. If you want to have the color, size etc fixed (i. Each example builds on the previous one. A very quick fix to this issue is to delete the word value in the table of content. Introduction. where c is a constant and γ is a constant whose value is typically in the range 2 < γ < 3, although occasionally it may lie outside these bounds. csv file Thomas Roth (geb. 3533075339 0. hist() method is used for generating histograms, and will automatically select the appropriate range to bin our data. The Complete ggplot2 Tutorial - Part1 | Introduction To ggplot2 (Full R code) Previously we saw a brief tutorial of making charts with ggplot2 package. Top 50 ggplot2 Visualizations - The Master List (With Full R Code) What type of visualization to use for what sort of problem? This tutorial helps you choose the right type of chart for your specific objectives and how to implement it in R using ggplot2. In this recipe, we will learn how to adjust the X and Y limits of plots, which is useful in adjusting a graph to suit one's presentation needs and adding. Mike Bostock. Here is my current nvd3 pie chart. A stack plot is basically like a pie-chart. gnuplot le if none is found in the current directory. Clustered Bar chart in excel is a bar chart which represents data virtually in horizontal bars in series, similar to clustered column charts these charts are easier to make but are visually complex and if there is a single category with multiple data it is easy to compare using this chart but as the categories increases the comparison becomes more complex. This new edition to the classic book by ggplot2 creator Hadley Wickham highlights compatibility with knitr and RStudio. class: center, middle, inverse, title-slide # Visualisation with ggplot2 ## https. Example: Exhibit 30. For example, the following vectors u and v have different lengths, and their sum is computed by recycling values of the shorter vector u. Display pie labels outside the chart area. Then add the pie chart to the map's children property or a. Changing pie chart to donut chart to look more cool and AWESOME!! Method of making donut graph from pie chart in MatPlotLib documentation is complicated rather we can just. You might find it useful when implementing your own visualizations. Welcome the R graph gallery, a collection of charts made with the R programming language. Though R allows pie charts with the pie() function, even the help file for this function argues against their use. This R tutorial describes how to create a pie chart for data visualization using R software and ggplot2 package. In a pie chart, I can show you relative percentiles but cover up the fact that pie isn't eaten all that often. KMggplot2 R Commander Plug-in for Data Visualization with 'ggplot2' A GUI front-end for 'ggplot2' supports Kaplan-Meier plot, histogram, Q-Q plot, box plot, errorbar plot, scatter plot, line chart, pie chart, bar chart, contour plot, and distribution plot. Plot symbols and colours can be specified as vectors, to allow individual specification for each point. Labels may be placed within the pie (radius less than the pie radius), on the edge or outside as in the examples below. Matplotlib Tick Label Format Scientific Notation. - 'labels' argument to csScatter is now working as it's supposed to. Enter the ggrepel package, a new extension of ggplot2 that repels text labels away from one another. Create a pie chart with labels that contain custom text and the precalculated percent values for each slice. Just sub in geom_text_repel() in place of geom_text() and the extension is smart enough to try to figure out how to label the points such that the labels don't interfere with each other.