Announcement

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

  • Bug in the connect option of twoway graph?

    I am trying to plot a number of graphs using the ascending and stairstep connect styles of the connect option. My data is sorted by id and x. The command

    . twoway (line y x, connect(ascending stairstep))

    ignores the stairstep connect style, while the command

    . twoway (line y x, connect( stairstep ascending))

    ignores the ascending option. Neither command generates an error message. The help file appears to indicate that I can include multiple styles in my connect option. Is this a bug or am I misreading the help file?

    Ultimately, I would like to plot a large number of curves on a single graph. I could issue commands like

    . twoway (line y x if id==1, connect( stairstep)) (line y x if id==2, connect( stairstep))

    Is this the optimal way of getting what I want? I could build up this command using a local macro. Are there any limits to the size of a twoway graph command? If I wanted to plot graphs from 1000 bootstraps, would this approach work?

  • #2
    Bill,

    I'm pretty sure that connect only allows one style - which would explain the results from your first two command

    I do not know the answer to your question about limits on the length of such a command; did you look at
    Code:
    help limits
    ?

    Comment


    • #3
      You can give a list of connect styles but they are associated one by one with your y variables. Had the command been

      Code:
       twoway (line y1 y2 x, connect(ascending stairstep))
      then y1 would be plotted with ascending style and y2 stairstep style.

      Code:
       twoway (line y1 y1 x, connect(ascending stairstep))
      should be legal, I think, but the result will be to superimpose the same data connected differently. So, no bug. That's the design.

      Comment


      • #4
        Rich

        Bingo! Help limits says that I can have 4 million characters in a command. So building a macro that generates a thousand separate plots should work just fine unless I run afoul of the options limit. I am allowed 256 options. If I have 1000 plots and each plot has one connect option (and one if modifier) will that get me into trouble? I guess I need to try it and see what happens.

        In any event, thanks for alerting me to the limits help command.

        Nick

        Thanks for your response. This is helpful for understanding what Stata is doing. I do feel that Stata's help on how this option works could be improved.

        Best wishes,

        Bill

        Comment

        Working...
        X