Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Labeling keys in a heatplot

    Hi

    I am working with the heatplot command and I have a figure that looks a bit like this:

    Code:
    webuse nhanes2, clear
    heatplot height age weight
    Click image for larger version

Name:	Graph.png
Views:	1
Size:	69.3 KB
ID:	1546927


    I realized that there are some ways to manipulate the legend on the right-hand side, but here's my question: Is there a way to remove the numbers that label the keys in the legend and replace them with words, e.g. to put the word "Tall" at the top (instead of 191.23) and the word "Short" at the bottom?

    Thanks so much
    Nora

  • #2
    You can use the Graph Editor to change the key labels or edit with -gr_edit- :
    Code:
    heatplot height age weight, keylabel(1 15)
    
    gr_edit legend.plotregion1.label[1].text = {}
    gr_edit legend.plotregion1.label[1].text.Arrpush Tall
    
    gr_edit legend.plotregion1.label[15].text = {}
    gr_edit legend.plotregion1.label[15].text.Arrpush Short

    Comment


    • #3
      Oh wow, thanks so much -- I had never heard of -gr_edit- before, what an exciting and mysterious command!

      Comment

      Working...
      X