PC Review Forums Newsgroups Microsoft Excel Microsoft Excel Charting Label log axes with superscript notation?

Reply

Label log axes with superscript notation?

 
Thread Tools Rate Thread
Old 19-08-2003, 04:13 PM   #1
Henry Fleming
Guest
 
Posts: n/a
Default Label log axes with superscript notation?


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.
  Reply With Quote
Old 19-08-2003, 10:41 PM   #2
Andy Pope
Guest
 
Posts: n/a
Default Re: Label log axes with superscript notation?

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

  Reply With Quote
Old 21-08-2003, 02:45 AM   #3
Henry Fleming
Guest
 
Posts: n/a
Default Re: Label log axes with superscript notation?

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.

  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off