Basic Plotting in Running Idl Procedure

I started learning IDL a few hours ago. I have constructed the following procedure in a .pro called 'plots.pro':

PRO PLOTS
num=findgen(40)*10
line=sin(num*!DtoR)
plot, num, line
END

It seems I should get a plot of the line as a function of num. However, I instead get the following error message:

'plots ^ % PLOTS: Incorrect number of arguments.'

I wonder if you may point me in the right direction.

1 Answer

The procedure name "PLOTS" is already used by a different IDL procedure. You can rename your procedure (and file name) so that it doesn't conflict with PLOTS.

PRO my_plot
  num=findgen(40)*10
  line=sin(num*!DtoR)
  plot, num, line
END

IDL> my_plot

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Chloe Bennett

Chloe Bennett

Culture, Media & Entertainment Columnist

Chloe Bennett explores the intersection of pop culture, streaming entertainment, digital trends, and contemporary lifestyle. Her weekly commentary reaches thousands of culture enthusiasts.

Share this article
Twitter Facebook Pinterest