Announcement

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

  • How to generate a gradient colored legend after a custom graph in Stata?

    This post is related to my previous query:

    https://www.statalist.org/forums/for...-maps-in-stata

    To simplify matters: let's suppose one has a scatter plot as follows:

    Code:
    clear
    set obs 10
    gene x = _n
    gene y = _n
    scatter x y, xsize(8) aspect(0.7)
    which will look like this:
    Click image for larger version

Name:	scatter.png
Views:	3
Size:	49.6 KB
ID:	1649839







    The idea is to plot on the left-hand side a custom gradient bar. For example:
    Click image for larger version

Name:	Selection_667.png
Views:	2
Size:	20.1 KB
ID:	1649840






    I haven't figured out something straightforward that generate that gradient colored legend. Does anyone have experience with that? Any suggestions?


    All the best,

    Tiago
    Last edited by Tiago Pereira; 13 Feb 2022, 06:49.
Working...
X