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

Questions about #proc breakaxis

Expand Messages
  • hirakuono <hono-tky@umin.ac.jp>
    Recently I found ploticus on WWW and started to use, finding it very useful and promising. Thank you very much. Today I have two questions about #proc
    Message 1 of 5 , Mar 4, 2003
    • 0 Attachment
      Recently I found ploticus on WWW and started to use, finding it very
      useful and promising. Thank you very much.
      Today I have two questions about #proc breakaxis. (1) I am writing a
      vertical bar graph whose xaxis-stubs are not numbers but categories
      (#proc xaxis stubs: usecategories). In this case, when a bar whose
      stub is "SampleA", I could break this bar using "#proc breakaxis
      location: SampleA". However, when a bar has a stub which includes
      white space (for example, "Sample A"), when I write "#proc breakaxis
      location: Sample A", this bar could not broken. How I can break a bar
      having stubs including white spaces? (2) Could I break "clustered"
      vertical bars? If I could, how I could specify the specific bars to
      break, which are clustered with other bars? Thank you.
    • Stephen C. Grubb
      ... Apparently proc breakaxis location cannot take values with embedded whitespace. It should, and I will fix this for the next release. In the meantime a
      Message 2 of 5 , Mar 5, 2003
      • 0 Attachment
        > Recently I found ploticus on WWW and started to use, finding it very
        > useful and promising. Thank you very much.
        > Today I have two questions about #proc breakaxis. (1) I am writing a
        > vertical bar graph whose xaxis-stubs are not numbers but categories
        > (#proc xaxis stubs: usecategories). In this case, when a bar whose
        > stub is "SampleA", I could break this bar using "#proc breakaxis
        > location: SampleA". However, when a bar has a stub which includes
        > white space (for example, "Sample A"), when I write "#proc breakaxis
        > location: Sample A", this bar could not broken. How I can break a bar
        > having stubs including white spaces?

        Apparently "proc breakaxis location" cannot take values with embedded
        whitespace. It should, and I will fix this for the next release. In the
        meantime a workaround is suggested in the example below.

        > (2) Could I break "clustered" vertical bars? If I could, how I could
        > specify the specific bars to break, which are clustered with other
        > bars?

        proc breakaxis works (rather crudely) by drawing a gap on top of whatever
        is already there. Thus it will work for clustered vertical bars, see the
        example:

        #proc getdata
        data:
        testA 2 8 4
        testB 8 8 9

        #proc areadef
        rectangle: 1 1 3 3
        yrange: 0 10
        xcategories: datafield=1
        xaxis.stubs: text
        Test A
        Test B

        #proc bars
        color: red
        cluster: 1 / 3
        locfield: 1
        lenfield: 2
        barwidth: 0.08

        #proc bars
        color: blue
        cluster: 2 / 3
        locfield: 1
        lenfield: 3
        barwidth: 0.08

        #proc bars
        color: orange
        cluster: 3 / 3
        locfield: 1
        lenfield: 4
        barwidth: 0.08

        #proc breakaxis
        axis: y
        breakpoint: 5
        location: testA

        #proc breakaxis
        axis: y
        breakpoint: 5
        location: testB
        linelength: 0.4
      • hirakuono
        Dear Stephen, Thank you very much for your considerable answer and future plan to deal with stubs with whitespace. I am using ploticus as a filter, which
        Message 3 of 5 , Mar 5, 2003
        • 0 Attachment
          Dear Stephen,
          Thank you very much for your considerable answer and future plan to
          deal with stubs with whitespace. I am using ploticus as a filter,
          which exchange my statistic data outputted from Perl script into
          postscript-formatted graphs. I like ploticus very much because I can
          customize it very flexibly (especially when ploticus-script is
          automatically produced by Perl script, I think), which I cannot do
          using commercial MS-Windows based graph softwares.
          Could I write some hopes for ploticus? Firstly, in vertical bar
          graphs whose X-axis is categories, I would like to position tics not
          at the same place as the stubs, but at the midways of each stubs and
          at the both edge of X-axis. Secondly, when bars are clustered
          (especially when more than 8-10 bars are clustered to two clusters),
          the distance of one cluster to another becomes too close, and in
          contrary, the distance from the edges of X-axis to cluster becomes
          too far, I think. Of course, now I can modify these by using Adobe
          Illustrator after ploticus makes graphs. I will appreciate if you
          may consider these points. Thank you.
        • Stephen C. Grubb
          ... This can be done with a bit of trickery: #proc getdata fieldnames: dwarf value data: Happy 8 Sneezy 10 Dopey 12 Grumpy 6 #proc areadef xrange: categories
          Message 4 of 5 , Mar 19, 2003
          • 0 Attachment
            > In vertical bar graphs whose X-axis is categories, I would like to
            > position tics not at the same place as the stubs, but at the midways
            > of each stubs and at the both edge of X-axis.

            This can be done with a bit of trickery:

            #proc getdata
            fieldnames: dwarf value
            data:
            Happy 8
            Sneezy 10
            Dopey 12
            Grumpy 6

            #proc areadef
            xrange: categories
            xcategories: datafield=dwarf
            yrange: 0 20
            yaxis.stubs: inc
            xaxis.stubs: usecategories

            // the following shift the categories leftward..
            xaxis.stubslide: -0.5(s)
            xaxis.ticslide: -1(s)
            // don't draw axis line here.. it will be too long..
            xaxis.axisline: none

            // draw a shorter axis line.. also rightmost tic..
            #set LASTCAT = $dataitem( @NRECORDS, dwarf )
            #proc line
            linedetails: width=0.5
            points: 0(s) 0(s) @LASTCAT(s) 0(s)
            @LASTCAT(s) 0(s)-0.08

            // this shifts all plotting leftward..
            #proc catslide
            axis: x
            amount: -0.5(s)

            #proc bars
            barwidth: 0.2
            locfield: dwarf
            lenfield: value
            color: orange
          • Stephen C. Grubb
            ... The width of clusters is proportional to the width of each bar, which can be controlled using the barwidth attribute. A smaller barwidth will give
            Message 5 of 5 , Mar 19, 2003
            • 0 Attachment
              > when bars are clustered
              > (especially when more than 8-10 bars are clustered to two clusters),
              > the distance of one cluster to another becomes too close, and in
              > contrary, the distance from the edges of X-axis to cluster becomes
              > too far, I think.

              The width of clusters is proportional to the width of each bar, which can
              be controlled using the 'barwidth' attribute. A smaller barwidth will
              give tighter clusters.

              You're correct that the space from the Y axis (assuming vertical bars) to
              the first cluster is greater than the space between clusters. You could
              remedy this using a slide approach similar to the one I suggested for your
              first question, the category tics problem.

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