Geometric optics explanation of lateral (transverse) chromatic aberration The majority of pictures explaining lateral(transverse) chromatic aberration look like this

Here the focal point for red light is shifted closer to the optical axis and the focal point for blue light is shifted farther from it. This looks wrong to me since it requires blue light to be refracted less than red light in the bottom part of the lens. If lateral aberration is a result of the difference in refractive indices for different wavelengths then it should be possible to recreate the effect in a simple simulation. So I wrote one and it produced the expected result

Here blue light experiences more refraction than red light on both sides of the lens. So it doesn't look like the first picture. In fact, it looks almost like a longitudinal aberration. It would produce a visible effect of a rim around objects viewed through the lens, which is not the effect associated with lateral chromatic aberration. What am I missing here?
UPD:
As JB2's explained in their answer lateral chromatic aberration depends on aperture stop position, which I originally didn't include in the simulation. So below are some screenshots of the simulation with added aperture. There seem to exist a certain distance between lens and aperture stop at which the effect can be seen. I also increased the number of rays traced from the point:

*

*Thin lens


*Thick lens

 A: You are correct that the first picture is wrong.  For a single refractive lens, the lens power will be greater for blue light, compared to red. Hence the focal length will be shorter. You are on the right track, in that your 2nd picture is evidence of longitudinal chromatic aberration.
Lateral chromatic aberration depends on the location of the aperture stop. Lateral chromatic aberration is defined as the difference in location on the image plane for the chief ray, which is the ray that goes through the center of the aperture stop.  To first order, lateral chromatic aberration is zero if the aperture stop is at the lens. (To simplify things, we approximate a lens as a thin lens, so it has neither a front nor back surface, just one surface). This is because the chief rays goes through the center of the lens, where the front and back surfaces are ideally flat (again, this is an approximation).
If you move the aperture stop in front of the lens, then the bundle of blue rays and the bundle of red rays hit the lens away from the optical axis. They now are refracted in different directions: The blue bundle, and the blue chief ray is refracted more due to the higher refractive index. The red bundle of rays, and the red chief ray, is refracted less.   For a positive singlet, with the stop in front of the lens, the blue bundle will focus closer to the axis at the image plane than the red bundle.
As a complication, both colors will not be properly focused off-axis. This is due to off-axis aberrations.  The lateral color and longitudinal color get mixed in also. A lens design program can help pull out the effects of one aberration vs. another.
