Friday, January 31, 2014

Script: diamondbar.gs; Draw a colorbar using diamond shapes on your plots.

I have not added anything to this blog as of late, I have been busy with a number of different projects including my participation in the OWLeS field project.  Recently I have seen a few presentations that showed figures that had color bars made up of diamonds rather than rectangles (see below).  I figured it might be fun to put together a quick script that allows you to do this in GrADS.
Colorbar with diamonds using diamondbar.gs






Example usage:
            'diamondbar -r -marg 0.1 -font 0.09 -fs 2'

This is the call used to plot the colorbar on the above example. 

Options:        -help           - Pulls up this Help Page
                       -loc             - Chooses location for the colorbar (r=right-vertical,                                                                            l=left-vertical, b=bottom-horizontal,t=top-horizontal)                                                                             can also be called by (-l,-r,-b,-t)'
                        -size/s        - sets size of each diamond, defaults to "auto"
                        -marg            - sets margin to axis
                        -fs/int         - sets the interval for each number plotted along the colorbar
                        -font/fontsize  - sets the font size of the numbers
                        -scol           - sets the color of the numbers
                        -line           - draws outline around each diamond if included  


Anyway, I had some free time recently, and I got inspired to write a new script, so I quickly put together this script.  I haven't used it too much, but I certainly see how and where it could be useful, perhaps to add a little flare to your figures.  Enjoy!  And as always, report any bugs!

Note:  The example script will generate the plot above and requires the script color.gs

Download diamondbar.gs

Download Example Script

6 comments:

  1. Your blog is an excellent resource for Grads. Thank you so much for putting this together.

    ReplyDelete
    Replies
    1. I can't believe it took me so long to see this comment! Thank you for the kind words!

      Delete
  2. You are writing some Amazing tips. This article really helped me a lot. Thanks for sharing this blog.
    nykaa nivea coupons code

    ReplyDelete
  3. Amazing post! .I appreciate your hard work. Thank you for sharing. I have also share some use full information.
    echobeat earbuds review
    charge boost reviews
    liporing toering
    doc socks review
    livewave antenna

    ReplyDelete
  4. Thanks for sharing an article like this. The information which you have provided is better than another blog.
    tactical x flashlight

    ReplyDelete