II-13Category Plots. Chapter II-13



Similar documents
II-12Graphs. Chapter II-12

KaleidaGraph Quick Start Guide

Microsoft Excel 2010 Charts and Graphs

Chapter 4 Creating Charts and Graphs

How to make a line graph using Excel 2007

Petrel TIPS&TRICKS from SCM

Create Charts in Excel

Intro to Excel spreadsheets

Excel -- Creating Charts

Appendix 2.1 Tabular and Graphical Methods Using Excel

Information Literacy Program

Dreamweaver Tutorials Creating a Web Contact Form

Figure 1. An embedded chart on a worksheet.

Excel 2007 Basic knowledge

Plotting: Customizing the Graph

How to create pop-up menus

Computer Training Centre University College Cork. Excel 2013 Pivot Tables

Basic Microsoft Excel 2007

Creating Interactive PDF Forms

Access Tutorial 3 Maintaining and Querying a Database. Microsoft Office 2013 Enhanced

Tutorial 3 Maintaining and Querying a Database

How To Create A View Frame In 3D

Overview of CheckMarket question types

Q&As: Microsoft Excel 2013: Chapter 2

In this session, we will explain some of the basics of word processing. 1. Start Microsoft Word 11. Edit the Document cut & move

Tutorial 2: Using Excel in Data Analysis

Portal Connector Fields and Widgets Technical Documentation

STATGRAPHICS Online. Statistical Analysis and Data Visualization System. Revised 6/21/2012. Copyright 2012 by StatPoint Technologies, Inc.

Making Visio Diagrams Come Alive with Data

Microsoft Word Revising Word Documents Using Markup Tools

ABOUT THIS DOCUMENT ABOUT CHARTS/COMMON TERMINOLOGY

ABSTRACT INTRODUCTION EXERCISE 1: EXPLORING THE USER INTERFACE GRAPH GALLERY

Microsoft Excel 2010 Tutorial

BD CellQuest Pro Software Analysis Tutorial

Universal Simple Control, USC-1

MARS STUDENT IMAGING PROJECT

PowerPoint 2007 Basics Website:

Sample Table. Columns. Column 1 Column 2 Column 3 Row 1 Cell 1 Cell 2 Cell 3 Row 2 Cell 4 Cell 5 Cell 6 Row 3 Cell 7 Cell 8 Cell 9.

Excel Project Creating a Stock Portfolio Simulation

Advanced Excel 10/20/2011 1

MS Excel. Handout: Level 2. elearning Department. Copyright 2016 CMS e-learning Department. All Rights Reserved. Page 1 of 11

Excel. Microsoft Office s spreadsheet application can be used to track. and analyze numerical data for display on screen or in printed

CONSTRUCTING SINGLE-SUBJECT REVERSAL DESIGN GRAPHS USING MICROSOFT WORD : A COMPREHENSIVE TUTORIAL

Excel Guide for Finite Mathematics and Applied Calculus

Microsoft Excel 2010 Part 3: Advanced Excel

EXCEL Using Excel for Data Query & Management. Information Technology. MS Office Excel 2007 Users Guide. IT Training & Development

0 Introduction to Data Analysis Using an Excel Spreadsheet

4) How many peripheral devices can be connected to a single SCSI port? 4) A) 8 B) 32 C) 1 D) 100

PA Payroll Exercise for Intermediate Excel

Introduction to MS WINDOWS XP

Creating Charts in Microsoft Excel A supplement to Chapter 5 of Quantitative Approaches in Business Studies

GUIDELINES FOR PREPARING POSTERS USING POWERPOINT PRESENTATION SOFTWARE

Introduction to Dashboards in Excel Craig W. Abbey Director of Institutional Analysis Academic Planning and Budget University at Buffalo

Using Microsoft Word. Working With Objects

LaGuardia Community College Thomson Ave, Long Island City, New York Created by ISMD s Dept. Training Team. Overview

Gestation Period as a function of Lifespan

2. Building Cross-Tabs in Your Reports Create a Cross-Tab Create a Specified Group Order Filter Cross-Tab by Group Keep Groups Together

WebViewer User Guide. version PDFTron Systems, Inc. 1 of 13

Merging Labels, Letters, and Envelopes Word 2013

Word basics. Before you begin. What you'll learn. Requirements. Estimated time to complete:

SECTION 2-1: OVERVIEW SECTION 2-2: FREQUENCY DISTRIBUTIONS

There are six different windows that can be opened when using SPSS. The following will give a description of each of them.

MS Project Tutorial for Senior Design Using Microsoft Project to manage projects

ADOBE ACROBAT 7.0 CREATING FORMS

Excel 2003 Tutorial I

Basic Excel Handbook

Model Run Analysis. Technical Documentation Version 6.7. Center for Advanced Decision Support for Water and Environmental Systems

Working with Excel in Origin

Windows XP Pro: Basics 1

Maple Quick Start. Introduction. Talking to Maple. Using [ENTER] 3 (2.1)

Access Using Access

Atomic Force Microscope and Magnetic Force Microscope Background Information

Working with Spreadsheets

Microsoft Excel 2010 Pivot Tables

Practice Management Application Suite

Excel Unit 4. Data files needed to complete these exercises will be found on the S: drive>410>student>computer Technology>Excel>Unit 4

Drawing a histogram using Excel

Scientific Graphing in Excel 2010

If there is not a Data Analysis option under the DATA menu, you will need to install the Data Analysis ToolPak as an add-in for Microsoft Excel.

Guide To Creating Academic Posters Using Microsoft PowerPoint 2010

Describing, Exploring, and Comparing Data

Chapter 2: Clients, charts of accounts, and bank accounts

Charting LibQUAL+(TM) Data. Jeff Stark Training & Development Services Texas A&M University Libraries Texas A&M University

USING EXCEL ON THE COMPUTER TO FIND THE MEAN AND STANDARD DEVIATION AND TO DO LINEAR REGRESSION ANALYSIS AND GRAPHING TABLE OF CONTENTS

HOUR 9. Formatting Worksheets to Look Great

Plots, Curve-Fitting, and Data Modeling in Microsoft Excel

Excel 2007/2010 for Researchers. Jamie DeCoster Institute for Social Science Research University of Alabama. September 7, 2010

Getting Started with Excel Table of Contents

Instructions for Formatting APA Style Papers in Microsoft Word 2010

Creating Charts and Graphs

How to Use a Data Spreadsheet: Excel

WebFOCUS BI Portal: S.I.M.P.L.E. as can be

Introduction To Microsoft Office PowerPoint Bob Booth July 2008 AP-PPT5

Business Objects Version 5 : Introduction

Revealing the Secrets of Microsoft Project

Access 2010: The Navigation Pane

Licensed Functionality: Remote Monitoring

Plotting Data with Microsoft Excel

13-1. This chapter explains how to use different objects.

GeoGebra Statistics and Probability

Transcription:

Chapter II-13 II-13Category Plots Overview... 316 Creating a Category Plot... 316 Combining Category Plots and XY Plots... 317 Modifying a Category Plot... 317 Bar and Category Gaps... 317 Tick Mark Positioning... 318 Fancy Tick Mark Labels... 318 Horizontal Bars... 319 Reversed Category Axis... 319 Category Axis Range... 319 Bar Drawing Order... 319 Stacked Bar Charts... 32 Numeric Categories... 322 Combining Numeric and Category Traces... 322 Category Plot Pitfalls... 322 Pitfall: X Scaling Moves Bars... 322 Pitfall: Changing the Drawing Order Breaks Stacked Bars... 323 Pitfall: Bars Disappear with Draw to next Mode... 323 Category Plot Preferences... 323 Category Plot Axes and Axis Labels... 324 Category Plot Wave Styles... 324 How to Use Category Plot Preferences... 324

Overview Category plots are two-dimensional plots with a continuous numeric variable on one axis and a nonnumeric (text) category on the other. Most often they are presented as bar charts with one or more bars occupying a category slot either side-by-side or stacked or some combination of the two. You can also combine them with error bars: 8 minutes 1 minutes c.p.m. 6 4 2 Uninfected Virus #1 Virus #2 #2 Variant Category plots are created in ordinary graph windows when a text wave is used as the X data. For more on graphs, see Chapter II-12, Graphs. Creating a Category Plot To create a category plot, first create your numeric wave(s) and your text category wave. Note: The numeric waves used to create a category plot should have point scaling (X scaling with Offset = and Delta = 1). See Category Plot Pitfalls on page II-322 for an explanation. Then use the Category Plot dialog (see the New submenu of the Windows menu). You can append to an existing graph by choosing Category Plot from the Append to Graph submenu in the Graph menu. Select the numeric waves in the Y Wave(s) list, and the category (text) wave in the X Wave list: Waves containing numeric data. Select one or more. Waves containing category (text) data. Select one. You can use the Display command directly to create a category plot: Make/O control={1,3,5,5},test={5,2,7,3} Make/O/T sample={"15 min","1 hr","6 hrs","24 hrs"} Display control,test vs sample //vs text wave creates category plot ModifyGraph hbfill(control)=5,hbfill(test )=7 II-316

SetAxis/A/E=1 left Legend Legend 5 4 control test 3 2 1 Combining Category Plots and XY Plots You can have ordinary XY plots and category plots in the same graph window. However, once an axis has been used as either numeric or category, it is not usable as the other type. For example, if you tried to append an ordinary XY plot to the above graph you would find that the bottom (category) axis was not available in the Axis pop-up menu. If you try to append data to an existing category plot using a different text wave as the category wave, the new category wave will be ignored. The solution to these problems is to create a new axis using the Append Traces to Graph dialog or the Append Category Plot dialog. Modifying a Category Plot Because category plots are created in ordinary graph windows, you can change the appearance of the category plot using the same methods you use for XY plots. For example, you modify the bar colors and line widths using the Modify Trace Appearance dialog. For information on traces, XY plots and graphs, see Modifying Styles on page II-251. The settings unique to category plots are described in the following sections. Bar and Category Gaps You can control the gap size between bars and between categories. Category Width (1%) Bar Width (1%) Category Gap Bar Gap 15 min 1 hr Generally, the category gap should be larger than the bar gap so that it is clear which bars are in the same category. However, a category gap of 1% leaves no space for bars. The gap sizes are set in the Modify Axis dialog (Graph menu or double-click the category axis): II-317

Sets the gap between the last bar in one category and the first bar in the next category as a percentage of the category width. Sets the gap between bars within a category as a percentage of the bar width. If there is only one bar per category, then this has no effect. Tick Mark Positioning You can cause the tick marks to appear in the center of each category slot rather than at the edges. Bring up the Modify Axis dialog (Graph menu or double-click the category axis) and select the Tick in center checkbox in the Auto/Man Ticks pane. This looks best when there is only one bar per category. Fancy Tick Mark Labels Tick mark labels on the category axis are drawn using the contents of your category text wave. In addition to simple text, you can insert special escape codes in your category text wave to create multiline labels and to include font changes and other special effects. The escape codes are exactly the same as those used for axis labels and for annotation text boxes (see Modifying Annotations on page III-45). However, there is no point-and-click way to insert the codes in this version of Igor Pro. You will have to either remember the codes or use the Add Annotation dialog to create a string you can paste into a cell in a table (use the To Clip button in the dialog). Macintosh:Creating multiline labels is easy enough; just edit your category wave in a table and press Option- Return (to insert a carriage return into the cell s text) as needed: 2 1 15 min 1 hr Press Option-Return to start a new line. Click this scroll arrow to see previous lines. Option-Returns aren t displayed in table cells. 2 1 15 min (t) 1 hr Multiline labels will be center-aligned on a horizontal category axis and right-aligned on a left axis but left-aligned on a right axis. You can override the default alignment using the alignment escape codes as used in the Add Annotation dialog. II-318

Windows: You can make category labels with more than one line. Because it is impossible on Windows to enter a return character in a table, you must make multiline labels on the command line, using \r to separate the lines: Make/T/N=5 CatWave // Mostly you won't need this line CatWave[]="Line 1\rLine2" // "\r" Makes first label with two lines Multiline labels will be center-aligned on a horizontal category axis and right-aligned on a left axis but leftaligned on a right axis. You can override the default alignment using the alignment escape codes as used in the Add Annotation dialog. See the TextBox operation on page V-782 for a description of the formatting codes. Horizontal Bars To create a category plot in which the category axis runs vertically and the bars run horizontally, create a normal vertical bar plot and then select the Swap XY checkbox in the Modify Graph dialog (Graph menu). Reversed Category Axis Although the ordering of the categories is determined by the ordering of the value (numeric) and category (text) waves, you can reverse a category axis just like you can reverse a numeric axis. Double-click one of the category axis tick labels or choose the Set Axis Range from the Graph menu to access the Axis Range pane in the Modify Axes dialog. When the axis is in autoscale mode, select the Reverse Axis checkbox to reverse the axis range. 1 hr 15 min 5 1 15 2 x= Normal Range x=4 24 hrs 6 hrs Category Axis Range 1 hr 15 min x=4 Reversed Range x= You can also enter numeric values in the min and max value items of the Axis Range pane of the Modify Axes dialog. The X scaling of the numeric waves determine the range of the category axis. We used point X scaling for the numeric waves, so the numeric range of the category axis for the 15 min, 1 hr, 6 hrs, 24hrs example is to 4. To display only the second and third categories, set the min to 1 and the max to 3. 5 4 3 2 1 1 hr 6 hrs control test Bar Drawing Order When you plot multiple numeric waves against a single category axis you will have multiple bars within each category group. (In the examples so far, there are two bars per category group.) The order in which the bars are initially drawn is the same as the order of the numeric waves in the Display or AppendToGraph command: Display control,test vs elapsed //control on left, test on right II-319

You can change the drawing order in an existing graph using the Reorder Traces dialog (Graph menu) and the Trace pop-up menu (see Graph Pop-Up Menus on page II-31). The ordering of the traces is particularly important for stacked bar charts. Stacked Bar Charts You can stack one bar on top of the next by choosing one of several grouping modes in the Modify Trace Appearance dialog (Graph menu or double-click in a bar). The modes are chosen from the Grouping popup menu in the dialog. The pop-up menu options are: Mode Mode Name Purpose -1 Keep with next For special effects None Side-by-side bars (default) 1 Draw to next Overlapping bars 2 Add to next Arithmetically combined bars 3 Stack on next Stacked bars For most uses, you will use the None and Stack on next modes which produce the familiar bar and stacked bar charts. Gain Test #1 Gain Test #2 8 4 None Mode In all of the Stacked Bar Chart examples that follow, the stacking mode is applied to the Gain Test #1 bar and Gain Test #2 is the next bar. We have offset Gain Test #1 horizontally by.1 so that you can see what is being drawn behind Gain Test #2. Choosing Draw to next will cause the current bar to be in the same horizontal position as the next bar and to be drawn from the y value of this trace to the Y value of the next trace. Gain Test #1 Gain Test #2 8 4 Draw to Next Mode II-32

If the next bar is taller than the current bar then the current bar will not be visible because it will be hidden by the next bar. The result is as if the current bar is drawn behind the next bar, as is done when bars are displayed using a common numeric X axis. Add to next is similar to Draw to next except the Y values of the current bar are added to the Y values of the next bar(s) before plotting. Gain Test #1 Gain Test #2 8 4 Add to Next Mode If the current Y value is negative and the next is positive then the final position will be shorter than the next bar, as it is here for the 24 hrs bar. Stack on next is similar to Add to next except bars are allowed only to grow, not shrink. Gain Test #1 Gain Test #2 8 4 Stack on Next Mode Negative values act like zero when added to a positive next trace (see the 24 hrs bar) and positive values act like zero when added to a negative next trace (see the 1 hr bar). Zero height bars are drawn as a horizontal line. Normally the values are all positive, and the bars stack additively, like the 15 min and 6 hrs bars. Keep with next creates special effects in category plots. Use it when you want the current trace to be plotted in the same horizontal slot as the next but you don t want to affect the length of the current bar. For example, if the current trace is a bar and the next is a marker then the marker will be plotted on top of the bar. Here we set the Gain Test #2 wave to Lines from Zero mode, using a line width of 1 points. Gain Test #1 Gain Test #2 8 4 Keep with Next Mode Keep with next mode is also useful for category plots that don t use bars; you can keep markers from different traces vertically aligned within the same category: II-321

1 1.1.1 La Ce Nd Sm None mode La Ce Nd Sm Keep with Next Mode More details about these modes can be found in Grouping, Stacking and Adding Modes on page II-257. Numeric Categories You can create category plots with numeric categories by creating a text wave from your numeric category data. Create a text wave containing the numeric values by using the num2str function. For example, if we have years in a numeric wave: Make years={1993,1995,1996,1997} we can create an equivalent text wave: Make/T/N=4 textyears= num2str(years) Then create your category plot using textyears: Display ydata vs textyears // vs 1993, 1995, 1996, 1997 (as text) Combining Numeric and Category Traces Normally when you create a category plot, you can append only another category trace (a numeric wave plotted versus a text wave) to that plot. In rare cases, you may want to add a numeric trace to a category plot. You can do this using the /NCAT flag. Here is an example: Make/O/T catx = {"cat", "cat1", "cat2"} Make/O caty = {1, 3, 2} Display caty vs catx SetAxis/A/E=1 left // Plot simulated original data for a category Make/N=1/O cat1over = gnoise(1) + 1.5 SetScale/P x, 1.5, 1e-5, cat1over // Delta x can not be zero AppendToGraph/NCAT cat1over ModifyGraph mode(cat1over)=3, marker(cat1over)=19, rgb(cat1over)=(,,65535) The /NCAT flag, used with AppendToGraph, tells Igor to allow adding a numeric trace to a category plot. This flag was added in Igor Pro 6.2. In Igor Pro 6.37 or later, the Display operation also supports the /NCAT flag. This allows you to create a numeric plot and then append a category trace. Category Plot Pitfalls You may encounter situations in which the category plot doesn t look like you expect it to. Pitfall: X Scaling Moves Bars Category plots position the bars using the X scaling of the value (numeric) waves. The X scaling of the category (text) wave is completely ignored. It is usually best if you leave the X scaling of the category plot II-322

waves at the default point scaling. In any event, the X scaling of the value (numeric) waves should be identical. Differing X scaling will separate the bars in category plots containing multiple bars per category. In the graph on the right the numeric waves have different X scaling SetScale/P x,1,"", control SetScale/P x,,1,"", test SetScale/P x,2,"", control SetScale/P x,,1,"", test Same X scaling Different X scaling Pitfall: Changing the Drawing Order Breaks Stacked Bars Stacked bar charts are heavily dependent on the concept of the current bar and the next bar. The modes describe how the current bar is connected to the next bar, such as Stack on next. If you change the drawing order of the traces, using the Reorder Traces dialog or the Trace pop-up menu, one or more bars will have a new next bar (a different trace than before). Usually this means that a bar will be stacking on a different bar. This is usually a problem only when the stacking modes of the traces differ, or when smaller bars become hidden by larger bars. After you change the drawing order, you may have to change the stacking mode(s). Bars hidden by larger bars may have to be moved forward in the drawing order with the Reorder Traces dialog or the Trace pop-up menu. Pitfall: Bars Disappear with Draw to next Mode In Draw to next mode, if the next bar is taller than the current bar then the current bar will not be visible because it will be hidden by the next bar. You can change the drawing order with the Reorder Traces dialog or the Trace pop-up menu to move the shorter bars forward in the drawing order, so they will be drawn in front of the larger bars. Category Plot Preferences You can change the default appearance of category plots by capturing preferences from a prototype graph containing category plots. Create a graph containing a category plot (or plots) having the settings you use most often. Then choose Capture Graph Prefs from the Graph menu. Select the Category Plots categories, and click Capture Prefs. The axis settings used for the text wave of the category plot in the target graph will be captured as the new preferred settings for category (text wave) axes. Factory default settings for both Category Plot categories are currently in effect. The wave styles of the numeric waves used in the category plot in the target graph will be captured. II-323

Preferences are normally in effect only for manual operations, not for automatic operations from Igor procedures. This is discussed in more detail in Chapter III-17, Preferences. Category Plot Axes and Axis Labels When creating category plots with preferences turned on, Igor will use the Category Plot axis settings for the text wave axis and XY plot axis settings for the numeric wave axis. Only axes used by category plot text waves have their settings captured. Axes used solely for an XY plot, image plot, or contour plot are ignored. Usually this means that only the bottom axis settings are captured (the left axis is usually a numeric wave, and is therefore an XY Plot axis). The category plot axis preferences are applied only when axes having the same name as the captured axis are created by a Display or AppendToGraph operation when creating a category plot. If the axes existed before the operation is executed, they will not be affected by the category plot axis preferences. The names of captured category plot axes are listed in the X Axis pop-up menu of the New Category Plot and Append Category Plot dialogs. For example, suppose you capture preferences for a category plot that was created with the command: AppendToGraph/R=myRightAxis/T=myTopAxis ywave vs textwave Since only the X axis is a category axis, mytopaxis will appear in the X Axis pop-up menu in the category plot dialogs. The Y Axis pop-up menu will be unaffected. If you choose mytopaxis in the X Axis pop-up menu of the New Category Plot dialog and click Do It, a graph will be created containing a newly-created X axis named mytopaxis and having the axis settings you captured. If you have a graph which already uses an axis named mytopaxis as a category axis and you choose it from the X Axis pop-up menu in the Append Category Plot dialog, the category plot will use the axis, but no captured axis settings will be (re)applied to it. (Of course, the preferred settings were probably applied when the axis was created in the first place.) You can capture category plot axis settings for the standard left or bottom axis, and Igor will save the settings separately from left and bottom axis preferences captured for XY, image, and contour plots. Remember, when creating category plots, Igor will use the category plot axis settings for the text wave axis and XY plot axis settings for the numeric wave axis. Category Plot Wave Styles The captured category plot wave styles are automatically applied to a category plot when it is first created (provided preferences are turned on; see How to Use Preferences on page III-432). Wave styles refers to the various trace-specific settings for category plot numeric waves in the graph. The settings include trace mode, line style, stacking mode, fill pattern, colors, etc., as set by the Modify Trace Appearance dialog. If you capture the category plot preferences from a graph with more than one category plot, the first category plot appended to a graph gets the wave style settings from the category first appended to the prototype graph. The second category plot appended to a graph gets the settings from the second category plot appended to the prototype graph, etc. This is similar to the way XY plot wave styles work. How to Use Category Plot Preferences Here is our recommended strategy for using category preferences: 1. Create a new graph containing a single category plot. Use the axes you will normally use, even if they are left and bottom. You can use other axes, too (choose New Axis in the Category Plot dialogs). 2. Use the Modify Trace Appearance dialog and the Modify Axes dialogs to make the category plot appear as you prefer. 3. Choose Capture Graph Prefs from the Graph menu. Select the Category Plot checkboxes, and click Capture Prefs. II-324