you could define the function like:
function grafico($valores,$img_width=false,$img_height=false,$titulo="title"){
if ($img_width===false){$img_width=450;}
if ($img_height===false){$img_height=300;}
...
}
and call to it without the lasting params or
replacing one or several with "false":
grafico($values);
grafico($values,300);
grafico($values,false,400);
grafico($values,false,400,"titleeee");