Module simpa.acc

Class GnuPloter

java.lang.Object
simpa.acc.api.utils.GnuPloter

public final class GnuPloter extends Object
Minimal GnuPlot helper for quick visualization of field-at-points files. Produces a data file with X Y Z Fx Fy Fz and a small gnuplot script to render either a 2D plot of magnitude or a 3D splot of magnitude.
  • Field Details

  • Method Details

    • launchGnuplotScript

      public static void launchGnuplotScript(String scriptContent) throws IOException
      Launch a gnuplot script with the specified content and element name.
      Parameters:
      scriptContent - The content of the gnuplot script.
      Throws:
      IOException
    • plotFieldAtPoints

      public static String plotFieldAtPoints(String elementName, boolean launch) throws IOException
      Original method kept for compatibility: color-coded magnitude display by default.
      Throws:
      IOException
    • plotFieldAtPoints

      public static String plotFieldAtPoints(String elementName, boolean launch, boolean vectorField) throws IOException
      Throws:
      IOException
    • plotFieldAtPoints

      public static String plotFieldAtPoints(String elementName, boolean launch, boolean vectorField, double scalingFactor) throws IOException
      Plot the field at points. If vectorField is false, displays a color-coded magnitude scatter. If vectorField is true, displays arrows (vectors) using the Fx,Fy,Fz components. The scalingFactor parameter only affects the vector display. The method returns the path to the generated gnuplot script.
      Throws:
      IOException