Loading ...
Sorry, an error occurred while loading the content.

Cleveland-style dotplots: how to?

Expand Messages
  • jsandppr <jsandppr@yahoo.com>
    Hello! I m a couple hours new to Ploticus, but it looks like a lot of fun already! I m interested in generating dotplots for simple comparisons of univariate
    Message 1 of 2 , Jan 11, 2003
    • 0 Attachment
      Hello!

      I'm a couple hours new to Ploticus, but it looks like a lot of fun
      already!

      I'm interested in generating dotplots for simple comparisons of
      univariate data. I know that the term "dotplot" is used in any number
      of ways, so here's a link to a (poor-looking) example of the kind I'm
      looking to create:
      http://students.washington.edu/dfinlays/himalaya/images/sm_dotplots.jpg

      Having poured over the Ploticus examples, the only thing that looks
      really close that I thought I could copy from to get going was the
      "timely" example. Like Bill Cleveland's "dotplots", it's got
      categories up the side, and dots next to those categories plotted
      along a common X axis.

      "Timely" uses the boxplot tool (proc rangebar) in Ploticus to create
      the boxes already correctly lined up with the Y-axis categories --
      which is excellent! But there doesn't seem to be a way to tell
      rangebar not to use any whiskers. But while I haven't been able to
      coerce it into just displaying dots, it seems a bit silly to use such
      a powerful boxpot tool just to place single dots.

      Based on reading discussions in the archives, it seems like the
      scatterplot tool is more appropriate for simply placing dots.
      However, the scatterplot tool seems to need an explicit X and Y rather
      than "knowing" how to plot in the Y-axis categories the way the
      rangebar tool in the "timely" example does. And figuring out all the
      Y-axis offsets manually seems silly, since Ploticus clearly knows how
      to do this in other contexts.

      Also, I'd like to make thin horizontal lines across the graph (as
      shown on the example .gif). Again, I see how to draw lines, but not
      how to have them automatically line up with the categories on the Y axis.

      Finally, "timely.htm" hard-codes the categories. I can't tell if the
      Ploticus control file could have ascertained them on its own from the
      data, or if pre-processing the data to produce an appropriate ploticus
      control file with the categories listed will be necessary.

      Any suggestions? Pointers? Examples? Specific parts of the fine
      manual I should pay closer attention to?

      I think Cleveland-style dotplots are an excellent way to display
      univariate data, yielding a very readable and uncluttered presentation
      of the data without extra chartjunk. When I was using Excel for
      ad-hoc administrative data display, I missed them sorely. Now that
      I'm pulling together my own reports, I want to start using them again.

      Thanks so much for your help!


      jsp
    • jsandppr <jnoble@frii.net>
      I ve spent a few more hours at it, and have figured out most of my questions. The dotplots I ve got look great! Really spectacular in SVG format! I just
      Message 2 of 2 , Jan 13, 2003
      • 0 Attachment
        I've spent a few more hours at it, and have figured out most of my
        questions. The dotplots I've got look great! Really spectacular in
        SVG format! I just wish the Adobe Windows SVG viewer would print
        reasonably. (It doesn't send vector data to the printer -- it
        rasterizes it into a huge bitmap to send (from what I can tell).
        Their release notes indicate that they know about this and may fix it
        someday.)

        Just in case anyone's interested, I'll note what found below. Of
        course, if I'm overlooking something or doing something silly, please
        let me know!

        Earlier, I wrote:
        > "Timely" uses the boxplot tool (proc rangebar) in Ploticus to create
        > the boxes already correctly lined up with the Y-axis categories --
        > which is excellent! But there doesn't seem to be a way to tell
        > rangebar not to use any whiskers. But while I haven't been able to
        > coerce it into just displaying dots, it seems a bit silly to use
        > such a powerful boxpot tool just to place single dots.
        >
        > Based on reading discussions in the archives, it seems like the
        > scatterplot tool is more appropriate for simply placing dots.
        > However, the scatterplot tool seems to need an explicit X and Y
        > rather than "knowing" how to plot in the Y-axis categories the
        > way the rangebar tool in the "timely" example does. And figuring
        > out all the Y-axis offsets manually seems silly, since Ploticus
        > clearly knows how to do this in other contexts.

        Turned out that using rangebar wasn't the right thing to do, and that
        "1-D" scatterplots were easily possible. Just tell it to use the
        category datafield for 'yfield' in the scatterplot tool, having
        earlier defined the yscaletype to be 'categories' and the ycategories
        to be based on that same datafield. Easy!

        > Also, I'd like to make thin horizontal lines across the graph (as
        > shown on the example .gif). Again, I see how to draw lines, but not
        > how to have them automatically line up with the categories on the Y
        > axis.

        I "cheated" on this and it worked great. I made the ytics a large
        negative number, which makes the tics extend into the chart. I chose
        a number which was the same as the width of the areadef, so the lines
        go all the way across at each category mark. Then yaxis.tics style,
        dashscale and color were set to make the lines light and unobtrsive.

        > Finally, "timely.htm" hard-codes the categories. I can't tell if
        > the Ploticus control file could have ascertained them on its own
        > from the data, or if pre-processing the data to produce an
        > appropriate ploticus control file with the categories listed
        > will be necessary.

        By defining ycategories to come from the datafield containing the
        categories, it was all automatic.

        I don't really understand why the timely example didn't do it this
        way. Maybe this is how you force them to be in a particular order
        without sorting the data file?


        Thanks for a great tool!


        jsp
      Your message has been successfully submitted and would be delivered to recipients shortly.