Did you fly there (or take a long car trip there in which you were sitting still for a long time)? Are you on birth control? Have you had any leg cramping?

Regardless of the answer to the above, please please ask your doctor to order a D-dimer blood test - simple blood test. That's an indicator of clotting. You could possibly have developer a pumonary embolism. The odds are not high that you have, but could be deadly if you did.

ETA - the fact that it subsides depending on position could mean it is pleurisy, which is often secondary to PE. Please get that test.