1.191 FAQ-892 How to plot evenly spaced column/bar for unevenly spaced numeric X?
Last Update: 2/18/2019
We recommend Origin 2018 for this since it directly plots so for multi-Y data.
If plotting single Y data or using older Origin versions before Origin 2018, X are not evenly spaced. there are four approaches.
Approach 1: Set X as Text before Plotting
- Double click X column header to open the Column Properties dialog. Set Format as Text under Options branch
- Plot column/bar graph.
!!!Drawback: Since the X column is changed to text, you will not be able to use it as numeric data for subsequent analysis such as curve fitting.
Approach 2: Use Plot Setup Dialog to Plot against Row Index
- Without any column selected in worksheet, select Plot > Basic 2D : Column menu to open Plot Setup dialog. In the middle panel, select <autoX> as X, and check col(B) as Y. Click Add button and then OK button to plot a column/bar graph.
- The tick labels will show 1, 2, 3, ... To show X values as tick labels, double click the X tick label to open the Axis dialog. On Tick Labels main tab, go to Display sub-tab, set Type to Text from dataset and select column A as Dataset.
Approach 3: Set X column as Disregard or Y column before Plotting
By default when user highlights some Y column(s) to plot, Origin will auto-find X column on the left and plot against it. If there is no X column on the left, then Origin will plot against row index.
- Right click X column header and select Set As: Disregard or Set As: Y from the context menu.
- Highlight column B to plot the column/bar graph.
- Same as Approach 2, the X tick labels is 1, 2, 3... by default. Double-click on any X tick label axis to open the Axis dialog. On Tick Labels tab, go to the Display sub-tab, set Type to Text from dataset and select column A as Dataset.
!!!Drawback: Since X column is set as disregard/Y column, when doing analysis, Origin will not find X column by default either.
Approach 4: Set Axis Type as Discrete
- If the graph is already created, double click on X axis to open the Axis dialog. On Scale tab, set Type to Discrete as below. Click Apply button.
- Now, the columns/bars are distributing evenly spaced. To make show X data as tick labels,
- Still on Scale tab, go to Major Ticks branch to specify X data as tick positions:
- Go to Tick Labels tab, in the Display sub-tab, set Tick Labels Type as Tick-indexed Dataset, and show X data as tick labels.
Keywords:unevenly spaced, column, bar, evenly spaceD, equally spaced, isometric, discrete