I simply represent the curves of Average Total Costs, Average Variable Costs, Average Fixed Costs and Marginal Costs.
plot(Q,ATCosts,ylab=NA,ylim=c(0,62),type="l")
par(new=T)
plot(Q,AVCosts,ylab=NA,ylim=c(0,62),type="l",col="blue")
par(new=T)
plot(Q,AFCosts,ylab=NA,ylim=c(0,62),type="l",col="red")
par(new=T)
plot(Q,MCosts,ylab=NA,ylim=c(0,62),type="l",col="green")
The main is:
title(main="ATC,AVC,AFC,MC")
What I would like to know is if there is a way to give each piece of the main (containing a certain type of cost) the color related to that cost in the plot, in order to avoid to use a legend. Thus, ATC must be written in black; AVC must be written in blue...and so on.
I tried to overlap another title in the following way:
title(main=" ,AVC, , ",col.main="blue")
But it didn't give a decent result.