ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Charts and Charting in Excel (https://www.excelbanter.com/charts-charting-excel/)
-   -   label x-axis values programmatically (https://www.excelbanter.com/charts-charting-excel/108450-label-x-axis-values-programmatically.html)

[email protected]

label x-axis values programmatically
 
Hi,
I am trying to plot a graph using X-Y plot in which values range on
x-axis are from .028 to 8760 hrs. I would like to expand the first 24
hrs of the plot to show the values distinctly. I tried to use the log
scale for x-axis but it will not accept values (no zero values and
negetive values, and also minimum is 10). Is there a way to do this
plot?
Thanks in advance for any help.
Nand


Jon Peltier

label x-axis values programmatically
 
The minimum of a log scale isn't 10, it can be any power of ten, like 1,
0.1, 0.01, etc. You would have to clean up the data to ensure that only
valid X values are plotted (no negative or zero values). I would think a log
scale might just work after all.

However, you can jury-rig the chart and the data so the scale early in the
range is expanded and later is compressed. The chart will have a "true" (but
hidden) X axis ranging from 0 to 1, and a dummy axis that shows 0-24 in the
first 1/4 of the chart and 24-8760 in the last 3/4. (If you want a division
other than 1/4-3/4, change the parameters in the formula below). To make any
X fit in the appropriate place on the axis, convert it using this formula
(use the formula to construct the dummy axis, too):

=IF(X<=24,X/24*1/4,1/4+(X-24)/(8760-24)*3/4)

I have several examples of dummy axis scales he

http://peltiertech.com/Excel/Charts/...tml#AxisScales
http://peltiertech.com/Excel/Charts/...Gridlines.html

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


wrote in message
ups.com...
Hi,
I am trying to plot a graph using X-Y plot in which values range on
x-axis are from .028 to 8760 hrs. I would like to expand the first 24
hrs of the plot to show the values distinctly. I tried to use the log
scale for x-axis but it will not accept values (no zero values and
negetive values, and also minimum is 10). Is there a way to do this
plot?
Thanks in advance for any help.
Nand





All times are GMT +1. The time now is 03:45 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com