| 1 | PRO PS_Plotter, image, $ |
|---|
| 2 | European=european, $ ; Set this keyword if you want European measurements. |
|---|
| 3 | Font=font, $ ; Set this keyword if you want font information. |
|---|
| 4 | Object=object ; Output variable to return FSC_PSConfig object. |
|---|
| 5 | |
|---|
| 6 | ; Get an image if one is not passed in. |
|---|
| 7 | |
|---|
| 8 | IF N_Elements(image) EQ 0 THEN BEGIN |
|---|
| 9 | image = BytArr(360, 360) |
|---|
| 10 | file = Filepath(SubDirectory=['examples', 'data'], 'worldelv.dat') |
|---|
| 11 | OpenR, lun, file, /Get_Lun |
|---|
| 12 | ReadU, lun, image |
|---|
| 13 | Free_Lun, lun |
|---|
| 14 | ENDIF |
|---|
| 15 | |
|---|
| 16 | ; Create the PostScript configuration object. |
|---|
| 17 | |
|---|
| 18 | object = Obj_New('FSC_PSConfig', European=Keyword_Set(european)) |
|---|
| 19 | |
|---|
| 20 | ; We want hardware fonts. |
|---|
| 21 | |
|---|
| 22 | thisFontType = !P.Font |
|---|
| 23 | !P.Font = 1 |
|---|
| 24 | |
|---|
| 25 | ; Get user input to PostScript configuration. |
|---|
| 26 | |
|---|
| 27 | IF Keyword_Set(font) THEN object->GUI, /Font ELSE object->GUI |
|---|
| 28 | |
|---|
| 29 | ; Configure the PostScript Device. |
|---|
| 30 | |
|---|
| 31 | thisDevice = !D.Name |
|---|
| 32 | Set_Plot, 'PS' |
|---|
| 33 | keywords = object->GetKeywords(FontType=fonttype) |
|---|
| 34 | Device, _Extra=keywords |
|---|
| 35 | |
|---|
| 36 | ; Draw the example plots. |
|---|
| 37 | |
|---|
| 38 | !P.Multi = [ 0, 1, 2] |
|---|
| 39 | TVImage, image |
|---|
| 40 | Plot, Histogram(image), Title='Example Histogram Plot', XTitle='Pixel Value', $ |
|---|
| 41 | YTitle='Number of Pixels', XStyle=1, Max_Value=5000 |
|---|
| 42 | !P.Multi = 0 |
|---|
| 43 | |
|---|
| 44 | ; Clean up. |
|---|
| 45 | |
|---|
| 46 | Device, /Close_File |
|---|
| 47 | Set_Plot, thisDevice |
|---|
| 48 | !P.Font = thisfontType |
|---|
| 49 | |
|---|
| 50 | ; Return the PS_Configuration object or destroy it. |
|---|
| 51 | |
|---|
| 52 | IF Arg_Present(object) EQ 0 THEN Obj_Destroy, object |
|---|
| 53 | END ;-------------------------------------------------------------------------------- |
|---|
| 54 | |
|---|
| 55 | |
|---|
| 56 | |
|---|
| 57 | |
|---|
| 58 | |
|---|
| 59 | |
|---|
| 60 | |
|---|