help-octave
[Top][All Lists]
Advanced

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

gset format x "%.1f"


From: Henry F. Mollet
Subject: gset format x "%.1f"
Date: Tue, 30 Mar 2010 19:44:45 -0700
User-agent: Microsoft-Entourage/11.1.0.040913

I'd like the same format for the xticks on the x axis.
E.g. 0.0, 0.2,...1.0, 1.2 *not* *0*, 0.2, .... *1*, 1.2
In an earlier version of Octave I used
gset format x "%.1f"
to accomplish this. I searched with google and MATLAB site but could not
find the solution.

I had no luck with the following and I don't understand the formats that
appear. My plot shows the x-axis from 0 to 1.2 whereas get (gca, 'Xtick')
only goes from 0.0000 to 1.0000 and showing a different format. After
defining the xticks I want (again getting an unexpected different format in
'answer') and then setting them, the x ticks disappear on the plot.  When I
call my script again, the xticks appear again in the original form.

octave-3.2.2:55> xticks = get (gca, 'Xtick')
xticks =

   0.00000   0.20000   0.40000   0.60000   0.80000   1.00000

octave-3.2.2:56> xticks = 0.0, 0.2, 0.4, 0.6, 0.8, 1.0, 1.2
xticks = 0
ans =  0.20000
ans =  0.40000
ans =  0.60000
ans =  0.80000
ans =  1
ans =  1.2000
octave-3.2.2:57> set (gca, 'Xtick', Xticks)
octave-3.2.2:58> ScrTriLHTFig100OnlyMar2010Oct322

Is there an easy way to accomplish this task, similar to the
old gset format x "%.1f"
Henry




reply via email to

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