Welcome to Golden Software Support

Automation: multiple graphs on a single page, multiple plots per graph

Comments

1 comment

  • Avatar
    Katie Yoder

    Hi David,

    Thank you for contacting Grapher technical support.  It is possible to loop through the plot creation process in Grapher and name the plots accordingly.  However, it is difficult to say exactly what is causing the errors you're seeing without access to the full script.  A simple example of a script that loops through the 6 pre-existing graphs and adds plots to each graph is provided below.

    Sub Main

    'Create Grapher and open the starting file Dim Grapher As Object Set Grapher = CreateObject("Grapher.Application")
    Grapher.Visible = True Set Plot1 = Grapher.Documents.Open("C:\Users\Katie\Desktop\Temp\Plot1.gpj")
    'Loop through Graphs to add a plot For i=1 To 6
    For j=1 To 4
    n=j+1
    yCol=j+2
    Set Graph1 = Plot1.Shapes.Item(i)
    Graph1.AddLinePlot("C:\Program Files\Golden Software\Grapher\Samples\line scatter plot Wks 1.dat",1,yCol,"X Axis 1","Y Axis 1",n)
    Set LineScatterPlot = Graph1.Plots.Item(n)
    Next Next End Sub

    If you're still having trouble with your script, please email the full script to support@goldensoftware.com so that we can review it and offer more help with the errors you're seeing.

     

    Please let me know if I can be of any further assistance!


    Sincerely,
    Katie Yoder
    Technical Support

    0
    Comment actions Permalink

Please sign in to leave a comment.