1.191 FAQ-892 How to plot evenly spaced column/bar for unevenly spaced numeric X?Evenly-Space-ColBar
Last Update: 5/14/2021
If you have numeric X and select one Y column to plot column/bar chart
If you were to select B(Y) in the following worksheet and create a column plot (Plot > Basic 2D: Column), the default would be to create the graph shown to the right of the worksheet. This happens because Y values are plotted on a numeric X scale.
![Show As Evenly Spaced Bar 1Y.png](//d2mvzyuse3lwjc.cloudfront.net/doc/en/QuickHelp/images/How_to_plot_evenly_spaced_column_or_bar_for_unevenly_spaced_x/Show_As_Evenly_Spaced_Bar_1Y.png?v=65399)
If, on the other hand, you had wanted to plot the bars as evenly spaced on the X axis, there are a couple of options:
![Show As Evenly Spaced Bar 1Y B.png](//d2mvzyuse3lwjc.cloudfront.net/doc/en/QuickHelp/images/How_to_plot_evenly_spaced_column_or_bar_for_unevenly_spaced_x/Show_As_Evenly_Spaced_Bar_1Y_B.png?v=66462)
Plot by X Column Value:
Setting the X column as Categorical will treat the X values as categories rather than numbers.
![Show As Evenly Spaced Bar 05.png](//d2mvzyuse3lwjc.cloudfront.net/doc/en/QuickHelp/images/How_to_plot_evenly_spaced_column_or_bar_for_unevenly_spaced_x/Show_As_Evenly_Spaced_Bar_05.png?v=65409)
- Highlight and right-click on the X column and choose Set As: Categorical.
- Highlight Y column to plot a column/bar graph.
Notes:
- !!!Drawback: Since the X column Format is changed to Text, you will not be able to use it as numeric data for subsequent analysis such as curve fitting.
- If you want to reorder the categorical values, double click on the Categorical cell and then change the order in the Categories dialog.
![Show As Evenly Spaced Bar 07.png](//d2mvzyuse3lwjc.cloudfront.net/doc/en/QuickHelp/images/How_to_plot_evenly_spaced_column_or_bar_for_unevenly_spaced_x/550px-Show_As_Evenly_Spaced_Bar_07.png?v=65411)
- In Origin 2017 or earlier versions, column/bar chart always plots column/bars at numeric X location no matter you choose one or more Y columns. So if you have non-evenly spaced X values and want to plot them as evenly spaced columns/bars, you can follow the above method.
|
Plot by Row Number:
Rather than use X column values, this method plots against row number.
- Without selecting any worksheet data, click Plot > Basic 2D: Column and designate X and Y as shown below. If you do not see the <autoX> option under Column, right-click in the right panel and click on Allow Row# as X.
- Click OK.
![FAQ-892 plot setup.png](//d2mvzyuse3lwjc.cloudfront.net/doc/en/QuickHelp/images/How_to_plot_evenly_spaced_column_or_bar_for_unevenly_spaced_x/FAQ-892_plot_setup.png?v=66459)
![](//d2mvzyuse3lwjc.cloudfront.net/doc/en/QuickHelp/images/How_to_plot_evenly_spaced_column_or_bar_for_unevenly_spaced_x/Tip_icon.png?v=8477) | You can display the X values at each tick by double-clicking on X-axis labels, then setting Type = Text from dataset and from the Dataset Name drop-down, choosing the X dataset.
![FAQ-892 text from dataset.png](//d2mvzyuse3lwjc.cloudfront.net/doc/en/QuickHelp/images/How_to_plot_evenly_spaced_column_or_bar_for_unevenly_spaced_x/FAQ-892_text_from_dataset.png?v=66463)
|
If you have numeric X and select multiple Y columns to plot column/bar chart
In Origin 2018 and later, Columns/Bars are plotted with evenly spaced X by default.
![Show As Evenly Spaced Bar.png](//d2mvzyuse3lwjc.cloudfront.net/doc/en/QuickHelp/images/How_to_plot_evenly_spaced_column_or_bar_for_unevenly_spaced_x/Show_As_Evenly_Spaced_Bar.png?v=65400)
This is done by setting X tick labels as Text from X dataset.
![Show As Evenly Spaced Bar axis 1.png](//d2mvzyuse3lwjc.cloudfront.net/doc/en/QuickHelp/images/How_to_plot_evenly_spaced_column_or_bar_for_unevenly_spaced_x/Show_As_Evenly_Spaced_Bar_axis_1.png?v=65401)
Notes:
If you want to show Columns/Bars at their actual numeric X locations, there are two approaches:
- Double-click on any X tick label to open Axis dialog.
- On the Tick Labels tab, set Display> Type as Numeric. Click OK.
![Show As Evenly Spaced Bar axis 2.png](//d2mvzyuse3lwjc.cloudfront.net/doc/en/QuickHelp/images/How_to_plot_evenly_spaced_column_or_bar_for_unevenly_spaced_x/Show_As_Evenly_Spaced_Bar_axis_2.png?v=65402)
- Click the Rescale button
to show the full scale range.
Alternately
- Select Preferences: System Variables... menu.
- Set system variable @DRX as 0. See this FAQ for information on setting the value of a system variable.
|
A note on plotting date-time data
Prior to Origin 2021b, date-time values in the X column would be treated as Text from dataset when labeling the X axis. This doesn't produce a true date-time scale.
This is changed and now date-time values in the X column will be treated as Date when labeling the X axis of the Column/Bar plot.
![FAQ-892 Date time X.png](//d2mvzyuse3lwjc.cloudfront.net/doc/en/QuickHelp/images/How_to_plot_evenly_spaced_column_or_bar_for_unevenly_spaced_x/FAQ-892_Date_time_X.png?v=66467)
Keywords:unevenly spaced, column, bar, evenly spaced, equally spaced, isometric, discrete, date, time
|