<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Making Multiple Plots
Making multiple plots at the same time is easy in ggplot. Plots can either be show inline using the print function, the __repr__ (what python prints out by default for something), or ggplot's save function.
Since we're trying to make multiple plots, the __repr__ example doesn't really appy here, so we'll be focusing on using print and save to make multiple plots.
Let's say you want to generate a histogram of price data for each type of diamond cut in the diamonds dataset. First thing you need to do is split your dataset up into groups. You can do this using the groupby function in pandas.
Step1:  Now to create and render a plot for each one of these subgroups, just make a ggplot object add a geom_histogram layer, and then print the plot.
Step2:  If you want to save the plots to a file instead, just use save instead of print.
<ASSISTANT_TASK:>
Python Code:
for i, group in diamonds.groupby("cut"):
    print group.head()
Explanation: Making Multiple Plots
Making multiple plots at the same time is easy in ggplot. Plots can either be show inline using the print function, the __repr__ (what python prints out by default for something), or ggplot's save function.
Since we're trying to make multiple plots, the __repr__ example doesn't really appy here, so we'll be focusing on using print and save to make multiple plots.
Let's say you want to generate a histogram of price data for each type of diamond cut in the diamonds dataset. First thing you need to do is split your dataset up into groups. You can do this using the groupby function in pandas.
End of explanation
for name, group in diamonds.groupby("cut"):
    p = ggplot(group, aes(x='price')) + geom_histogram() + ggtitle(name)
    print(p)
Explanation: Now to create and render a plot for each one of these subgroups, just make a ggplot object add a geom_histogram layer, and then print the plot.
End of explanation
for name, group in diamonds.groupby("cut"):
    p = ggplot(group, aes(x='price')) + geom_histogram() + ggtitle(name)
    filename = "price-distribution-" + name + ".png"
    p.save(filename)
Explanation: If you want to save the plots to a file instead, just use save instead of print.
End of explanation
<END_TASK>