MAG3110 Magnetometer X Axis Weird Readings

I'm using the MAG3110 for a project on my own pcb. On the surface, it seemingly communicates with my arduino using I2C just fine, and I have VCC as well as the SCL and SDA pullups connected to the 3.3v regulated output from the arduino. I can't figure out why the x values from the MAG are seemingly connected to the Y values and have very low resolution. Here is the example code I've been using, replacing the Wire.receive with and Wire.send with Wire.write. Below is a graph of the outputs as I moved the sensor around. Any thoughts on how I could go about solving this? It happens on every MAG sensor I use, and the other sensors on the board communicate just fine through I2C.


Undoubtedly a problem with your code.