Group Abstract Group Abstract

Message Boards Message Boards

0
|
4.4K Views
|
1 Reply
|
1 Total Like
View groups...
Share
Share this post:

Minify ticks labels options and add arrows to axes

Posted 5 years ago

I have the following command that produces a figure I am working on:

ListPlot[datasetsingle[[80 ;; 600]],
 Joined -> True,
 PlotStyle -> {Thickness[0.005]},
 PlotRange -> All,
 TicksStyle -> {Directive[Black, Large, FontFamily -> "Helvetica"], 
   Directive[Red, Bold]},
 Ticks -> {{
    {-12.5*^-9, -12.5, 0.08, Directive[Thick]},
    {0, 0},
    {12.5*^-9, 12.5, 0.08, Directive[Thick]},
    {25*^-9, 25, 0.08, Directive[Thick]},
    {37.5*^-9, 37.5, 0.08, Directive[Thick]},
    {50*^-9, 50, 0.08, Directive[Thick]},
    {62.5*^-9, 62.5, 0.08, Directive[Thick]},
    {75*^-9, 75, 0.08, Directive[Thick]},
    {87.5*^-9, 87.5, 0.08, Directive[Thick]}
    },
    None},
 AxesStyle -> Thick,
 AxesLabel -> {Style["Time [ns]", Small, Black, 
    FontFamily -> "Helvetica", FontSize -> 30], 
   Style["Voltage [V]", Black, FontFamily -> "Helvetica", 
    FontSize -> 30]}
 ]

As you can see, I wrote a directive Thick for each of the ticks, which is quite cumbersome to write down!

Is there a way to reduce the code and set the ticks to thick but yet have control over the numbering.

I also tried to add the following to my code:

AxesStyle->Arrowheads[{0.0,0.05}],ImagePadding->None,

to the style rules, but it caused the label to disappear.

How can I add arrows to the axes without losing this information?

POSTED BY: Ehud Behar

Hello Ehud,

have you tried defining "Directive[Thick]" as a shorter variable in the beginning, and then using that variable in each place? Might save you some typing. For example, somewhere above your plot command, just write:

dT=Directive[Thick];

and then, instead of typing "Directive[Thick]" each time, you just type "dT" ?

Didn't try it, but should work. (?)

Greetings, Oliver

POSTED BY: Oliver Ruessing
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard