I'm trying to get the Gas Density as a function of Coordinates for Intergalactic medium (TNG300-1).
All I came up with is the Gas Density as a function of Coordinates for a specific subhalo.
How can I work with the Intergalactic medium instead?
You would want to load all the gas in the snapshot, and not just the gas which belongs to a given subhalo.
The beginning of the "Snapshot Data" example in the scripts walkthrough does exactly this, to make a picture of the entire cosmic web (IGM + halos).