Share the Gallery !Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInEmail this to someone

 

The graphic #300 describe the basis of a lollipop chart. This page aims to describe how to improve its appearance. A lollipop chart is constituted by a point (made with geom_point) and a segment (made by geom_segment). Thus you can start by modifying this 2 components using the usual arguments: ‘size’, ‘color’, ‘linetype’, ‘alpha’, ‘shape’ (=transparency),

 

 

 

 

 

Then we can try to custom the general layout using the theme() function. To learn more about that, visit the ggplot2 section and read the following code:

 

 

If you use a lollipop plot to show the value of several entities (categorical variable), it is often better to show it horizontally (left chart). It makes it easier to read the entity names, especially if you have long names. Note that you probably want to reorder your entities (right chart): it gives more insight to the plot since the classement is now obvious.

 

 

 

 

 

 

 

Lastly, you can easily change the baseline of the chart. It gives more insight to the figure if there is a specific threshold in the data that interests you.

 

 

 

 

 

 

Related


 

Make a search


 

 


Leave a Reply

Be the First to Comment!

Notify of
avatar
wpDiscuz