From Script | Spoken-Tutorial
Jump to: navigation, search
Time Narration
00:01 Welcome to the spoken tutorial on Bar Chart and Error bars.
00:07 In this tutorial, we will learn to,

Draw a bar chart

00:13 Label the x-axis with string data
00:18 Edit the dataset
00:21 Add error bars in y-axis
00:25 Change the error bar size and color
00:30 Add an object and format the style and
00:36 Delete an object
00:38 To record this tutorial, I am using,
00:42 Ubuntu Linux 16.04 OS
00:48 Grace version 5.1.25
00:53 gedit text editor 3.18.3
00:59 To follow this tutorial, Learner must be familiar with the Grace interface.
01:06 For the pre-requisite tutorials, please visit this site.
01:11 The example files required for this tutorial are provided in the code files link.
01:18 Please download and extract the files to Desktop.
01:23 Go to Desktop.
01:26 Notice the text file bar.txt.
01:30 Open file bar.txt in a text editor and notice the three data columns.
01:39 The first column is the data row number.
01:43 Second column is y data.
01:47 The third column is the x data which is a string.
01:52 Close the text editor window.
01:55 I have opened the Grace program.
01:58 First, resize the graph panel to fit the field of view.
02:03 Go to Data, import, ASCII to open the Grace read sets dialog box.
02:13 Navigate to Desktop and select the bar.txt file.
02:23 For set type choose bar option from the dropdown.
02:28 Autoscale XY on read and click on Ok to load the data.
02:35 Click on Cancel to close the dialog box.
02:40 A bar chart appears along with a line plot.
02:45 Let’s format the properties of the bar chart and add the x string data to it.
02:52 Double click on the line to open Set Appearance window.
02:58 I will drag the Set Appearance window for better view.
03:03 Under the Line properties, in the Type dropdown, choose None.
03:09 Click on Apply to remove the line in the graph.
03:13 Click on Close, to close the dialog box.
03:17 Next, go to the Plot menu and select Axis properties.
03:23 In the Grace: Axes window, change the x axis limits from zero to four.

Type start at 0 and at stop 4.

03:35 Under Tick properties, I will set Major spacing to one and Minor ticks to zero.
03:42 Click on Apply, to apply the changes.
03:46 In the Edit dropdown, select y axis.
03:50 I will change the y axis limits to start from zero and to stop at 5.

Click on Apply.

03:59 From the tick marks tab, from the Draw on drop down, choose Normal side.
04:06 Then click Apply to apply the changes.
04:10 Let us change the same for x axis.
04:14 In the Edit dropdown, select X axis. 
04:18 In the Draw on dropdown, change draw ticks to Normal side.
04:24 Again click on Apply to apply the changes to the graph.
04:29 Notice how the graph looks after each change has been applied.
04:35 Click on the Special tab on the right side.
04:39 This tab is labeled as custom ticks in Qtgrace.
04:44 In the Special ticks drop down, choose Tick marks and labels.
04:50 Let us re-open bar.txt file.
04:54 Notice that, the string S1 is associated with the first data point.
05:01 Similarly the string S2 is associated with the second data point.
05:07 And the string S3 is associated with the third data point.
05:12 Close the text editor window.
05:15 Make sure the Edit form is in x-axis.
05:20 In the tick location label form, enter data as seen.
05:26 Delete the value zero and four on the second column.
05:31 Type, S1, S2 and S3 against 1, 2 and 3 in the second column.
05:39 Click on Apply to see the changes in the graph.
05:43 Next, let’s learn to edit a dataset within the Grace program.
05:49 Click on Close to close the dialog box.
05:53 Double click on the bar in the graph to open the Set Appearance window.
06:00 Under Select set, notice G(0) (S0) [2] [3].
06:07 G denotes graph and S refers to the dataset in the graph.
06:13 Here it is graph zero and set zero.
06:18 Right-click and hold the mouse on G(0) S0 to open a context menu.
06:26 The context menu has more options in Qtgrace.
06:32 In the menu choose Edit and from the sub-menu, select In Spreadsheet option.
06:41 The dataset opens in the Spreadsheet data set editor.
06:46 In the Type drop-down change BAR to BARDY and click on Apply.
06:54 An extra column Y1 gets added to the spreadsheet.
06:59 Windows users will not see the string label column in Qtgrace.
07:06 I will enter the error values as 0.4, 0.6 and 0.3 in the Y1 column and

click on Apply.

07:18 Click on Close, on the Spreadsheet editor window.
07:22 Notice the incorporated error bars on the bar chart.
07:27 Next, we will edit the size of the Error bar.
07:32 Go to the Set appearance window and choose the Error bar tab.
07:38 Change the Bar line to 50 using the scroll bar.
07:43 Click on the color drop down and select red color.

Then, click on Apply.

07:51 This changes the color of the error bars to red.
07:56 Click on Close in the set appearance window.
08:00 We will now draw an arrow in the plot.
08:05 Go to Window in menu and choose Drawing Objects.

The Objects panel opens.

08:13 Click on the Line button and move the cursor to the plot.
08:18 The cursor changes to plus sign.
08:22 I will left click on the desired location to start the line.
08:27 Drag the cursor to draw the line until the desired location.
08:32 Notice that a line is drawn.
08:35 Click left again to fix the end location of the line.
08:40 Click on the Edit object.
08:44 Next, Double click on the line.
08:47 The Edit Line dialog box opens.
08:51 Change Line width to 1.5 using the triangle buttons.
08:57 For the arrow styles, in the Place at drop-down, choose End.
09:03 For the arrow Type, choose Filled.
09:07 Decrease I by L form factor to 0.7 .
09:12 The Position shows Viewport coordinates.

I will leave it as is.

09:19 Click on Accept to change the arrow style.
09:23 Click on Close to close the dialog box.
09:27 We can make a copy of an existing object.
09:31 To make a similar arrow as this, click on Copy object in the Objects panel.
09:39 The cursor changes to a hand sign.
09:43 Left click and hold on the arrow to see a box.
09:48 Drag the box and place the copied arrow at the desired location.
09:54 Left click to release the copied arrow in the desired location.
10:00 We can also delete the objects added to the graph.
10:04 To delete an added object, click on Delete object in the Objects panel.
10:10 Move cursor to the graph and the cursor changes to a x sign.
10:17 I will click on the newly copied arrow to delete it.
10:22 A warning popup window opens, asking the user Kill the line?
10:28 Click on Ok and notice that the object has been deleted.
10:33 Similarly, we can add text, ellipse and also format their properties.
10:40 Click on Close to close the objects panel.
10:45 Let us save the Grace project before closing it.
10:48 I will save with file as barxydy.agr on Desktop.
10:56 Choose File, Exit to exit Grace.
11:01 Now let's summarize.
11:03 In this tutorial, we,

Drew a bar chart

11:08 Labeled the x-axis with string data
11:13 Edited the dataset
11:16 Added error bars in the y-axis

Adjusted the error bar size

11:24 Added an object, formatted the style and deleted an object
11:30 For assignment, please do the following.
11:34 Draw a Time-activity graph for your daily activities.
11:42 For this, time your activities in a day and make a time table.
11:47 Plot a bar chart with time in hours on y-axis and activities on x-axis.
11:56 Your completed assignment may look similar to this.
12:02 This video summarizes the Spoken Tutorial Project.

Please download and watch it.

12:10 The Spoken Tutorial Project team: conducts workshops and gives certificates.

For more details, please write to us.

12:21 Please post your timed queries in this forum.
12:26 Spoken Tutorial Project is funded by NMEICT, MHRD, Government of India.

More information on this mission is available at this link.

12:37 This tutorial is contributed by Rani from IIT, Bombay.

Thank you for joining.

Contributors and Content Editors