pplot tutorial

From DavinciWiki
Jump to: navigation, search

Description

Run through a variety of pplot() cases.

Arguments and Return Values

Arguments: none.

Return Value: none. GnuPlot is launched and displays graph.

Usage

Syntax: pplot_tutorial()

Examples

See Plotting Spectra with pplot for step by step commands.

Each image corresponds to the listed command.

dv> pplot_tutorial()
........../themis/lib/dav_lib/examples/minites_cube.vicar: VICAR bip image: 21x10x167, 32 bits
./themis/lib/dav_lib/examples/minites_spectrum.vicar: VICAR bip image: 1x1x167, 32 bits
..........................................................
/themis/lib/dav_lib/examples/TES_emissivity_example.vic: VICAR bsq image: 40x1x143, 64 bits
data: 225x1x923 array of float, bsq format [830,700 bytes]
label: Text Buffer with 225 lines of text
   1: Andesine BUR-240 1
   2: Spodumene HS-210.4B 2
   3: Magnesiohastingsite HS-115.4B 3
   4: Wollastonite WAR-8884 4
   5: Albite WAR-0244 5
   6: Bronzite BUR-1920 6
   7: Pyroxmangite WAR-6894 7
   8: Forsterite BUR-3720A 8
   9: reject
   10: reject
xaxis: 1x1x923 array of float, bsq format [3,692 bytes]
........................................................
/themis/lib/dav_lib/examples/asudata.vicar: VICAR bsq image: 225x1x923, 32 bits
.......................................................
/themis/lib/dav_lib/examples/spectra_cube.vicar: VICAR bsq image: 10x1x923, 32 bits
data: 7x1x923 array of float, bsq format [25,844 bytes]
label: Text Buffer with 7 lines of text
   1: Andesine BUR-240 1
   2: Spodumene HS-210.4B 2
   3: Magnesiohastingsite HS-115.4B 3
   4: Wollastonite WAR-8884 4
   5: Albite WAR-0244 5
   6: Bronzite BUR-1920 6
   7: Pyroxmangite WAR-6894 7
xaxis: 1x1x923 array of float, bsq format [3,692 bytes]
doing broadband
...............................................................................
/themis/lib/dav_lib/library/script_files/instrument_parameters/aster_ir_spectral_response_cm.vic: VICAR bsq image: 6x1x401, 32 bits
doing broadband
...............................................................................
/themis/lib/dav_lib/library/script_files/instrument_parameters/tims_ir_spectral_response_avg_cm.vic: VICAR bsq image: 7x1x158, 64 bits
doing broadband
...............................................................................
/themis/lib/dav_lib/library/script_files/instrument_parameters/aster_ir_spectral_response_cm.vic: VICAR bsq image: 6x1x401, 32 bits
1. Simplest possible case: 1 vector, no colors, no labels - like xplot
"pplot(spectrum)"
pausing

pplot2 tutorial1.png

2. Simple case: 1 vector with user-input x-axis, no colors, no labels
"pplot(spectrum, xaxis=xlab1)"
pausing

pplot2 tutorial2.png

3. Next simplest case: 1 array, user-input x-axis, no colors, no labels
   - will cycle colors automatically
"pplot(lab_array, xaxis=xlab1)"
pausing

pplot2 tutorial3.png

4. Array of spectra, 1 color (for all), 1 label, x and y axis labels, key in specfic location
   Note: Order doesn't matter for colors and labels)
"pplot(lab_array, 'Lab Spectra', 5, xaxis=xlab1, xlabel = 'Wavenumber', ylabel = 'Emissivity', key= '1400, .91')"
pausing

pplot2 tutorial4.png

5. Array of spectra, 1 color (for all), 1 label, standardized lab plot
"pplot(lab_array, 5, 'Lab Spectra', lab1=1)"
...............................................................................
pausing

pplot2 tutorial5.png

6. 1 array, 1 label, no colors specified - will auto cycle through colors and add index to label.
  Key in bottom right.  Standard Mini-TES plot
"pplot(array, 'Mini-TES Array', key = 'bottom right', mtes=1)"
pausing

pplot2 tutorial6.png

7. 2 different data elements with different x axes.
  x, y limits,  manually make lower x-axis wavelength but linear in cm-1
  The x-axis is in wavenumber, but want a plot that is in wavelength on the lower axis
  line weight 5, font_size 26, x-axis, y-axis, and plot labels

"pplot({asudata[1:2], asterdata[1:2]}, xaxis={xlab1, xastercm}, {'Lab', 'ASTER'}, key = 'outside', \
wave=1, x1=500, x2=1500,  y1=.7, y2=1.05, lw = 5, font_size=26, xlabel='Wavenumber', \
ylabel='Emissivity', plot_title = 'Lab and ASTER Example')"
pausing

pplot2 tutorial7.png

8. 2 data elements (1 array & 1 vector), 2 colors, 2 labels - single color and single label for each data element
"pplot({array, avg(array, xy)}, {1,2}, {'Spectra', 'Ave. Spectrum'}, xaxis=xmtes, x1=500, \
x2=1800, y1=.7, y2=1.02, cm=1)"
pausing

pplot2 tutorial8.png

9. ASU spectral structure example
"pplot(spec_struc)"
pausing

pplot2 tutorial9.png

10. Resample example - lab, mtes, tes, and themis spectra
doing broadband
.........................................................
doing broadband
.........................................................
doing broadband
.........................................................
"pplot({asu.data[1], a1, t1, th1},{1,2,3,4}, {'Lab','ASTER', 'TIMS', 'THEMIS'}, key='1450,.96', \
xaxis={xlab1, xacm, xtcm, xthcm}, x1=500,  x2=1800, y1=.88, y2=1.01)"
pausing

pplot2 tutorial10.png

11. write to ps and pdf files. TES default plot, wavenumber on bottom x axis, ps, pdf
"pplot({tes_emiss[1:3,1]}, {'TES Array'}, key = '900, .9', tes=1, emiss=1, cm=1, \
ps=$TMPDIR+"/junk.ps", pdf=1)"
Outputting postscript to file: ./junk.ps
Wavelength on the top
converting to pdf file ./junk.ps.pdf
Using postscript line colors from file: /u/cedwards/.Xdefaults
pausing

pplot2 tutorial11.png

Now I'll demonstrate the more esoteric functions and features
3 vectors, 3 labels, no colors - will auto cycle through colors
"pplot({a,b,c}, {'V1', 'V2', 'V3'}, mtes=1)"
pausing

pplot2 tutorial12.png

2 data elements, 2 colors, 2 labels in structures - single color and single label for each data element
"pplot({array, xx}, {1,2}, {'a', 'b'}, mtes=1)"
pausing

pplot2 tutorial13.png

Just 1 data element with 4 vectors in x, 4 labels, 4 colors
"pplot(array[1:4, 1], {1,3,5,6}, {'a', 'b', 'b', 'd'}, mtes=1)"
pausing

pplot2 tutorial14.png

3 data elements, colors WERE specified, one color for each and 1 label for 'a', 'xx', 'yy'
"pplot({array,xx, yy}, {1,3,7}, {'a','xx', 'yy'}, mtes=1)"
pausing

pplot2 tutorial15.png

THEMIS default plot, wavelength on bottom x axis
"pplot(emthemis_cube, 'THEMIS', key = '1100, .96', themis=1, emiss=1)"
pausing

pplot2 tutorial16.png

DavinciWiki Mini-Nav Bar

Contents


Contact Developers

  • davinci-dev [AT] mars.asu.edu

All other topics

  • See navigation on the left

Major Sub-Functions

Recent Library Changes

Created On: 09-08-2010
Modified On: 09-08-2010

Personal tools