Fourier coefficient and resolution in simulators
From your 2nd picture, I see a 120 Hz peak, and since you're using the power-supply tag, I guess you're probing the waveform after the rectifier. In the end, the best results with FFT are when there is a fixed number of periods involved. It also helps for the signal to be in its steady-state. In your case it should be n/60. For your first attempt, you used 40 ms, which means there were 0.04*60=2.4 periods involved. That results in a lot of leakage (unless you used a window). For the second case you have 0.3*60=18 periods, which is a multiple of 1/60, thus you get a clean FFT. The longer the time sequence, the lower the minimum frequency in the spectrum. The higher the points, the higher the maximum frequency. It doesn't matter what program you're using, these are the rules of the Fourier transform.