In your classical position, you are resting on the right leg, whereas typically the waist of the guitar rests on the LEFT leg (so that the lower bout is between the player's two legs -- you can find pictures or video of classical playing). Also, the neck is usually tilted so that the peghead is up higher in the air. Both these things mean that the right arm would be rested further from the elbow (further toward wrist).
With plectrum 'spanish' guitar -- particularly thin or solid-body electric -- arm positions vary wildly (as does most everything else). Not all of these positions are used strictly for ease or quality of playing -- many are just used for 'looks' or appearances, or to be able to stand while playing.
Note that (kind of in reference to the rock/metal band photo above), having the guitar hanging low (or peghead tilted low), will not only alter right arm position, but will also greatly affect LEFT hand position (detrimentally for certain scale/arpeggio playing, in my opinion -- although many many blues and rock players do it this way, and it works for what they do).
The 'proper' left hand position should allow the wrist to be straight with the forearm, and allow the left fingers to spread and stretch out along the neck -- and usually without the thumb wraping around the neck.
While many many guitarists, particularly in rock and blues, have the guitar hanging low (and yes many are great musicians), notice that they would not be able to play certain scale or single-note arpeggio forms in that position (as well as missing many advanced chord-forms).
For me, it seems that the right ARM position while using a pick, is usually different from that when using a classical guitar.
Remember, the classical bodies have the necks join the body at the 12th fret -- though often having as long, or longer scale lengths than a lot of folk and electric guitars (particulary Gibson).
Electrics and plectrum acoustic necks join usually at the 14th fret and higher (esp. electrics). This means that resting the waist on the RIGHT leg allows the neck to be pulled closer in front of the player's body. This also moves the lower bout toward the right elbow joint.
On a plectrum acoustic guitar, when I play true 'rhythm', my forearm never rests on the body, and only the upper arm rests fairly lightly on the edge of the top of the lower bout (btw, I really like armrests on my guitars; note some guitars have them or have chamfers on the body -- check out Greenfield or Bellucci guitars).
In my opinion, single-note scale and/or arpeggio playing requires some sort of 'reference' for the hand to 'know' where the strings are. This should NOT be anchoring the right-hand or arm anywhere to the guitar. It should just be light touching, brushing, and/or palming, usually against adjacent strings, pickguard, or top. And it depends upon the musical passages, which of these is appropriate.
True rhythm guitar does not have the right hand or fingers resting on the guitar (and again, certainly not the forearm either). The right hand flecks up and down, quickly, at the wrist, which is shaken by the forearm (which in turn is why forearm cannot rest on the guitar body). The analogy given by W.G. Leavitt of Berklee said something like 'imagine you are trying to shake a bug/spider off the back of your hand'.
In classical guitar's apoyando (rest stroke), there's usually a finger and often the thumb also resting on a string. And in tirando (free stroke), I frequently lightly rest the thumb or edge of it on a string (unless it's plucking already). With arpeggios there are often finger-plants (in preparation for plucking) or thumb rests as well.
In any event, no body part should be resting on the guitar to the point where it is 'anchored' (this also applies to many other musical instruments I believe). The other poster is quite correct in saying that -- while it might seem a more secure way at first -- it will ultimately hinder playing ability.
Now on solid-body electrics, because of the plethora of (often ridiculous) shapes, all bets are off! But a Les Paul or Strat or Tele or related shape should be more like a flat-top or archtop -- in the way that it's held -- than, say maybe, a Flying V.
Ultimately, 'rules' ARE broken all the time.
But just because you see some pro-player (particularly in the popular music genres) using some unorthodox or unique technique or playing position, it doesn't mean THAT is what made them great.
They usually became great in spite of those things, and not because of them -- because they were so naturally talented and/or success driven to begin with.
In the really demanding and disciplined music genres, however, avoiding undue stresses, and maximizing potential, becomes critical.