Additive manufacturing of polymer bonded magnets is a recently developed technique, for single-unit production, and for structures that have been impossible to manufacture previously. Also new possibilities to create a specific stray field around the magnet are triggered. The current work presents a method to 3D print polymer bonded magnets with a variable magnetic compound density distribution. A low-cost, end-user 3D printer with a mixing extruder is used to mix permanent magnetic filaments with pure PA12 filaments. The magnetic filaments are compounded, extruded, and characterized for the printing process. To deduce the quality of the manufactured magnets with a variable compound density, an inverse stray field framework is used. The effectiveness of the printing process and the simulation method is shown. It can also be used to manufacture magnets that produce a predefined stray field in a given region. Examples for sensor applications are presented. This setup and simulation framework allows the design and manufacturing of polymer bonded permanent magnets which are impossible to create with conventional methods.