function plottransp(varargin)

%PLOTTRANS plots into the current figure with transparent background for eps-printing
%call as you would call plot, then simply print your figure with the command
%
% print -deps2c filename
%
%It is strongly suggested to use an empty figure.
% 
%This function also changes the color-rendering of lines for good visibility 
%in front of dark background.
%
%The function has been developed to be used with Prosper, a LaTeX class file,
%(prosper.sourceforge.net) but usage is not limited to Prosper only.
%
%latest version is available at http://mit.bme.hu/~markus/latex/prosper/

%Copyright (c) Janos Markus (markusjancsi@users.sourceforge.net), 
%BUTE, 2002-2004. 
%All rights reserved.
%
%version: 1.0
%
%Tested on MATLAB 5.3 and 6.1 only. 
%Works with MATLAB 4.0 as well (reported by Hendri Adriaens).

fig=gcf;
%fig=0; %uncomment this if you want transparency to be default.
%       %and comment out the plot(varargin{:}); line at the end


%make it transparent
set(fig,'defaultaxescolor','none');
whitebg(fig,[0 0 0]);
if fig==0
   set(fig,'defaultfigurecolor','none');
else
   set(fig,'color','none');
end

%automatic color rendering for dark background
set(fig,'defaultaxescolororder',[1 1 0;1 0 1;0 1 1;1 0 0;0 1 0;0 0 1]) % ymcrgb

if fig==0
   cmap = 'defaultfigurecolormap';
   set(fig,cmap,hsv(64))
   set(fig,'defaultsurfaceedgecolor',[0 0 0])
   set(fig,'defaultFigureInvertHardcopy','Off')
else
   cmap = 'colormap';
   set(fig,cmap,hsv(64))
   set(fig,'defaultsurfaceedgecolor',[0 0 0])
   set(fig,'InvertHardcopy','Off')
end

plot(varargin{:});

return
%end of file
