You are not HMC5883L! So if you use the libraries for the HMC you will get a random (noise) direction. Once you use the QMC libraries the result looks ok. But they are not HMC5883. Look at the markings on the chip.
๐ MCIGICM 2 Channel DC 5V Relay Module: Optocoupler Low Level Trigger Expansion Board for Arduino UNO R3, DSP, ARM, PIC, AVR, STM32, Raspberry Pi
11 Review
Gikfun Screw Shield Expansion Board: Enhance Arduino UNO R3 with the EK7007 Add-On
11 Review
REXQualis Comprehensive Starter Kit with Arduino MEGA 2560 & Detailed Tutorial for Arduino IDE Compatibility
11 Review
GeeekPi Raspberry Pi Cluster Case with Cooling Fan and Heatsink for Pi 4 Model B, 3 Model B+ & 3/2 Model B
11 Review
M.2 Screw Kit: Easy Mounting for NVMe SSDs on ASUS Motherboards
19 Review
Comprehensive 500pcs Laptop Screw Kit Set for ๐ฉ IBM HP Dell Lenovo Samsung Sony Toshiba Gateway Acer
12 Review
uxcell 3.5" HDD Screw Black 200pcs for Computer PC Case - Flat Phillips Head - 6#-32 - Hard Drive Fasteners
10 Review
Glarks 660 Pieces Phillips Assortment Motherboard
10 Review