Group Abstract Group Abstract

Message Boards Message Boards

0
|
584 Views
|
6 Replies
|
5 Total Likes
View groups...
Share
Share this post:

How to set a default title for plots?

Posted 2 months ago

I have a couple of ListLinePlots that I create in my notebook. I want the title of each plot to appear as

Style["〈the title〉", FontSize -> 18, Black]

Doing

SetOptions[ListLinePlot,
    PlotLabel -> Style["my title", FontSize -> 18, Black], 
]

doesn't seem to work. For example,

ListLinePlot[
 {}
 ,PlotLabel -> "Plot no. 1"]

inserts the title "Plot no.1" but all the directives from SetOptions are not taken into effect. Why?

POSTED BY: Ehud Behar
6 Replies
Posted 2 months ago

I see no problem

POSTED BY: Hans Milton
Posted 2 months ago

Going a step further:

POSTED BY: Hans Milton

Hmm, it seems that LabelStyle overrides TicksStyle. I wonder why.

POSTED BY: Gianluca Gorni

As a workaround one can define a custom plot:

myPlot[data_, myTitle_, opts___] :=
 ListLinePlot[data, opts,
  PlotLabel -> Style[myTitle, 18, Black]]
POSTED BY: Gianluca Gorni

The option LabelStyle -> {FontSize -> 18, Black} does that, but unfortunately it affects tick labels too, which may be remedied with TicksStyle.

POSTED BY: Gianluca Gorni
Posted 2 months ago

I just tried

SetOptions[ListLinePlot,
  LabelStyle -> {FontSize -> 18, Red}, 
  TicksStyle -> {Directive[Black, 20]},
  AxesStyle -> Directive[Black, 8]
  ];
ListLinePlot[
 {}
 , PlotLabel -> "Plot no. 1"]

but I I see no change in the ticks font size. Why?

enter image description here

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