Announcement

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

  • Modifying graph in ado-file

    Hello statalist.

    I've earlier worked with different graph types and I'm still playing around with some of the functions in a few of them and I keep needing something very specific that I don't know how to fix in the radar-ado.

    Below I have attached an example of some data and how the radar chart creates the graph. What I want it to do is, instead of drawing a line between the vectors, I need it to just mark the spot on the vector with a dot/mark/something and NOT connect it with lines. It might sound a little useless but it is for something very specific where I really need to do this exact thing. I've looked in the programs ado-file but I am unsure how to identify the places where it defines the lines and even more so; how to change that spot with something different.

    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input str1 OC float oc
    "1"  .8916667
    "2"  .8388889
    "3"       .75
    "4"  .6027778
    "5" .28333333
    "6"  .3805556
    "7"  .3388889
    "8"  .8138889
    end
    
    cap ssc install radar
    radar OC oc, lc(red blue green) r(0 .1 .2 .3 .4 .5 .6 .7 .8 .9 1) labsize(*.7)

  • #2
    One way is to record the changes you want in Graph Editor and then graph play the recording after the initial graph is created.

    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input str1 OC float oc
    "1"  .8916667
    "2"  .8388889
    "3"       .75
    "4"  .6027778
    "5" .28333333
    "6"  .3805556
    "7"  .3388889
    "8"  .8138889
    end
    
    cap ssc install radar
    radar OC oc, lc(red blue green) r(0(.1)1) labsize(*.7) 
    graph play "C:\Users\Scott\Desktop\radar scatter.grec"

    Graph.png

    Comment


    • #3
      I think that if you change line 238 from

      Code:
       local g "`g' (line obsy`n' obsx`n'`xopt')"
      to
      Code:
       local g "`g' (scatter obsy`n' obsx`n'`xopt')"
      you will get what you want. You can add mcolor(`lc') so that your "red" color option continues to work :
      Code:
      local g "`g' (scatter obsy`n' obsx`n'`xopt' mcolor(`lc'))"
      Remember to
      • rename the program at the top of the file: pr myradar
      • rename the file itself: myradar.ado
      • save the file to your personal ado path: see output from adopath
      • Click image for larger version

Name:	Graph.png
Views:	1
Size:	24.4 KB
ID:	1335095
      Last edited by Carole J. Wilson; 11 Apr 2016, 07:34.
      Stata/MP 14.1 (64-bit x86-64)
      Revision 19 May 2016
      Win 8.1

      Comment


      • #4
        Carole gives good advice, but the extension should be .ado, not .do.

        Comment


        • #5
          Thanks, Nick! I fixed it.
          Stata/MP 14.1 (64-bit x86-64)
          Revision 19 May 2016
          Win 8.1

          Comment


          • #6
            Thank you Carole! Just what I wanted - now I know where to look when I need to modify that!

            Comment

            Working...
            X