作业帮 > 综合 > 作业

关于mathematica作图的问题

来源:学生作业帮 编辑:搜搜做题作业网作业帮 分类:综合作业 时间:2024/04/30 02:42:12
关于mathematica作图的问题
Needs["Graphics`Graphics`"];
ShowGraph[myFragmentedGrid =
InduceSubgraph[GridGraph[50,50],RandomSubset[2500]],VertexStyle→Disk[0]];
c = Map[Length,ConnectedComponents[myFragmentedGrid]];
Histogram[c,HistogramCategories→Range[0,Max[c]+1],
PlotLabel→"Distribution of the size of components"];
为什么我画不出来呢?
我用的是mathematica 7
画出来应该是下面这样
Range::range: Range specification in Range[0,1+ConnectedComponents[2]] does not have appropriate bounds. >>
我运行的时候出现这个东西,画不出来.
关于mathematica作图的问题
Needs["Graphics`Graphics`"];
ShowGraph[myFragmentedGrid =
InduceSubgraph[GridGraph[50,50],RandomSubset[2500]],VertexStyle-->Disk[0]];
c = Map[Length,ConnectedComponents[myFragmentedGrid]];
Histogram[c,HistogramCategories-->Range[0,Max[c]+1],
PlotLabel-->"Distribution of the size of components"];
这样应该对了
记得给分啊