Pressure-dependent phase transitions in hydrogels