0

I am trying to plot the following graph on IDL

PRO HMMM

a = '+'
b = '-'
c = '%'

x = [b+'20'+c, b+'10'+c, '0', a+'10'+c, a+'20'+c]

y = [1.2, 3.2, 4.5, 5.1, 6]

plot, x, y

END

The graph is produced but the '%' and '+' disappear. What is the right way to present those symbols on idl?

stj
  • 9,037
  • 19
  • 33

1 Answers1

0

If I understand your question, you are trying to place the '+', '-', and '%' symbols on the plot in the positions given by the integers in the x array. So the first point would be the text '-20%', the second point '-10%' and so on.

You can do this with the XYOUTS procedure and separate arrays for the string values and the x values.

PRO HMMM

x = [-20, -10, 0, 10, 20]
xs = ['-20%','-10%','0','+10%','+20%']

y = [1.2, 3.2, 4.5, 5.1, 6]

plot, x, y
XYOUTS, x,y,xs

END
dwhatcher
  • 1
  • 2