Plot1D Object

Description: This object allows to plot one dimensional curves, for example S-parameters.

 

General Methods

Plot

Plots the field with the actual settings. Most of the following commands need a subsequent call of this method to make changes visible

 

PlotView( string type ) bool

This method corresponds to selecting a certain plot of the plot toolbar. The variable type specifies the type of view that should be plotted and can be one of the following strings: "real", "imaginary", "magnitude", "magnitudedb", "phase", "polar", "smith", "smithy". If the data could be plotted with the given view type, the method returns true, otherwise false.

 

ResetView

Resets the settings of the 1-dimensional plot to its default values. This does not affect the plot styles.

 

SetSmithChartZoom ( double value )

The Smith chart will be zoomed in a logarithmic scale in dB. This method is available only for Smith chart plots.

 

ShowReferenceCircle ( bool switch, double radius )

In polar plots and Smith chart plots this method shows a background circle with the given radius. In polar plots, the radius unit is the same as in the current plot. In Smith charts the radius unit is a linear value. The Plot method has to be called afterwards to make the changes visible. This method is available only for polar and Smith chart plots.

 

UseCurveSmoothing ( bool switch )

The method enables or disables automatic smoothening of curves in polar plots and Smith chart plots. The Plot method has to be called afterwards to make the changes visible. This method is available only for polar and Smith chart plots.

 

SetFont ( string fontname, string fonttype, string fontsize )

This method modifies the font which is used in the plot. The variable fontname contains the name of the font (i.e. "Arial"). The variable fonttype can be either "bold", "italic", "bold italic" or an empty string. The variable fonstsize can be a positive integer value. The Plot method has to be called afterwards to make the changes visible.

 

XAutoscale ( bool switch )

This method enables or disables auto-scaling of the x-axis. If switch is True the plot will always be auto-scaled to the maximum range. For polar and Smith chart plots this method enables or disables auto-scaling of the frequency range of the curve.

 

XAutoTick ( bool switch )

This method enables or disables automatic determination of the ticking of the x-axis. If switch is True the ticking will be done automatically. See also XTicksDistance. This method is available only for cartesian plots.

 

XLogarithmic ( bool switch )

This method enables or disables logarithmic plotting of the x-axis. If the lower bound of the current x-axis is non-positive, an error will be returned. Use the command XRange to change the plot range of the x-axis. The Plot method has to be called afterwards to make the changes visible. This method is available only for cartesian plots.

 

XRange ( double min, double max )

Specifies the range to be plotted for the x-axis. This method automatically turns the XAutoscale switch off. For polar and Smith chart plots this method changes the frequency range of the curve.

 

XRoundscale ( bool switch )

This method will round the values of the x-axis ticks (switch = True). Otherwise the values are displayed up to four digits (switch = False). This method is available only for cartesian plots.

 

XTicks ( int number )

Specifies the number of ticks to be displayed at the x-axis. This method automatically turns the XAutoTick switch off. This method is available only for cartesian plots.

 

XTicksDistance ( double distance )

Specifies the distance between two successive ticks to be displayed at the x-axis. This method automatically turns the XAutoTick switch off. This method is available only for cartesian plots.

 

YAutoscale ( bool switch )

This method enables or disables auto-scaling of the y-axis. If switch is True the plot will always be auto-scaled to the maximum range. For polar plots, this method enables or disables auto-scaling of the radial axis (amplitude). For Smith chart plots this command has no effect.

 

YAutoTick ( bool switch )

This method enables or disables automatic determination of the ticking of the y-axis. If switch is True the ticking will be done automatically. See also YTicksDistance. This method is available only for cartesian plots.

 

YLogarithmic ( bool switch )

This method enables or disables logarithmic plotting of the y-axis. If the lower bound of the current y-axis is non-positive, an error will be returned. Use the command YRange to change the plot range of the y-axis. The Plot method has to be called afterwards to make the changes visible. This method is available only for cartesian plots.

 

YRange ( double min, double max )

Specifies the range to be plotted for the y-axis. This method automatically turns the YAutoscale switch off. For polar plots this command changes the range of the radial axis (amplitude). For Smith chart plots this command has no effect.

 

YRoundscale ( bool switch )

This method will round the values of the y-axis ticks (switch = True). Otherwise the values are displayed up to four digits (switch = False). This method is available only for cartesian plots.

 

YTicks ( int number )

Specifies the number of ticks to be displayed at the y-axis. This method is available only for cartesian plots.

 

YTicksDistance ( double distance )

Specifies the distance between two successive ticks to be displayed at the y-axis. This method automatically turns the YAutoTick switch off. This method is available only for cartesian plots.

Markers and Measure Lines

AddMarker ( double abszissa )

On each curve in the selected plot a curve marker will be set at the specified abszissa. For polar or Smith chart plots the markers will be set at the specified frequency. The Plot method has to be called afterwards to show the added markers.

 

AddMarkerToCurve ( double abszissa, int curveindex )

A curve marker will be set at the specified abszissa to the curve with the specified curve index. The curve index is zero based. The Plot method has to be called afterwards to show the added markers.

 

DeleteAllMarker

All curve markers that have been previously defined in the selected plot will be deleted. The Plot method has to be called afterwards to make the changes visible.

 

DeleteMarker ( double abszissa )

All curve markers that have previously been defined at the specified abszissa will be deleted. The argument corresponds with the frequency for polar or Smith chart plots. The Plot method has to be called afterwards to make the changes visible.

 

MeasureLines ( bool switch )

If switch is True four measure lines are displayed, each defining an interval on the x-axis and y-axis. The intervals can be defined using the methods XMeasureLines and YMeasureLines. The resulting widths are displayed together with the measure lines. This method is available only for cartesian plots.

 

XMarker ( bool switch )

If switch is True a marker is displayed, positioned with regard to the x-axis using XMarkerPos. In a box beside the marker axis the y-values of all curves are shown. This method is available only for cartesian plots.

 

ShowMarkerAtMin

Activates the marker and positions the marker at  the global y-minimum of all displayed curves. This method is available only for cartesian plots.

 

ShowMarkerAtMax

Activates the marker and positions the marker at  the global y-maximum of all displayed curves. This method is available only for cartesian plots.

 

XMarkerPos ( double value )

If XMarker is active, its position with respect to the x-axis will be specified here. This method is available only for cartesian plots.

 

XMeasureLines ( double min, double max )

If MeasureLines are active, their positions with respect to the x-axis will be specified here. This method is available only for cartesian plots.

 

YMeasureLines ( double min, double max )

If MeasureLines are active, their positions with respect to the y-axis will be specified here. This method is available only for cartesian plots.

Background Shapes

AddThickBackGroundLine( string x0, string y0, string x1, string y1 )

Adds a thick background line to a cartesian plot going from (x0, y0) to (x1, y1). The points are given in data coordinates with respect to current plot. This method is available only for cartesian plots.

 

AddThinBackGgroundLine( string x0,  string y0, string x1, string y1 )

Adds a thin background line to a cartesian plot going from (x0, y0) to (x1, y1). The points are given in data coordinates with respect to current plot. This method is available only for cartesian plots.

 

DeleteAllBackGroundShapes

Deletes all previously set background lines. This method is available only for cartesian plots.

Plot Styles

The parameter curveindex of the following commands is zero-based (i.e. 0 for the first curve).

 

SetLineColor( int curveindex, int red, int green, int blue )

Sets the color of the curve with the given curve index to the specified RGB-value. Each parameter red, green and blue can be a value between 0 and 255. After this method has been called it is necessary to call the Plot method to make the changes visible.

 

RemoveLineColor( int curveindex )

Sets the color of the curve with the given curve index to a default value. After this method has been called it is necessary to call the Plot method to make the changes visible.

 

SetLineStyle( int curveindex, string linetype, int linewidth )

Sets the line style and the line thickness of the curve with the given curve index. The parameter linetype will specify the line style of the curve and can be either "solid", "dashed", "dotted" or "dashdotted". Any other string will not change the line style. The parameter linewidth specifies the line thickness and can be a value between 1 and 8. Any other value will not change the line thickness. After this method has been called it is necessary to call the Plot method to make the changes visible.

 

RemoveLineStyle( int curveindex )

Sets the line style and line thickness of the curve with the given curve index to default values. After this method has been called it is necessary to call the Plot method to make the changes visible.

 

SetMarkerStyle( int curveindex, string markertype, string markershape, int markersize )

Sets the style and shape of additional marks of the curve with the given curve index.  The parameter markertype specifies the type of the additional marks and can be either "auto", "additionalmarks","marksonly" or "nomarks" . Any other string will not change the type of the markers. The parameter markershape specifies the shape of the markers and can be an be either "auto", "circles", "diamonds", "squares", "triangle up" or "triangle down". Any other string will not change the shape of the markers. The parameter markersize specifies the size of the additional markers and can be a value between 1 and 8. Any other value will not change the size of the markers. After this method has been called it is necessary to call the Plot method to make the changes visible. The markers are not visible in Polar plots and Smith chart plots.

 

RemoveMarkerStyle( int curveindex )

Sets the line style and line thickness of the curve with the given curve index to default values. After this method has been called it is necessary to call the Plot method to make the changes visible. The markers are not visible in Polar plots and Smith chart plots.

Queries

The parameter curveindex of the following commands is zero-based (i.e. 0 for the first curve).

 

GetCurveIndexOfCurveLabel ( string curvelabel ) int

Returns the index of the curve with the specified curve label. If the curve label is not found  -1 will be returned. Please note that it is the curve label which is needed, not the name of the Tree entry. In a Smith chart plot, this could be for example "S1,1 (var. ref. imp.)". Use the method GetCurveLabelOfCurveIndex to get the correct spelling of a certain curve label.

 

GetCurveLabelOfCurveIndex( int curveindex ) string

Returns the label of the curve with the specified index. If no curve with this index is found an empty string will be returned.

 

GetCurveValue ( string curvelabel, double abszissa ) double

This method returns the ordinate value of the curve specified by curvelabel at the abszissa value specified by abszissa. If the value abszissa is in between two data points, the ordinate of the closest data point is returned. This method is available only for cartesian plots.

 

GetMaximumLocation ( string curvlabel ) double

Get the maximum location of the specified curve. This method is available only for cartesian plots.

 

GetMinimumLocation ( string curvelabel ) double

Get the minimum location of the specified curve. This method is available only for cartesian plots.

 

GetNumberOfCurves double

Returns the total number of displayed curves in a 1D plot. If some curves are hidden they are not counted anymore.

 

GetCurrentPlotSettings(string options ) string

Returns the current plot settings as a string. The parameter 'options' is expected to be an empty string. The string returned by this method contains VBA commands that can be used to restore the current plot state.

Examples

' change the plot style of S-Parameter S1,1

SelectTreeItem("1D Results\S-Parameters")

    Dim index As Integer

With Plot1D

      index =.GetCurveIndexOfCurveLabel("S1,1")

     .SetLineStyle(index,"dashed",8) ' thick dashed line

     .SetLineColor(index,255,255,0)  ' yellow

     .Plot ' make changes visible

End With