Thread: move color scale of a spectrogram

Started: 2017-11-22 16:18:52
Last activity: 2017-12-01 00:28:06
Topics: SAC Help
aurora santiago
2017-11-22 16:18:52
Hi.
Will someone know how to move the scale of colors, to any position, that comes out mounted on the "y" axis of the spectrograms? I want to move it to a position outside the graph to avoid confusing the scale referred to the "y" axis with the color scale. Thank you
  • George Helffrich
    2017-11-23 19:33:51
    Dear All -

    This is somewhat complicated, but, briefly, you can use the SPECTROGRAM XYZ option (which makes the spectrogram into 3D data), and then plot the spectrogram and the color scale in two separate viewports on the same display. See the comments for how it works.

    fg seismogram ;* Test data
    spectrogram xyz; write /tmp/hold.xyz
    * Save bounds of spectrogram
    setbb smin &1,depmin&
    setbb smax &1,depmax&
    * Make 3D grid increasing from min to max value in spectrogram
    * This becomes the color scale when turned into a SAC xyz file
    funcgen npts 5 delta 1 line 0 %smax%; w /tmp/scale.sac ;* highest grid value
    do i = 1, 99
    funcgen npts 5 delta 1 line 0 ( %smax% - ($i$ * (%smax% - %smin%) / 100 ) )
    merge checktimes off /tmp/scale.sac ;* next lower grid value
    write /tmp/scale.sac
    enddo
    ch iftype ixyz nxsize 5 xminimum 0 xmaximum 4 nysize 100 yminimum 0 ymaximum 100
    w /tmp/scale.sac
    * Make spectrogram and color scale plot
    beginframe
    xvp 0.1 0.7; read /tmp/hold.xyz; grayscale color; xvp previous ;* spectrogram
    axis off bottom; ticks off top bottom; fileid off
    xvp 0.8 0.9; read /tmp/scale.sac; grayscale color; xvp previous;* color scale
    fileid previous; ticks previous; axis previous
    endframe

    On 23 Nov 2017, at 02:02, aurora santiago <auruis<at>yahoo.com.mx> wrote:

    Hi.
    Will someone know how to move the scale of colors, to any position, that comes out mounted on the "y" axis of the spectrograms? I want to move it to a position outside the graph to avoid confusing the scale referred to the "y" axis with the color scale. Thank you

    ----------------------
    SAC Help
    Topic home: http://ds.iris.edu/message-center/topic/sac-help/ | Unsubscribe: sac-help-unsubscribe<at>lists.ds.iris.edu

    Sent from the IRIS Message Center (http://ds.iris.edu/message-center/)
    Update subscription preferences at http://ds.iris.edu/account/profile/

    George Helffrich
    george<at>elsi.jp


    • aurora santiago
      2017-12-01 00:28:06
      Dear George Helffrich.

      Your help has been very useful for me. With some simple problems but I solved the problem with the steps that I indicated.

      Thank you very much.


21:22:47 v.b4412d20