Coloque a inserção além do intervalo do gráfico

Sep 09 2020

Eu quero colocar uma inserção (a)mais para baixo ( aproximadamente a mesma altura do BarLegend ). No entanto, o código a seguir não parece permitir isso. Alguém pode fazer isso de alguma forma?

data = Table[
   Sin[x] Cos[y] + 0.05 x y, {x, 0, 2 Pi, 0.1}, {y, 0, 2 Pi, 0.1}];
labellst = {"(a)", {0.15, 0.03}};
insetlst = Inset[Style[#[[1]], Large], ImageScaled[#[[2]]]] &@labellst;
MatrixPlot[data, PlotLegends -> Automatic, PlotRangeClipping -> False,
  Epilog -> insetlst, LabelStyle -> Medium, AspectRatio -> 1/2]

Respostas

4 OkkesDulgerci Sep 09 2020 at 02:26

Se necessário, brinque com os parâmetros.

labelSize = 30;
labelPos = {0.1, -0.2};
legendPos = {0.5, -0.1};
data = Table[
   Sin[x] Cos[y] + 0.05 x y, {x, 0, 2 Pi, 0.1}, {y, 0, 2 Pi, 0.1}];
MatrixPlot[data, PlotLegends -> Placed[Automatic, Scaled[legendPos]], 
 LabelStyle -> Medium, AspectRatio -> 1/2, 
 Epilog -> Text[Style["(a)", labelSize], Scaled[labelPos]]]

3 Rom38 Sep 09 2020 at 01:36

A sub-rotulagem das parcelas é percebida mal o suficiente no MMA. Acho que a maneira mais simples é usar Overlay:

Overlay[
 {ContourPlot[Sin[x y^2], {x, -6, 6}, {y, -3, 3},
   AspectRatio -> Automatic,
   ContourStyle -> None,
   ImageSize -> 600,
   ColorFunction -> "Rainbow",
   PlotLegends -> 
    Placed[BarLegend[{"Rainbow", {-1, 1}}, 10, 
      LegendMarkerSize -> 350], Below]],
  Graphics[{Text[Style["a)", 14, Bold], Scaled@{0, 0}]}, 
   ImageSize -> {350, 350}]}
 ]

Jogando com ImageSizea Graphicscamada pode-se obter a posição desejada da etiqueta.

3 kglr Sep 09 2020 at 01:59

Para ter o rótulo na mesma posição vertical da legenda:

1. Injete o rótulo na legenda usando a opção LegendFunctionem BarLegend:

MatrixPlot[data, 
 PlotLegends -> BarLegend[Automatic, 
      LegendFunction -> (Row[{Style[labellst[[1]], Large], #}] &)], 
 PlotRangeClipping -> False, LabelStyle -> Medium, AspectRatio -> 1/2]

2. Adicione o rótulo como uma legenda especificando várias legendas em PlotLegends:

MatrixPlot[data, 
 PlotLegends -> Thread[Placed[{Style[labellst[[1]], Large], Automatic}, Below]], 
 PlotRangeClipping -> False, LabelStyle -> Medium, AspectRatio -> 1/2]

Você pode ter um posicionamento mais preciso usando o $\{\{e_x,e_y\},\{l_x, l_y\}\}$forma em vez de posições simbólicas em Placed:

positions = {{{.5, -.1}, {.5, .5}}, {{.15, -.1}, {.5, .5}}};

MatrixPlot[data, 
 PlotLegends -> Thread[Placed[{Automatic, Style[labellst[[1]], Large]}, positions]],
  PlotRangeClipping -> False, LabelStyle -> Medium, 
  AspectRatio -> 1/2]

3.MatrixPlot Saída pós-processamento para inserir o rótulo à esquerda da legenda:

MatrixPlot[data, PlotLegends -> Automatic, PlotRangeClipping -> False,
   LabelStyle -> Medium, AspectRatio -> 1/2] /. 
 Placed[lg_, a__] :> Placed[Row[{Style[labellst[[1]], Large], lg}], a]

3 valarmorghulis Sep 09 2020 at 21:27

Aqui está uma maneira direta de usar LegendLabel

data = Table[
   Sin[x] Cos[y] + 0.05 x y, {x, 0, 2 Pi, 0.1}, {y, 0, 2 Pi, 0.1}];
MatrixPlot[data,PlotLegends -> Placed[BarLegend[Automatic, LegendMarkerSize -> 280, 
    LegendLabel -> Placed[Style[Text["(a)"], Red, FontSize -> 24], Left]], Bottom], 
 AspectRatio -> 1/2]