如果我有import java.util.Arrays;
import java.util.Scanner;
import java.util.Collections;
public class array_PA3{
public static void main(String[] args){
int[][] hoursArray = {
{2,3,3,4,5,8,8,0},
{7,4,4,3,3,4,4,0},
{3,4,3,3,3,2,2,0},
{9,4,7,7,3,4,1,0},
{3,4,3,3,6,3,8,0},
{3,4,6,3,3,4,4,0},
{3,4,8,8,3,8,4,0},
{6,5,9,9,2,7,9,0}};
int maxRow = 0;
int indexRow = 0;
int [] totalRow = new int[8];
for (int row = 0; row <= 7; row++) {
for (int column = 0; column <= 7; column++){
totalRow[row] += hoursArray[row][column];
}
System.out.println("The sum of row " + row + " is " + totalRow[row] + ".");
}
Arrays.sort(totalRow, Collections.reverseOrder());
}
}
这样的函数我想要绘制并显示接近0,我将如何平滑图中的结果?对于我想要显示的内容,默认的采样点数量相对较小。
以下是代码:
sin(1/x)
当from sympy import symbols, plot, sin
x = symbols('x')
y = sin(1/x)
plot(y, (x, 0, 0.5))
接近0时,线变得更加锯齿状,而不是“曲线”。有办法解决这个问题吗?