help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Exponential notation in tick labels?


From: Miroslaw Kwasniak
Subject: Re: Exponential notation in tick labels?
Date: Thu, 10 Sep 2009 12:29:18 +0200
User-agent: Mutt/1.5.9i

On Wed, Sep 09, 2009 at 10:44:09AM +0200, Matthias Brennwald wrote:
> Dear all
> 
> I'm sure this has been discussed before, but I couldn't find anything  
> (maybe I did not chose the right search terms). I'd like to use  
> exponential notation for tick-mark labels in plots. For instance "plot  
> ([0:1e4:1E6])" yields a plot with y-axis labels 0, 200000, 400000,  
> 600000, 700000, 1e+6. I'd like these to be 0, 2e5, 4e5, 6e5, 8e5, 1e6.  
> Or, even better, 0, 2x10^5, 4x10^5,..., 10^6. How can I achieve this?

%tick values
tv=(0:2:10)*1e5;

%tick labels
tl=eval(strrep(['tl=[',sprintf("'%.0g'\n",tv),']'],'e+0','*10^'));

%use on plot
set(gca,'ytick',tv,'yticklabel',tl)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]