Plotting only certain values per axis

Welcome to our Forums Technical Support Support Desk Plotting only certain values per axis

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #6229
    joel turner
    Participant

      I have some data which is comprised of multiple samples, each of which has been treated in a certain way that can be considered in one of 4 categories. I’m trying to produce a simple stacked bar chart of sample composition based against sample ID, but showing each category on a different X-axis. For example axis one includes sample 1 and sample 9, while axis two needs to include samples 2, 3, 5, 7 and 8 etc. All x-axis share a common y-axis.

      At the moment when using a mask to select which samples are drawn on each axis, axis one ends up with bars at 1 and 9, and empty ticks for samples 2-8, which I’d like to avoid. I’d like the bars to be consecutive on each axis, and then I can use a text label to describe each category. At the moment I’m getting lots of whitespace on each graph which serves no purpose!

      #6230
      dgteam
      Moderator

        The Bars command will always draw the bar based on the row number in the data table.

        For example, here is some data.

        data

        If the Bars command is used with a Split axis and a mask for each group (a or b) you get something like this, which sounds like what you are seeing.

        Bars

        There are two other commands that draw bars and give you more control over the location.  One is the Bar command.  The other is the Pivot command.

        Here is an article that compares all three: How to make a Bar Graph

        For example, to use the Pivot command in this case …

        1 – Select the columns Sample and Data

        2 – Click the Pivot command shortcut

        3 – In the new command, apply the mask

        4 – Make a copy of the command and edit the mask as needed

        5 – Split the Y axis and place one on each axis

        Then you can get something like this …

        Pivot

        In this example, the X tick mark labels were also changed to Categories and Labels = #, to show the row number rather than the sample number.

        PivotEx

        Does this help?

      Viewing 2 posts - 1 through 2 (of 2 total)
      • You must be logged in to reply to this topic.

      Welcome to our Forums Technical Support Support Desk Plotting only certain values per axis