pplot

From DavinciWiki

Jump to: navigation, search

Description

Plot one or more objects, with many options

Arguments and Return Values

Arguments: numeric arrays and strings

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

Usage

Syntax: pplot({data1, data2, ...}, [{color1, color2, ...}], [{"label1", "label2", ...}], [tes=1][mtes=1][themis=1][lab1=1], [xaxis=VAL], [wave=1][cm=1], [emiss=1], [ignore=VAL], [plot_title="string"], [key="string"], [x1=VAL], [x2=VAL], [y1=VAL], [y2=VAL], [xlabel="string"], [ylabel="string"], [lw=VAL], [font_size=VAL], [date], [noplim=1], [ps="filename"], [pdf=1], [print=1], [mono=1])

Every parameter except "data" is optional.

Each data element can be a vector or array.

Data elements can be a single standard ASU structure with data, label, and xaxis that are used appropriately.

Braces {} can be omitted if only plotting one variable.

{color1, color2, ...} = index of colors in your .Xdefaults; if you don't supply a color, colors will cycle through different colors for each vector. The color codes apparently vary by system; this has not been thoroughly examined.

On Linux (CentOS), they are: 1 red, 2 green, 3 blue, 4 magenta, 5 cyan, 6 brown, 7 orange, 8 red-orange; repeats after 8 (9 is red, 10 is green, etc.)

On Windows XP, they are: 1 red, 2 green, 3 blue, 4 magenta, 5 dark blue, 6 dark red, 7 dark cyan, 8 black, 9 gray (50%), 10 dark green, 11 mustard, 12 purple, 13 gray (25%), 14 cyan, 15 yellow; repeats after 15 (16 is red, etc.)

{"label1", "label2", ...} = labels for key (must be strings)

The order of label and color arrays doesn't matter. (It doesn't matter which comes first.)

pplot assumes data to be plotted are in z-axis - same as xplot(axis=z)

tes = 1 to make standard TES plot

mtes = 1 to make standard Mini-TES plot

themis = 1 to make standard THEMIS plot

lab1 = 1 to make standard ASU lab1 plot

xaxis = user-supplied x-axis vector (or structure of x-axes {x1, x2, ...}). If no x-axis option is specified, default is index (i.e. 1 to n).

Structure of data elements {data1, data2, ...} can have different x-axes if you also send in a structure of x-axes. pplot automatically resamples and plots with a common x-axis.

wave = 1 to make standard wavelength/wavenumber x-axis (microns on bottom, cm^-1 on top)

cm = 1 to make standard wavenumber/wavelength x-axis (cm^-1 on bottom, microns on top)

emiss = 1 to make standard emissivity y-axis (0.80 to 1.01)

ignore = user-supplied y-value that will not be plotted; useful if some values in spectrum are 0 and you don't want a lot of vertical lines

plot_title = "string" plot title

key = "top bottom left right outside below" (can use several as appropriate), or key = "x, y" in plot x, y units (e.g. key = "1300, .92")

x1 = min x for plot range

x2 = max x for plot range

y1 = min y for plot range

y2 = max y for plot range

xlabel = x-axis label

ylabel = y-axis label

lw = line weight (default is 3)

font_size = point size for axes and key labels (default is 22)

date = 1 to include date and time in plot title

noplim = 1: don't change plot limits inside pplot

portrait = 1: make a portrait plot (default is landscape)

ps = "filename": base name for output of a .ps file

pdf = 1: convert .ps files to .pdf

print = 1: print directly to default to your printer

mono = 1: black and white plot (.ps only)

Examples

dv> ASU_spec
170x923x1 array of double, bsq format [1,255,280 bytes]
dv> ASU_head
Text Buffer with 170 lines of text
    1: 456 Actinolite
    2: 603 Aegirine (aka Acmite)
    3: 438 Albite
    4: 454 Albite
    5: 560 Albite
    6: 462 Almandine
    7: 568 Andalusite
    8: 434 Andesine
    9: 561 Andesine
    10: 498 Anhydrite
dv> ASU_wvn
1x923x1 array of double, bsq format [7,384 bytes]
dv> pplot({ASU_spec[92,],ASU_spec[150,]}, {ASU_head[,92],ASU_head[,150]}, xaxis=ASU_wvn,
cm=1, emiss=1, plot_title="Spectra", key="bottom right", ylabel="Emissivity", lw=1)

Images

Result of pplot command in example

DavinciWiki Mini-Nav Bar

Contents


Contact Developers

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

All other topics

  • See navigation on the left

Related Functions

Created On: 01-10-2008
Modified On: 02-27-2009

Personal tools