Moving matplotlib legend outside of the axis makes it cutoff by the figure box

I’m familiar with the following questions: Matplotlib savefig with a legend outside the plot How to put the legend out of the plot It seems that the answers in these questions have the luxury of being able to fiddle with the exact shrinking of the axis so that the legend fits. Shrinking the axes, however, … Read more

Remove legend ggplot 2.2

I’m trying to keep the legend of one layer (smooth) and remove the legend of the other (point). I have tried shutting off the legends with guides(colour = FALSE) and geom_point(aes(color = vs), show.legend = FALSE). Edit: As this question and its answers are popular, a reproducible example seems in order: library(ggplot2) ggplot(data = mtcars, … Read more

How to change legend size with matplotlib.pyplot

Simple question here: I’m trying to get the size of my legend using matplotlib.pyplot to be smaller (i.e., the text to be smaller). The code I’m using goes something like this: plot.figure() plot.scatter(k, sum_cf, color=”black”, label=”Sum of Cause Fractions”) plot.scatter(k, data[:, 0], color=”b”, label=”Dis 1: cf = .6, var = .2″) plot.scatter(k, data[:, 1], color=”r”, … Read more