A framework: a conceptual structure. In software, a framework brings a foundation and a set of conventions on which you lay your work. It formalises an abstract school of thought. There are many frameworks you can use to solve the same problem. They come and go according to fashion.
A circle function from Processing: circle(x, y, 100).
A pattern: an authoritative model given to be imitated. Patterns are similar to recipes but more abstract.