1
rp = 2*10^3;
ro = 1.88*10^8;
h[p_] := p (rp/ro)^2;
listh = Table[{p, h[p]}, {p, 1, 100000}];
ListLogPlot[listh, PlotTheme -> "Detailed", LabelStyle -> Black, FrameStyle -> {Black, 10},PlotRange -> All]

This code plots the graph seen below enter image description here I just wanted to change the frameticks in the horizontal axis like 2x10^4, 4x10^4, 6x10^4, 8x10^4, 1x10^5. How is this possible?

Haliki
  • 67
  • 6

2 Answers2

1

It's possible to define and use a custom ticks function as follows:

ticksfn =
  {#, ScientificForm[N@#, NumberPoint -> ""]} & /@ 
     FindDivisions[{#, #2}, 6] &;

rp = 2*10^3;
ro = 1.88*10^8;
h[p_] := p (rp/ro)^2;
listh = Table[{p, h[p]}, {p, 1, 100000}];
plot = ListLogPlot[listh, PlotTheme -> "Detailed", LabelStyle -> Black, 
  FrameStyle -> {Black, 10}, PlotRange -> All, 
  FrameTicks -> {{Automatic, None}, {ticksfn, None}}]

enter image description here

More complete with the sub-ticks, but possibly version specific (here for v10.1):

ticksfn =
  Map[Replace[{v_, n_} :> {v, ScientificForm[N@v, NumberPoint -> ""]}]]@*
    Charting`FindTicks[# &, # &];

enter image description here

Mr.Wizard
  • 271,378
  • 34
  • 587
  • 1,371
0

Try this:

[`rp = 2*10^3;
ro = 1.88*10^8;
h[p_] := p (rp/ro)^2;
listh = Table[{p, h[p]}, {p, 1, 100000}];
ListLogPlot[listh, PlotTheme -> "Detailed", LabelStyle -> Black, 
 FrameStyle -> {Black, 10}, PlotRange -> All, 
 FrameTicks -> {{Automatic, 
    None}, {{{20000, 
      Style["2×\!\(\*SuperscriptBox[\(10\), \(4\)]\)", 12, 
       Black]}, {40000, 
      Style["4×\!\(\*SuperscriptBox[\(10\), \(4\)]\)", 12, 
       Black]}, {60000, 
      Style["6×\!\(\*SuperscriptBox[\(10\), \(4\)]\)", 12, 
       Black]}, {80000, 
      Style["8×\!\(\*SuperscriptBox[\(10\), \(4\)]\)", 12, 
       Black]}}, None}}]`]

enter image description here

Have fun!

Alexei Boulbitch
  • 39,397
  • 2
  • 47
  • 96