We have fabricated freestanding wire (air-bridge) structures with a bowed shape by introducing a strain layer to vary the strain around quantum dots. The photoluminescence peak energy shift following the shape change of the bridge can be observed for individual InGaAs quantum dots. We find systematic dependence of the peak shift on the dot position along the growth direction. The dependence of the peak shift is explained by strain distribution in the bridge. The strain distribution in the bridge as well as in the dot is calculated using a finite element method. Using the strain data, the electronic structures of the dots embedded in the bridge structures are calculated within the effective mass approximation. The calculated energy shifts agree well with the experimental ones.