Announcement

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

  • dstat graph options

    Hi,

    I am using dstat to build layered histograms, but I struggle to adjust the colors of the graph region or the bars. Can anybody please help?

    Here is my current code:
    dstat histogram age, over(period) graph(merge) freq

    I even was trying to use grstyle like this:
    grstyle init
    set scheme s2color
    grstyle set plain

    and then run the dstat command, but no change.

    Thank you.
    Olga




    Attached Files

  • #2
    Hi Olga,
    I think that is just the order:
    Code:
    set scheme s2color
    grstyle init
    grstyle set plain
    dstat histogram age, over(period) graph(merge) freq
    In other words "grstyle init" should be after set scheme.

    Comment


    • #3
      Fernando, thank you! That did it! Can I ask another question? Since dstat does not accept option "name," how could I combine two graphs generated by dstat so they are displayed in one figure? I would normally use graph combine.

      Comment


      • #4
        hmmmm
        that is interesting. I wonder if it is an oversight from Ben Jann.
        So, I would say two things.
        1) you should contact Ben through his github. I did it for colorpalette and he replied right away. Im sure adding the "name" option is quite easy.
        2) Since option 1 may take a bit of time, the other option you have is combine your graphs the "old" way.
        Example:
        Code:
        scatter price mpg if foreign==1
        graph save m1
        scatter price mpg if foreign==0
        graph save m2
        graph combine m1.gph m2.gph
        So rather than storing the graphs in memory (name) you save them in your disk.
        HTH

        Comment


        • #5
          Fernando, that's helpful, thank you!

          Comment


          • #6
            Graph options need to specified within graph(). Example:

            Code:
            sysuse auto
            dstat hist price, over(foreign) graph(merge graphr(color(white)) name(g1))
            An alternative is to use dstat graph after calling dstat without graph() option. Example:

            Code:
            dstat hist price, over(foreign) notable
            dstat graph, merge graphr(color(white)) name(g1)
            ben

            Comment

            Working...
            X