I am writing this in IDL.
I want to pass a list of numbers in array x that goes through function y, where then all y values go into an array z, that will be plotted x vs. z.
I have tried to solve this numerous ways. Initially, I was using lists, where it is easy to use the 'list.add' function to add new elements to an array. However, I can only plot arrays in IDL, and not list (thus getting an error). I have been messing around with the code for quite some time, so hopefully I can get some pointers in the right direction
z = [] ; array to hold y data
x = [1,2,3,4] ; x data
FOREACH element, x DO BEGIN
y = x+3
z.add,y
ENDOFREACH
; the plot
p = SCATTERPLOT(x,z)
I am hoping to get a simple scatter plot from this, but I do not know how to change my arrays.