setting log scale
setting log scale
(OP)
I have a log-log plot where this data set starts at X=600 and goes up. I'd expect the log scale to start at 100 and go up from there 100, 1000, 10K, 100K...), but Excel always starts at 1 (1, 10, 100, 1000...). I can set it manually under "Format axis', but I'd rather not so when this spreadsheet is used with other data sets the plot doesn't drift off the graph.
Is there a trick for this? or will I need a macro/script to accomplish this? Thanks.
Z
Is there a trick for this? or will I need a macro/script to accomplish this? Thanks.
Z





RE: setting log scale
1 - set plot scale manually (may not be ideal if data changes)
2 - leave plot scale in auto (may leave extra room at the bottom of the scale that you seem not to like)
3 - vba scribt to give something similar to auto-control, but more customized to your own preferences.
=====================================
(2B)+(2B)' ?
RE: setting log scale
CODE
Sub log_log_chart() ' Dim irow As Integer Dim xmin, ymin irow = 2 xmin = 1E+99 ymin = 1E+99 Do Until IsEmpty(Cells(irow, 1)) If Cells(irow, 1) < xmin Then xmin = Cells(irow, 1) If Cells(irow, 2) < ymin Then ymin = Cells(irow, 2) irow = irow + 1 Loop Range(Cells(1, 2), Cells(irow - 1, 2)).Select ActiveSheet.Shapes.AddChart.Select With ActiveChart .ChartType = xlXYScatter .SeriesCollection(1).XValues = "='Sheet1'!$A$2:$A$" & irow - 1 .Axes(xlValue).ScaleType = xlLogarithmic .Axes(xlValue).MinimumScale = 10 ^ Int(Log(ymin) / Log(10)) .Axes(xlCategory).ScaleType = xlLogarithmic .Axes(xlCategory).MinimumScale = 10 ^ Int(Log(xmin) / Log(10)) End With Range("A1").Select End SubRE: setting log scale
Z