# Plotting :Change the format of numbers on the graph axis [duplicate]

1. I need to change the format for representing numbers along the abscissa. I want to keep numbers 0,2,4,6,8,10 and put the degree, for example, on the tab "time, * 10 ^ 9 seconds" or keep numbers without a degree using the abbreviation "time, nanoseconds"

2. Is it possible to put y1 (t) in the frame? Place it in the upper right corner for example.

See code below:

Plot[10^12*Sin[t/10^9], {t, 0, 10^10},
Axes -> None, Frame -> True,
PlotStyle -> RGBColor[0., 0., 0.],
FrameStyle -> Thick,
PlotLabel -> Style["y1(t)", FontSize -> 18],
PlotTheme -> "Detailed",
FrameLabel -> {"time", " Amplitude"},
LabelStyle -> {18, GrayLevel[0],
FontFamily -> "Arial"}]


Does this give you the plot you want?

Plot[10^12*Sin[t/10^9], {t, 0, 10^10},
Axes -> None,
Frame -> True,
FrameStyle -> Thick,
FrameLabel -> {"time, nanosecs", "amplitude"},
FrameTicks -> {{Automatic, None}, {{# 10^9, #} & /@ Range[0, 10, 2], None}},
PlotLabels -> Placed["y1(t)", Above],
PlotStyle -> Black,
PlotTheme -> "Detailed",
LabelStyle -> {18, Black},
ImageSize -> Large]


### Update

I'm not sure I understand what you mean by "large degrees ... along the ordinate", but maybe this will work for you; it uses the same basic idea that was applied to format the abscissa.

Plot[10^12*Sin[t/10^9], {t, 0, 10^10},
Axes -> None,
Frame -> True,
FrameStyle -> Thick,
FrameLabel -> {"time, nanosecs", Row[{"amplitude × ", Superscript[10, -12]}]},
FrameTicks ->
{{{# 10^12, #} & /@ Range[-1, 1, .5], None},
{{# 10^9, #} & /@ Range[0, 10, 2], None}},
PlotLabels -> Placed["y1(t)", Above],
PlotStyle -> Black,
PlotTheme -> "Detailed",
LabelStyle -> {18, Black},
ImageSize -> Large]


### Note

Since this is just a scaling problem, you should be aware that you can get the same plot with the following code.

In this version of the plot I have also replaced PlotTheme with the underlying options it was supplying because I believe PlotTheme works best when it is not mixed in with a lot of other options.

Plot[Sin[t], {t, 0, 10},
Axes -> None,
GridLines -> Automatic,
GridLinesStyle ->
Directive[GrayLevel[0.4, 0.5], AbsoluteThickness[1], AbsoluteDashing[{1, 2}]],
Frame -> True,
FrameStyle -> Thick,
FrameLabel -> {"time, nanosecs", Row[{"amplitude \[Times] ", Superscript[10, -12]}]},
FrameTicks -> {{Range[-1, 1, .5], None}, {Range[0, 10, 2], None}},
PlotLabels -> Placed["y1(t)", Above],
PlotLegends -> LineLegend[{Black}, {HoldForm[10^12 Sin[t/10^9]]}],
PlotStyle -> Black,
LabelStyle -> {18, Black},
ImageSize -> Large]


• Yes,thank you. Can you tell me how to remove large degrees on this graph and along the ordinate axis? Sep 11, 2019 at 6:14
• @AndrewMarphichev. Please look at the update I have added. Does it resolve the issue you raise in your comment? Sep 12, 2019 at 14:23
• Yes,problem are resolved Sep 12, 2019 at 15:53
• @AndrewMarphichev. I'm glad you find my answer useful. Please consider accepting it. You can do that by clicking on the check mark that appears on the left of the answer below the down arrow. Sep 12, 2019 at 23:41