Sub Main 'Declare the variable that will reference the application Dim GrapherApp As Object 'Creates an instance of the Grapher Application object ' and assigns it to the variable named "GrapherApp" Set GrapherApp = CreateObject("Grapher.Application") 'Make Grapher visible GrapherApp.Visible = True 'Declare Plot As Object Dim Plot As Object 'Creates a new plot window and assign it to the variable named "Plot" Set Plot = GrapherApp.Documents.Add(grfPlotDoc) 'Add LinePlotGraph Dim Graph1 As Object Set Graph1 = Plot.Shapes.AddLinePlotGraph(GrapherApp.Path + "\samples\tutorial.dat") Set LineScatterPlot1 = Graph1.Plots.Item(1) 'Add second curve Graph1.AddLinePlot(GrapherApp.Path + "\samples\tutorial.dat",,3) Set LineScatterPlot2 = Graph1.Plots.Item(1) 'Add legend Set Legend = Graph1.AddLegend(True) 'Move legend to new spot Legend.Left = 4 Legend.top = 4.5 'Change entry text for first line Legend.EntryName(1, "Curve 1") 'Change entry font for second line Legend.EntryFont(2).face = "Times New Roman" Legend.EntryFont(2).Bold = True Legend.EntryFont(2).color = grfColorGreen Legend.EntryFont(2).Italic = True Legend.EntryFont(2).size = 8 'Show symbols on the curves and set size Graph1.Plots(1).symbolFreq=1 Graph1.Plots(1).symbol.size = 0.2 Graph1.Plots(2).symbolFreq = 2 Graph1.Plots(2).symbol.size = 0.1 'Change the symbol mode and size Legend.EntrySymbolMode (1,grfFixedSize) Legend.EntrySymbolSize (1,0.03) Legend.EntrySymbolMode (2,grfPlotSize) 'Change the number of symbols shown Legend.SymbolCount = 2 'Change the title font properties Legend.TitleFont.face = "Arial" Legend.TitleFont.size = 16 Legend.TitleFont.color = grfColorBlue 'Change the title text Legend.TitleText = "New Legend Title Text" 'Fill the legend Legend.Fill.foreColor = grfColorBlack10 'Change the line width Legend.Line.width = 0.03 'Change the frame style Legend.frameStyle = grfRoundFrame 'Set the legend margin Legend.margin = 0.35 'Return how many legend items are shown Debug.Print Legend.EntryCount 'Delete the second legend item Legend.DeleteEntry(2) 'Set UseSymbolTable LineScatterPlot1.UseSymbolTable = True 'Set ShowSymbolTableLegend LineScatterPlot1.ShowSymbolTableLegend = True Wait 1 'Set UseSymbolTable LineScatterPlot1.UseSymbolTable = False 'Set ShowSymbolTableLegend LineScatterPlot1.ShowSymbolTableLegend = False 'Set SymFillColorCol LineScatterPlot1.SymFillColorCol = 2 'Set Symbol.Fill.Gradient LineScatterPlot1.Symbol.Fill.Gradient.Name = "Rainbow10" 'Set Symbol.Fill.GradientLimitsAuto LineScatterPlot1.Symbol.Fill.GradientLimitsAuto = True 'Set Symbol.Fill.GradientLimitsMin LineScatterPlot1.Symbol.Fill.GradientLimitsMin = 42.2 'Set Symbol.Fill.GradientLimitsMax LineScatterPlot1.Symbol.Fill.GradientLimitsMax = 62.7 'Set ShowColorScale LineScatterPlot1.ShowColorScale = True End Sub