To plot the density function of the continuous uniform distribution on [-1,1], my initial attempt was:
plot(Statistics:-PDF(Statistics:-RandomVariable(Uniform(-1,1)),x), x = -1.1 .. 1.1);
See plot below.
But I wanted something more like the wikipedia image (without the labels, naturally):
See plot below.
In words, I expected a horizontal line on the left of x=-1 and on the right of x=1 (at y=0), and I expected no vertical line at the x=-1 and x=1 points ...