Relative Content

Tag Archive for rggplot2

Using R to track the stock market

I am trying to write R code to see how much money someone could have made in the stock market had they invested in a certain amount of money in a certain stock between two dates (while taking into consideration management fees).

How can I make the legend color bar the same height as my facet wrapped plot panel?

How can I adjust the legend colorbar height to match the height of my plots when using facet_wrap()? This related SO question offers a good solution for a single plot, but when multiple plots are present, the color bar extends halfway through the facet wrap title and axis text. I would like the colorbar to extend only from the base of the facet wrap title to the top of the axis text.