问题
I want to plot in J with 2 list of data: data1 and data2 as y-axes and x_axes. I want to know how to define the x-axes but not use the default i.($y).
回答1:
You can create a scatter plot giving both the x-axis and y-axis coordinates as follows:
load 'plot'
]data1=: 20 ?@$ 500
282 212 154 130 84 355 35 307 108 123 266 460 299 462 93 91 435 341 27 437
]data2=: 20 ?@$ 100
73 3 7 10 93 32 25 48 45 11 21 95 84 63 33 6 84 9 93 65
plot data1;data2
However the default plot is a line so this may not give the result you're after. Adding some options to the plot command might help.
'type dot;pensize 2.5' plot data1;data2
来源:https://stackoverflow.com/questions/47764334/how-to-plot-with-no-default-x-axes-in-j