PC Review
Forums
Newsgroups
Microsoft Excel
Microsoft Excel Charting
Label log axes with superscript notation?
Forums
Newsgroups
Microsoft Excel
Microsoft Excel Charting
Label log axes with superscript notation?
![]() |
Label log axes with superscript notation? |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
Hello
I am using VB to create a chart with log base 10 axis with a range of 0.1 to 100000. The major ticks are labelled with the number value. However, I need a scientific-quality chart that uses "10 to the power of x" notation with x being a superscript. Excel's option of using 1.00E-1, 1.00E+0, etc. is not acceptable in my case. Does anyone know how to achieve this? I cannot believe Microsoft would not include this option as it is standard style in scientific charts. |
|
|
|
#2 |
|
Guest
Posts: n/a
|
Hi Henry,
Don't think there is a standard way of doing it BUT you can do it using a dummy data series and a little routine I wrote for a previous and similar request. Use a dummy series to mimic the axis. If you link the datalabels to cells you will not be able to use superscript. So you will have to set the text explicitly. The routine below will create the text and format the power value to superscript. Also take a look at Jon Peltier's site on how to create your own axis; (http://www.geocities.com/jonpeltier...itraryAxis.html) Sub MakeSuperScript() Dim intIndex As Integer Dim strPower As String ' Adjust SeriesCollection(2) so it uses your dummy series With ActiveChart.SeriesCollection(2) .HasDataLabels = True .DataLabels.Position = xlLabelPositionBelow For intIndex = 1 To .DataLabels.Count strPower = CStr(intIndex - 1) .DataLabels(intIndex).Text = "10" & strPower .DataLabels(intIndex).Characters(3, Len(strPower)).Font.Superscript = True Next End With End Sub Henry Fleming wrote: > Hello > > I am using VB to create a chart with log base 10 axis with a range of > 0.1 to 100000. The major ticks are labelled with the number value. > However, I need a scientific-quality chart that uses "10 to the power > of x" notation with x being a superscript. Excel's option of using > 1.00E-1, 1.00E+0, etc. is not acceptable in my case. Does anyone know > how to achieve this? I cannot believe Microsoft would not include > this option as it is standard style in scientific charts. -- Cheers Andy http://www.andypope.info |
|
|
|
#3 |
|
Guest
Posts: n/a
|
Great! This works. Thanks!
Andy Pope <andy@andypope.info> wrote in message news:<O6n4dppZDHA.384@TK2MSFTNGP12.phx.gbl>... > Hi Henry, > > Don't think there is a standard way of doing it BUT you can do it using > a dummy data series and a little routine I wrote for a previous and > similar request. > > Use a dummy series to mimic the axis. > If you link the datalabels to cells you will not be able to use > superscript. So you will have to set the text explicitly. > The routine below will create the text and format the power value to > superscript. > > Also take a look at Jon Peltier's site on how to create your own axis; > (http://www.geocities.com/jonpeltier...itraryAxis.html) > > Sub MakeSuperScript() > Dim intIndex As Integer > Dim strPower As String > > ' Adjust SeriesCollection(2) so it uses your dummy series > With ActiveChart.SeriesCollection(2) > .HasDataLabels = True > .DataLabels.Position = xlLabelPositionBelow > For intIndex = 1 To .DataLabels.Count > strPower = CStr(intIndex - 1) > .DataLabels(intIndex).Text = "10" & strPower > .DataLabels(intIndex).Characters(3, > Len(strPower)).Font.Superscript = True > Next > End With > End Sub > > > Henry Fleming wrote: > > Hello > > > > I am using VB to create a chart with log base 10 axis with a range of > > 0.1 to 100000. The major ticks are labelled with the number value. > > However, I need a scientific-quality chart that uses "10 to the power > > of x" notation with x being a superscript. Excel's option of using > > 1.00E-1, 1.00E+0, etc. is not acceptable in my case. Does anyone know > > how to achieve this? I cannot believe Microsoft would not include > > this option as it is standard style in scientific charts. |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

