Basic question, ggplot doesn't seem to be doing what I expect though. I'm expecting this to plot : It's plotting :
EditIt seems as the faulty behaviour of sec_axis in ggplot2 3.1.0 is a bug. This has been recognized by the devs and they are working on a fix (see thread on GitHub).
I am using R and ggplot2 to do some plots for publishing purposes. I have come across this plot and I would like to replicate it using ggplot2. However, I have never seen a plot like this made using ggplot2.
Consider the following toy exampleIt displays a set of points with labels, where labels are abbreviations of some specific values. What I want to do is to add a guide for the abbreviations similar to a usual point-shape guide, but with abbreviations instead of shapes.
How to add a border around the continuous gradient color bar. By default, ggplot picks up the fill color specified in the scale_fill_gradient.
Consider the following data.frame and chart: Some labels are hard to read due to small values. I'd like to jitter those vertically. I'm aware of position_jitter but it doesn't seem compatible with a stacked bar chart.
This question already has an answer here:I recently saw a line chart in the Economist where the title had colored words to match the colors of the groups used in the line chart. I was wondering how to do this with a ggplot2 object. Here is some code to make...