mathematica作图的错误fp = {{23.604,9.983},{26.875,9.560},{21.685,8.549},{10.698,5.982},{17.618,6.034},{10.671,5.858},{9.214,3.858},{15.241,10.137},{30.114,11.313},{9.476,4.343},{6.075,4.023},{12.059,4.817},{14.385,4.930},{14.657,5.013},{11.901,4.064},{11.214,4.044},{15.336,6.168},{7.381,4.353},{17.426,5.157},{12.677,4.858},{16.192,8.941},{16.442,6.199}}gp = ListPlot[fp]Fit[fp,{1,x},x]为什么显示出来会出现负值,并且做不出图,错误提示为General::ivar:1 is not a valid variable.

问题描述:

mathematica作图的错误
fp = {{23.604,9.983},{26.875,9.560},{21.685,8.549},{10.698,
5.982},{17.618,6.034},{10.671,5.858},{9.214,3.858},{15.241,
10.137},{30.114,11.313},{9.476,4.343},{6.075,4.023},{12.059,
4.817},{14.385,4.930},{14.657,5.013},{11.901,
4.064},{11.214,4.044},{15.336,6.168},{7.381,4.353},{17.426,
5.157},{12.677,4.858},{16.192,8.941},{16.442,6.199}}
gp = ListPlot[fp]
Fit[fp,{1,x},x]
为什么显示出来会出现负值,并且做不出图,错误提示为General::ivar:1 is not a valid variable.

没有显示负值啊...那个,不是说坐标轴以下的就是负值,你看看坐标轴的刻度嘛.这是mathematica为了显示"美观"而自动调整的坐标轴刻度,要手动调整下可以用:gp = ListPlot[fp,PlotRange -> {{0,31},{0,12}}]就很明显了.至...