How to set % symbol to all number on axis

Hi,
Does anybody know how to set the y axis of the category plot be in percents? I mean to have the “%” symbol at the every tick – similarly to the plot attached?
Thanks a lot!
vodicka wrote:
Does anybody know how to set the y axis of the category plot be in percents? I mean to have the “%” symbol at the every tick – similarly to the plot attached?


You need to set your ticks using user tick waves. One text wave holding the displayed text, a second numerical wave that assigns the tick locations.
E.g.
make/t/n=9 labelWave=num2istr((p-1)*10)+"%"
make/n=9 tickLocationWave=(p-1)*10
ModifyGraph userticks(left)={tickLocationWave,labelWave}


A
Set the data units of the first appended y wave, then check the "Units in Every Tick Label" checkbox (on the Tick Options tab).

You'll need to remove the default axis label's treatment of the units; I just entered a space for the axis label which overrides the default of Label left "%" in this case.

Here's my example:

Macro TestData()
    Make/O/N=10 data=(p+1)*5/1.75
    SetScale d 0,0,"%", data
    Make/O/T/N=10 categories= "Category "+num2istr(p+1)
    Graph0()
End

Window Graph0() : Graph
    PauseUpdate; Silent 1       // building window...
    Display /W=(11.25,61.25,405.75,403.25) data vs categories
    ModifyGraph tkLblRot(bottom)=90
    ModifyGraph linTkLabel(left)=1
    Label left " "
EndMacro


--Jim Prouty
Software Engineer, WaveMetrics, Inc.
Graph0PercentInTickLabels.png (5.52 KB)