cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
ARETI052
Level II

Trying to export Box Plots as PNG files using JMP Script

Hi, I was trying to automate the exporting step using JSL, I'm using the Save Presentation function but I couldn't get it to work. The .png file is created on my computer but it cannot be open due to "unsupported file type". My understanding is that the Save Presentation function didn't convert the Graph Builder file to PNG file before saving as .jpg file. Is there a way to fix this? Thanks!

Names Default To Here(1);

MyGraph = Function({yCol}, {default local},
    vars = Eval Expr(Variables(
        X(:Test Stage),
        Group X(:Temperature)
    ));
    
    pts = Expr(Box Plot(X));
    
    For(j = 1, j <= Min(8, N Items(yCol)), j++,
        Insert Into(vars, Eval Expr(Y(Expr(yCol[j]),Position( 1 ))));
    );
    
    gb = Expr(
        Graph Builder(
            Size(1255, 981),
            Show Control Panel(0),
            // Variables section will be inserted here
            Elements(Box Plot(X, Y(1), Y(2), Y(3), Y(4), Y(5), Y(6), Y(7), Y(8))),
            Local Data Filter(
                Add Filter(
                    columns(:Test Stage, :Sublot, :Temperature, :Soft Bin),
                    Display(:Test Stage, N Items(4)),
                    Display(:Soft Bin, N Items(15))
                )
            )
        )
    );
    Insert Into(gb, Name Expr(vars));
    
    // Save graph to a PNG file
    png_path = "box_plots.png";
    gb << Save Presentation("boxplot.png");

    Return(gb);
);

dt = Current Data Table();

graph = MyGraph(::yColName);

New Window("My report",
    VListBox(
        graph,
        HCenter Box(
            btn = Button Box("show distribution")
        )
    )
);

btn << setScript(
    My Histograms()
);

1 ACCEPTED SOLUTION

Accepted Solutions
ARETI052
Level II

Re: Trying to export Box Plots as PNG files using JMP Script

I figured out that I should be using the function "save picture", it's solved now.

View solution in original post

1 REPLY 1
ARETI052
Level II

Re: Trying to export Box Plots as PNG files using JMP Script

I figured out that I should be using the function "save picture", it's solved now.