function mphplot(model,pgname,varargin)
% MPHPLOT Render a plot group in a figure window
% 
%   MPHPLOT(MODEL,PG) renders the plot group tagged PG from the model
%   object MODEL in a figure window in MATLAB.
% 
%   MPHPLOT(MODEL,PG,'server','on') renders the plot group tagged PG from
%   MODEL in a figure window using the COMSOL server.
% 
%   MPHPLOT(MODEL,PG,'rangenum',NUM) renders the plot group tagged PG from
%   MODEL in a figure window in MATLAB with the colorrange bar (or legend
%   bar) that corresponds to the feature number num in the list of the plot
%   group.
% 
%   Note that only one colorrange bar and one legend bar is supported in a
%   MATLAB figure. When the option plot on server is active, all active
%   colorrange bar are displayed.
% 
%   Property    Value/{Default}           Description
%   -----------------------------------------------------------------------
%   Rangenum    Positive integer {''}     Colorrange bar (or legend) to
%                                         display
%   Server      On | {Off}                Plot on server
%   Parent      Double                    Set the parent figure
% 
%   Note: The plot on server option requires that you start COMSOL with 
%   MATLAB in graphics mode.
% 
%   Example 1:
%     % Load feeder_clamp.mph from the Model Library:
%     model = mphload('feeder_clamp.mph');
%     % Plot the first plot group:
%     mphplot(model,'pg1')
%     % Plot the first plot group with the colorrange bar:
%     mphplot(model,'pg1','rangenum',1)
% 
%   Example 2:
%     % Load rock_fracture_flow.mph from the Model Library:
%     model = mphload('rock_fracture_flow.mph');
%     % Plot the second plot group with a color bar:
%     mphplot(model,'pg2','rangenum',1)
% 
%   Example 3:
%     % Load fluid_valve.mph from the Model Library:
%     model = mphload('fluid_valve.mph');
%     % Plot the first plot group on server (requires to start COMSOL with
%     % MATLAB using the graphics mode):
%     mphplot(model,'pg1','server','on')

% Copyright 2010-2011 COMSOL
