Path: news.mathworks.com!not-for-mail
From: "Cora " <janatc@web.de>
Newsgroups: comp.soft-sys.matlab
Subject: Re: legend interpreter
Date: Sat, 10 May 2008 16:06:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 51
Message-ID: <g04h5a$mgj$1@fred.mathworks.com>
References: <fvvoqd$af3$1@fred.mathworks.com> <g0104f$93t$1@fred.mathworks.com>
Reply-To: "Cora " <janatc@web.de>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1210435562 23059 172.30.248.35 (10 May 2008 16:06:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 10 May 2008 16:06:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1380570
Xref: news.mathworks.com comp.soft-sys.matlab:467712


"Bruno Luong" <b.luong@fogale.fr> wrote in message 
<g0104f$93t$1@fred.mathworks.com>...
> "Cora " <janatc@web.de> wrote in message
> <fvvoqd$af3$1@fred.mathworks.com>...
> > Hi,
> > 
> > I try to get my filename e.g.orange 4.70_02 displayed 
in 
> > the legend
> > 
> > unfortunately it displayes 0 as a subscript due to _ in 
> > front of it. I know that this is due 
to 'Interpreter' 'tex' 
> > and one possibility is to write it like
> > orange 4.70\_02 but I don't want to change this 
manually 
> > because I read it in as an function input
> > 
> > function Flightdisplay(Filename,Na)
> > (e.g.Flightdisplay('*.txt','orange 4.70_02')
> > 
> > I tried 
> > legend(Na, 'Interpreter', 'none')
> > but it gives me a warning:
> > Warning: Ignoring extra legend entries.
> > 
> > I tried
> > set(0,'DefaultTextInterpreter','none')
> > but this changes only the label on the x and y achses 
which 
> > actually require 'Interpreter', 'tex', but not my 
legend. 
> > 
> > Any ideas?
> > Perhaps a way to insert \ automatically in front of _ ?
> > 
> > Thanks
> > 
> > 
> 
> regexprep(string,'_','\\_')
> 
> Bruno
> 

Thanks, that was very helpful
I also realized that
h=legend(Na);
set(h,'Interpreter','none')
istead of legend(Na, 'Interpreter', 'none') works