Closed pixelzoom closed 3 years ago
Oh wait.... I do see 2 bars in the bottom screenshot, at 8pi and 10pi. They are so small that I missed them. I still don't understand why, but I have a little more confidence that this is correct :)
@arouinfar is this indeed correct? Do you think it will be a problem for users? Should we be using something other than grayscale, so that even tiny bars would be more visible?
Ah.... I think the problem here is with the autoscaling of the y axis. Those 2 bars that are hard to see should be made bigger by autoscaling the y axis, and that's not happening. Self assigning to investigate.
The y-axis scale is indeed correct -- it's scaled to the Continuous Waveform, whose max amplitudes is ~2.5, see screenshot below. And you can barely see the component amplitudes at 8pi and 10pi.
Should the y-axis be scaled to the maximum amplitude for whichever plots are visible? That would mean that the chart's scale will likely change when toggling the "Continuous Waveform" checkbox.
@arouinfar thoughts?
In the above commit, I've changed the auto-scale behavior of the Amplitudes chart. Test drive in master or 1.0.0-dev.37.
The good news is that the tiny amplitudes that were so difficult to see in https://github.com/phetsims/fourier-making-waves/issues/118#issue-961161859 are now clearly visible:
The bad news is that there are now some situations where the size of the amplitude bars doesn't appear to change, but the y-axis scale is changing dramatically. This tends to occur when there are 1 or 2 amplitudes bars (max component spacing).
To reproduce, start with these settings:
k1 = 2pi k0 = 12pi σk = 1
You'll see this Amplitudes chart. Note the y-axis scale.
Keeping your eye on the y-axis scale, slide the Wave Packet Center (k0) slider around. You'll see setting where there is a dramatic change in the y-axis scale, and no change in the amplitude bar height. For example, here's k0 = 35.3 (11.25pi):
This seems better to me than the alternative, which was not seeing the tiny amplitude bars. The auto-scaling in this screen is something that definitely needs to be highlighted in the Teach Tips, and maybe that will be sufficient.
@arouinfar please review. Let me know what you think, whether you want to change anything, etc.
In the "to reproduce" scenario in the previous comment... While you're dragging the Wave Packet Center (k0) slider, note that there is similar behavior for the Components and Sum charts. That is, there are settings where the waveforms don't appear to change much (or at all) and the y-axis scale is changing dramatically. So the behavior in the Amplitudes chart is now consistent with those charts.
Going back to the example that I described in my first comment, https://github.com/phetsims/fourier-making-waves/issues/118#issue-961161859, where I couldn't see the amplitudes at 8pi and 10pi... Note that when you check the "Continuous Waveform" checkbox, seeing those amplitudes is still an issue -- AND the y-axis scale changes dramatically as you toggle that checkbox.
To reproduce:
The Amplitudes chart is now auto-scaled based on which charts are visible. And there's a huge difference in the y-axis range for the component amplitudes and the Continuous Waveform. E.g.:
Continuous Waveform off:
Continuous Waveform on:
Note that this issue also applies to the Sum chart. When "Waveform Envelope" is checked, it's maximum amplitude may be greater than the sum's maximum amplitude.
To demonstrate, set to these values:
With "Waveform Envelope" unchecked:
With "Waveform Envelope" checked, note the different y-axis scale:
Because of changes in https://github.com/phetsims/fourier-making-waves/issues/158, we now want to always scale the Amplitudes chart to the Continuous Waveform. Self-assigning to change this.
Done in the above commit - the Amplitudes chart now scales to the peak amplitude of the Continuous Waveform, regardless of whether it's visible.
@arouinfar please review in master.
Looks good, thanks!
In the Java and HTML5 versions...
With these settings, the top chart shows 1 bar at 12pi:
If I then move the Wave Packet Center to either 9pi or 15pi, I see no bars in the top chart. For example:
I don't understand this case. It occurs in both the Java and HTML5 versions. Is this a bug? Or is there an explanation?