Question: Plotting the output of a procedure

I am trying to plot the ouput of a procedure as oulined below:

restart:
with(plots):


pmf_x := proc(j)
       if j=0 then 1/3
       elif j=1 then 1/3
       elif j=2 then 1/6
       elif j=3 then 1/6    
       elif  type([j], [numeric]) then  0         
       else 'delta'(args)
       fi
       end:


 plot(pmf_x(q), q=0..4);
 

And get the following:

 

Warning, unable to evaluate the function to numeric values in the region; see the plotting command's help page to ensure the calling sequence is correct

Plotting error, empty plot
 

How can I fix this?

 

Please Wait...