IDL 8.0 Graphics: A Primer in the new Graphical System Jonathan Fairman UAH Atmospheric Science 3/4/11 and 3/7/11 Short Course.

Slides:



Advertisements
Similar presentations
Introduction to Graphing Using MATLAB. Line Graphs  Useful for graphing functions  Useful for displaying data trends over time  Useful for showing.
Advertisements

Matlab Graphics S. Awad, Ph.D. M. Corless, M.S.E.E. E.C.E. Department University of Michigan-Dearborn Introduction to Matlab: 2D Graphics.
Excel Tutorial 2: Formatting Workbook Text and Data
Chapter 6 Photoshop and ImageReady: Part II The Web Warrior Guide to Web Design Technologies.
Pasewark & Pasewark 1 Excel Lesson 2 Changing the Appearance of a Worksheet Microsoft Office 2007: Introductory.
® Microsoft Office 2010 Excel Tutorial 2: Formatting a Workbook.
MATLAB’s extensive, device-independent plotting capabilities are one of its most powerful features. They make it very easy to plot any data at any time.
Introduction to IDL Dealing with Data Week 2 Rachel McCrary
Exploring Other FreeHand Features – Lesson 31 Exploring Other FreeHand Features Lesson 3.
Presentation Guidelines. Title of the Paper Author names Address, Contact Information Session number Example: Session
XP New Perspectives on Microsoft Office Excel 2003, Second Edition- Tutorial 3 1 Microsoft Office Excel 2003 Tutorial 3 – Developing a Professional- Looking.
Introduction to MATLAB Northeastern University: College of Computer and Information Science Co-op Preparation University (CPU) 10/29/2003.
MATLAB Week 3 17 November Outline Graphics – Basic plotting – Editing plots from GUI – Editing plots from m-file – Advanced plotting commands.
FORTRAN Short Course Week 4 Kate Thayer-Calder March 10, 2009.
ESRM 250 & CFR 520: Introduction to GIS © Phil Hurvitz, KEEP THIS TEXT BOX this slide includes some ESRI fonts. when you save this presentation,
PowerPoint Add formulae. Course contents Overview: Typing math formulae Lesson1: Type a simple formula Lesson2: Type a complex formula.
An introduction to Plotting in MATLAB Rikard Johansson Department of Biomedical Engineering (IMT) Linköping University
Primaries: magenta, yellow, and cyan This color system is called subtractive because: each primary color absorbs (subtracts) a certain part of the color.
Designing a map layout Purpose of map Audience Map elements.
Creating a 3D Terrain Model and Flyover Bonnie J. Brown CAST – University of Arkansas, Fayetteville.
CHAPTER 14 Formatting a Workbook Part 1. Learning Objectives Format text, numbers, dates, and time Format cells and ranges CMPTR Chapter 14: Formatting.
Chapter 5 Review: Plotting Introduction to MATLAB 7 Engineering 161.
ITP 104.  While you can do things like this:  Better to use styles instead:
Geog Basic Skills in Scientific Programming Syllabus, Introduction, Fundamentals of IDL Syntax.
PLOTS AND FIGURES DAVID COOPER SUMMER Plots One of the primary uses for MATLAB is to be able to create publication quality figures from you data.
PowerPoint Tutorial Click on the down arrow on the scroll bar to the right Just a reminder to read all the instructions on a slide before doing what it.
Matlab tutorial course Lesson 5: Loading and writing data, producing visual output
Microsoft Office Excel 2003 Tutorial 3 – Developing a Professional-Looking Worksheet.
Exercise 1: Creating GIS data—points lines and polygons A very common method of creating vector data is to physically create these files through on-screen.
 Komodo Edit Project › Helping you find your folder  Laptop › Delete what you don’t need › Keep class “doodles” in a single “sandbox” folder  Isis.
The information contained in this document pertains to software products and services that are subject to the controls of the Export Administration Regulations.
1 What to do before class starts??? Download the sample database from the k: drive to the u: drive or to your flash drive. The database is named “FormBelmont.accdb”
Introduction to Programming with RAPTOR
CTS130 Spreadsheet Lesson 9 - Building Charts. What is a Chart? A chart is a visual display of information in a worksheet. Charts can help you make comparisons,
Advanced Stata Workshop FHSS Research Support Center.
IDL Tutorial Day 1 Goals: 1) Introduce IDL basics 2) Describe fundamental IDL structures Angela Des Jardins
Graphic Basics in C ATS 315. The Graphics Window Will look something like this.
Return to Outline Copyright © 2011 by Maribeth H. Price 3-1 Labeling and annotation.
MapInfo Professional 11.0: getting started Xiaogang (Marshall) Ma School of Science Rensselaer Polytechnic Institute Friday, January 25, 2013 GIS in the.
11/25/2015Slide 1 Scripts are short programs that repeat sequences of SPSS commands. SPSS includes a computer language called Sax Basic for the creation.
Graphical Enablement In this presentation… –What is graphical enablement? –Introduction to newlook dialogs and tools used to graphical enable System i.
EGR 106 Lecture 6 2-D Plotting Graphical presentation has become the standard method to show technical information. Engineers use plots to analyze, visualize,
Line plots. What is a good line plot? Clear Clean Hightlight the key lines: thick.
An Introduction to Forms. The Major Steps of a MicroSoft Access Database  Tables  Queries  Forms  Macros  Reports  Modules On our road map, we are.
Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004 Drawing pictures … It’s not art, it’s fun.
ElVis Improvements Summer 2008 Eric Zatz PPPL Summer Intern Mentor – Eliot Feibush August 11, 2008.
Arrays. Review of last lecture Overview of computer languages Overview of IDL Strength of IDL: (1) Interactive/compiled modes; (2) Array-oriented; (3)
Introduction to Computer Programming - Project 2 Intro to Digital Technology.
Unit 3: Text, Fields & Tables DT2510: Advanced CAD Methods.
HYPLOT One PLT File per Page. 1.
1 PEER Session 02/04/15. 2  Multiple good data management software options exist – quantitative (e.g., SPSS), qualitative (e.g, atlas.ti), mixed (e.g.,
Arrays. Review of last lecture Overview of IDL Strength of IDL: (1) Interactive/compiled modes; (2) Array-oriented; (3) Variables easily redefined; (4)
Bud length (mm)bud width (mm) Let’s pretend this is my data. I’ve entered it in Excel. Note that I have labeled my columns appropriately.
Graphics and Image Data Representations 1. Q1 How images are represented in a computer system? 2.
Learning the Basics of ArcMap 3.3 Updated 4/27/2010 Using Arc/View pt. 1 1.
How to use MATLAB (using M-files) Double click this icon To start Matlab 6.5.
Tutorial 2: Formatting a Workbook
Flash Interface, Commands and Functions
Unit Six: Labels In this unit… Review Adding Text to Maps
Images and Backgrounds
Colors.
MATLAB How to use (using M-files) Double click this icon
MATLAB How to use (using M-files) Double click this icon
Formatting a Workbook Part 1
MATLAB How to use (using M-files)
Plotting Signals in MATLAB
Introduction to MATLAB
Lawrence Snyder University of Washington, Seattle
IDL 8.0 Graphics: A Primer in the new Graphical System
Basic Processing … Drawing pictures … It’s not art, it’s fun
Presentation transcript:

IDL 8.0 Graphics: A Primer in the new Graphical System Jonathan Fairman UAH Atmospheric Science 3/4/11 and 3/7/11 Short Course

What’s new in IDL 8.0? New graphics system New plotting routines New mapping routines New contour routines New vector routines Ability to do streamlines!

Overview New System Introduction Changes to PLOT  Annotations: TEXT, LEGEND  New routines: BARPLOT, ERRORPLOT Changes to CONTOUR  COLORBAR Changes to IMAGE Changes to MAP  MAPGRID, MAPCONTINENTS New Routines  VECTOR, STREAMLINE Bugaboos with new routines

So, what’s this new system, anyways? Functional graphics  Old IDL direct graphics were procedural Aspects of iPlot tools/object graphics systems Scriptable Dynamic Plot Changes without redrawing Smart saving images Old direct graphics system still works, so your code will still produce the plots However, some things are worth merging over

Graphics basis No need to set device keywords Opens new window with white background automatically Stores graphical variables in memory, dynamically addressable LaTeX-like syntax for special characters Colors are stored in the system Symbols are stored in the system Can use text to specify symbols and colors (versus old specification of numbers) Let’s start with just introducing the WINDOW W1 = window()

PLOT Old code: Device, decomposed=0, retain=2 !p.background = 255 Loadct, 39, /silent Window, 0, xs=600, ys=600 Plot, findgen(10), color=0, /nodata oplot, findgen(10), color=250 New Code: P=plot(findgen(10), color=‘red’,$ dimensions=[600,600])

PLOT Properties: Under the old code, had to specify everything in one statement, e.g.: Plot, findgen(33)/16*!pi, sin(findgen(33)/16*!pi), color=0, xrange=[0,2*!pi], $ yrange=[-1,1], charsize=2.0, ystyle=1, xstyle=1, $ ytitle=‘Y = sin(x), xtitle =‘ x = [0,2!7p!8]’,/nodata oplot, findgen(33)/16*!pi, sin(findgen(33)/16*!pi), color=250, thick=2 Oplot, findgen(33)/16*!pi, sin(findgen(33)/16*!pi), psym=3, color=0 New code is dynamic – can set things separately as well as together P1=plot(findgen(33)/16*!pi, sin(findgen(33)/16*!pi)) P1.color=‘red’ P1.xrange=[0,2*!pi] P1.ytitle=‘Y = sin(x)’ P1.xtitle =‘x = [0, 2$\pi$] ;this is equivalent to: P1.symbol=‘plus’ P1.sym_color=‘black’ P1 = plot(findgen(33)/16*!pi, sin(findgen(33)/16*!pi), color=‘red’,$ xrange=[0,2*!pi, ytitle=‘y = sin(x)’, xtitle=‘x = [0, 2$\pi$],$ symbol=‘plus’

Annotations LEGEND: uses plot data to make legend, replacing old method of PLOTS and XYOUTS TEXT: outputs text to screen (analogue: XYOUTS) Create multiple plots with differing names Use annotations.pro from collections

BARPLOT Draws a bar plot of data Syntax:  B1 = BARPLOT(x, y) Old syntax for bar plots in make_precip_barplot.pro Let’s go to the code…

ERRORPLOT Specification:  E1 = ERRORPLOT(x,y,xerror,yerror)  Draws a box and whisker plot  All plot keywords the same  Find the code in make_precip_error.pro

CONTOUR Similar to other plotting systems, but with a twist! Nonfilled contours similar to changes in PLOT system Filled contours a little different… Old code: Loadct, 39, /silent Max1 = max(data) Min1 = min(data) Contour, data, x, y, nlevels=251, /cell_fill, levels=findgen(251)/250.*(max1-min1) – min1, color=0 New code: C1 = contour(data,x,y,n_levels=251,/fill, rgb_table=39)

COLORBAR Remember how much of a pain making colorbars was? Not anymore! Old code: Ncolors=255 Loc = [0.1,0.1,0.8,0.125] xsize= (loc(2) – loc(0))*D.X_VSIZE Ysize = (loc(3) – loc(1))*D.Y_VSIZE Xstart = loc(0)*D.X_VSIZE Ystart = loc(3) *D.Y_VSIZE Bar = BINDGEN(256)#REPLICATE(1B,10) Bar = BYTSCL(bar, top=ncolors-1) TV, CONGRID(bar, xsize, ysize), xstart+1, ystart=1 PLOT, findgen(251)/250., findgen(251)/250.*max1, /nodata, $ position=loc, yticks=1, ytickformat=‘(A1)’ yminor=1, xticklen=0.25,$ xrange=[min1,max1], xtitle=title1, color=0, /noerase, xstyle=1 New code: Loc = [0.1,0.1,0.8,0.125] cbar1 = colorbar(target = c1, position = loc)

CONTOUR and COLORBAR Let’s go to the code… looking at the wind speed example contour_windspeed.pro

IMAGE Replaces TV, does some other stuff as well… Context: Im1 = image(bands, xval, yval, order=1) Old code: Tv, bands, xval, yval, order=1, true=3 -Still need order command to make things look right if you don’t rotate it -automatically senses if it’s a 3-band overlay (no more true=3) -Saves via im1.save, no more write_png, etc.

MAP Most overhauled routine Moves it into more GIS/ENVI type mapping versus IDL direct mapping Calling context: M1 = map(‘Equirectangular’, limit = [min(lat), min(lon), max(lat), max(lon)], position=[0.1,0.1,0.9,0.9], dimension=[900,900] Replaces: Map_set, limit = [min(lat), min(lon), max(lat), max(lon)], position = [0.1,0.1,0.9,0.9]

MAP The MAP command also leads to changes in MAPGRID and MAPCONTINENTS Start a map… M1 = map(‘Geographic’, limit=[10,-130,50,-60], dimensions=[900,600]) Now, let’s change some properties… Mg1 = m1.mapgrid Mg1.linestyle = ‘Dash’ Mg1.label_position = ‘0’ Mg1.font_size=14 ;now, let’s add some continents Mc1 = mapcontinents(/countries) Mc1 = mapcontinents(/usa) ;now let’s change some properties! M1[‘Longitudes’].label_angle=0 M1[‘Ohio’].fill_color=‘red’ M1[‘Michigan’].fill_color=‘blue’

MAP The map works in projection space, not in the direct space anymore So, let’s say we want to plot points in the map… of the NARR grid or something Let’s go to plot_narr_latlon.pro

VECTOR and STREAMLINE Two new ways to plot wind features! Some of these are pretty awesome! Context: V1 = vector(uwind, vwind, x, y, vector_style=‘barbs’) St1 = streamline(uwind, vwind, x, y, streamline_stepsize=0.1, streamline_nsteps=200) Let’s go to the code: start with stream_vector.pro

Combination plots! OK, so we have covered mapping, plotting, streamlines, vectors, colorbars… Now let’s put some of these together in IDL 8.0 syntax. Let’s look at combo_plot.pro and go from there…

Bugaboos Some issues that I haven’t figured out yet More then these, just a brief synopsis MAP  Inability to switch to decimal degrees  Haven’t quite figured out how to map a satellite image yet  Can’t specify position, automatically defined based on projection  Problems with multiple maps in the same window CONTOUR  Filled contours have issue with fixed tables  Can be slow to save in EPS COLORBAR  Can’t change range- specified in data PLOT  Multiple axes can be slow if it’s not a direct multiplier  Skew-T in the new plotting system would be a nightmare

Overview IDL 8.0 makes simple things easier! IDL 8.0 makes complex things harder! Overall, adapt code as you see fit- I’m moving most of my new simple plotting (especially error and bar plots) to the new system, but will probably keep the old Direct Graphics for mapping and filled contours