How to plot with no default x-axes in J?

。_饼干妹妹 提交于 2021-01-27 11:58:20

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!