Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #14805 > unrolled thread

problems with FrameTicks

Started byvan zano <L.Balzano@gmail.com>
First post2013-06-11 06:25 +0000
Last post2013-06-14 08:50 +0000
Articles 4 — 3 participants

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  problems with FrameTicks van zano <L.Balzano@gmail.com> - 2013-06-11 06:25 +0000
    Re: problems with FrameTicks Peter Pein <petsie@dordos.net> - 2013-06-12 09:25 +0000
    Re: problems with FrameTicks Helen Read <readhpr@gmail.com> - 2013-06-12 09:26 +0000
    Re: problems with FrameTicks van zano <L.Balzano@gmail.com> - 2013-06-14 08:50 +0000

#14805 — problems with FrameTicks

Fromvan zano <L.Balzano@gmail.com>
Date2013-06-11 06:25 +0000
Subjectproblems with FrameTicks
Message-ID<kp6fru$ndj$1@smc.vnet.net>
Dear All,
 I have problems in getting FrameTicks do what I would like it to do.
The problem is the following:
in plotting 

Plot[{3*10^20, 4*10^20}, {x, 0, 105},
 PlotStyle -> Black,
 Filling -> {2 -> {1}},
 FillingStyle -> LightRed,
 Frame -> True,
 Axes -> None,
 FrameLabel -> {"x", None, None, "y"},
 BaseStyle -> {FontSize -> 32, FontFamily -> "Arial"},
 FrameStyle -> Directive[Black, AbsoluteThickness[3]],
 PlotRange -> {All, {0, 6*10^20}},
 PlotRangePadding -> {10, 0},
 FrameTicks -> {{None, 
    Table[{n*10^20, n*Superscript[10, 20]}, {n, 1, 6}]}, {Automatic, 
    None}}]


I would like to have on the y axis (on the right) nice looking ticks. That means:
- starting with "1*10^20" (why does it drop the "1"?)
- with a multiplication symbol in between the prefactor "n" and the "10^20"

thank you in advance, Luigi

[toc] | [next] | [standalone]


#14819

FromPeter Pein <petsie@dordos.net>
Date2013-06-12 09:25 +0000
Message-ID<kp9eqr$2t2$1@smc.vnet.net>
In reply to#14805
Am 11.06.2013 08:25, schrieb van zano:
> Dear All,
>  I have problems in getting FrameTicks do what I would like it to do.
> The problem is the following:
> in plotting 
> 
> Plot[{3*10^20, 4*10^20}, {x, 0, 105},
>  PlotStyle -> Black,
>  Filling -> {2 -> {1}},
>  FillingStyle -> LightRed,
>  Frame -> True,
>  Axes -> None,
>  FrameLabel -> {"x", None, None, "y"},
>  BaseStyle -> {FontSize -> 32, FontFamily -> "Arial"},
>  FrameStyle -> Directive[Black, AbsoluteThickness[3]],
>  PlotRange -> {All, {0, 6*10^20}},
>  PlotRangePadding -> {10, 0},
>  FrameTicks -> {{None, 
>     Table[{n*10^20, n*Superscript[10, 20]}, {n, 1, 6}]}, {Automatic, 
>     None}}]
> 
> 
> I would like to have on the y axis (on the right) nice looking ticks. That means:
> - starting with "1*10^20" (why does it drop the "1"?)
> - with a multiplication symbol in between the prefactor "n" and the "10^20"
> 
> thank you in advance, Luigi
> 
Table[{n 10 ^20, ToString[n] <> "\[CenterDot]10^20"}, {n, 1, 6}]

will work if you mark 10^20 with mouse or keyboard and press
Ctrl-Shift-N and delete the generated parantheses. Probably there is an
easier way, but I am not aware of that :(

Peter

P.S. In place of \[Centerdot] you might want want to try \[Times],
\[Cross], \[Star] or sth. like these.

[toc] | [prev] | [next] | [standalone]


#14821

FromHelen Read <readhpr@gmail.com>
Date2013-06-12 09:26 +0000
Message-ID<kp9es4$2t9$1@smc.vnet.net>
In reply to#14805
Format the ticks as strings.

Plot[{3*10^20, 4*10^20}, {x, 0, 105}, PlotStyle -> Black,
  Filling -> {2 -> {1}}, FillingStyle -> LightRed, Frame -> True,
  Axes -> None, FrameLabel -> {"x", None, None, "y"},
  BaseStyle -> {FontSize -> 32, FontFamily -> "Arial"},
  FrameStyle -> Directive[Black, AbsoluteThickness[3]],
  PlotRange -> {All, {0, 6*10^20}}, PlotRangePadding -> {10, 0},
  FrameTicks -> {{None,
     Table[{n*10^20,
       ToString[n] <> "\[Times]" <>
        "\!\(\*SuperscriptBox[\(10\), \(20\)]\)"}, {n, 1,
       6}]}, {Automatic, None}}]



This part:

"\!\(\*SuperscriptBox[\(10\), \(20\)]\)"


Can be entered as 10^20 in quotes with the 20 in the exponent. You can 
use the keyboard shortcut Ctl-6 to make the exponent.


On 6/11/2013 2:25 AM, van zano wrote:
> Dear All,
>   I have problems in getting FrameTicks do what I would like it to do.
> The problem is the following:
> in plotting
>
> Plot[{3*10^20, 4*10^20}, {x, 0, 105},
>   PlotStyle -> Black,
>   Filling -> {2 -> {1}},
>   FillingStyle -> LightRed,
>   Frame -> True,
>   Axes -> None,
>   FrameLabel -> {"x", None, None, "y"},
>   BaseStyle -> {FontSize -> 32, FontFamily -> "Arial"},
>   FrameStyle -> Directive[Black, AbsoluteThickness[3]],
>   PlotRange -> {All, {0, 6*10^20}},
>   PlotRangePadding -> {10, 0},
>   FrameTicks -> {{None,
>      Table[{n*10^20, n*Superscript[10, 20]}, {n, 1, 6}]}, {Automatic,
>      None}}]
>
>
> I would like to have on the y axis (on the right) nice looking ticks. That means:
> - starting with "1*10^20" (why does it drop the "1"?)
> - with a multiplication symbol in between the prefactor "n" and the "10^20"
>
> thank you in advance, Luigi
>



[toc] | [prev] | [next] | [standalone]


#14852

Fromvan zano <L.Balzano@gmail.com>
Date2013-06-14 08:50 +0000
Message-ID<kpelhi$hsc$1@smc.vnet.net>
In reply to#14805
On Tuesday, 11 June 2013 08:25:02 UTC+2, van zano wrote:
> Dear All, I have problems in getting FrameTicks do what I would like it to do. The problem is the following: in plotting Plot[{3*10^20, 4*10^20}, {x, 0, 105}, PlotStyle -> Black, Filling -> {2 -> {1}}, FillingStyle -> LightRed, Frame -> True, Axes -> None, FrameLabel -> {"x", None, None, "y"}, BaseStyle -> {FontSize -> 32, FontFamily -> "Arial"}, FrameStyle -> Directive[Black, AbsoluteThickness[3]], PlotRange -> {All, {0, 6*10^20}}, PlotRangePadding -> {10, 0}, FrameTicks -> {{None, Table[{n*10^20, n*Superscript[10, 20]}, {n, 1, 6}]}, {Automatic, None}}] I would like to have on the y axis (on the right) nice looking ticks. That means: - starting with "1*10^20" (why does it drop the "1"?) - with a multiplication symbol in between the prefactor "n" and the "10^20" thank you in advance, Luigi

Thanks a lot guys, your suggestions work well!
Nevertheless, is there a way to generalize such a procedure for ticks?
I mean, suppose now I have data that go over several decades on the y-axis (eg from 10^20 to 10^22), how to do that?

thanks a lot, L

[toc] | [prev] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web