Case 1: Applying a Transformation
In this example, you will perform the following tasks:
Polar Chart with Data in Radians on a Scale in Degrees shows the chart you are going to create.
Polar Chart with Data in Radians on a Scale in Degrees
Creating a Polar Chart
Because our example chart is based on a polar chart, the first thing you must do is create the chart.
-
If you have not already done so, launch Views Studio and display the Charts palette as described in Launching Views Studio with the Charts Extension.
-
Drag a polar chart from the Charts palette to your working buffer.
-
Double-click this object to open its inspector.
See Using the Chart Inspector for an overview of the Chart inspector. This section contains an explanation of each notebook page you may need to use when working with charts.
-
At this stage, it is a good idea to save the buffer containing your chart.
Make sure you select a directory to which you have write access. Also remember to save periodically as you work.
Defining Data with Abscissa Values in Radians
You are going to define two data sets, each consisting of three data points with two coordinates. The x-coordinate will be expressed in radians.
-
Click the Data sets tab in the Chart inspector to bring this page to the front.
To simplify the exercise, we are going to keep the data sets that are already defined. These data sets are of the type “Points (X,Y)” for the current chart. You can see that the abscissa values are expressed in degrees by default. For this exercise, you must therefore set the abscissa of the data points to radians in order to have data with abscissa values expressed in radians.
-
Select the first data set in the Data sets list.
-
Keep only the first three data points and delete the others. To delete a data point, just select it and click the Remove icon below the table.
-
Select the second data set and repeat step 3 and 4.
You have now two data sets with three data points each.
You are now going to select the abscissa value of each data point and replace the value in degrees by a value in radians.
-
Select the first data set again. Replace the first X value with 0, the second X value with 0.78, and the third X value with 1.57.
-
Click Apply to validate the changes.
-
Select the second data set. Replace the first X value with 0, the second X value with 1.57, and the third X value with 3.14.
-
Click Apply to validate the changes.
Defining the Displayers
We want the two data sets to be represented by markers. To do so, the displayers displaying the data sets must be of the scatter type.
-
Click the Displayers tab to bring this page to the front.
-
Select the first displayer from the Displayers list.
-
Make sure “Scatter” is selected in the Displayer type list. If not, select “Scatter”.
-
Click Apply to validate the changes.
-
Repeat steps 2 to 4 for the second displayer.
Specifying the Transformation on the Abscissa
Next you are going to apply a transformation to the abscissa scale.
The abscissa values of your data points are now expressed in radians. To represent these data points on an abscissa scale graduated in degrees, you have to do the following:
-
Specify the minimum and maximum values that will be represented by the scale.
-
Apply a transformation to the scale to convert radians to degrees.
Do the following:
-
Select the Scales page of the Chart inspector.
-
Make sure Abscissa is selected in the Scales list.
-
Make sure the General page is displayed in front.
On this page, you are going to change the minimum and maximum data values represented on the scale because these values must be expressed in the same coordinate system as the data.
-
Click Apply to validate the changes.
-
Click the Transformation tab on the Scales page.
The initial abscissa values of the data are expressed in radians while the abscissa scale of a polar chart is graduated in degrees by default. You will use the transformation page to set the transformation that will convert the abscissa values from radians to degrees. This transformation is given by the following formula:
where r is the value expressed in radians and d the corresponding value expressed in degrees.
-
Select Affine in the “Elementary transformation” drop-down list.
-
Enter 57.3 as the multiplicative coefficient and 0 as the constant coefficient.
-
Click Apply to validate the changes.
Your polar chart now represents your data expressed in radians on an abscissa scale graduated in degrees.
However, you may want to have an abscissa scale that is graduated in the same coordinate system as your data — in radians in this example. This case is detailed in the next section.