-1
$\begingroup$

I have the following code:

a = 0; 
n = 50; 
h = N[1/50]; 
uexact[t_] = 
  N[1 + Sqrt[2]*
     Tanh[Sqrt[2]*t + (1/2)*Log[(Sqrt[2] - 1)/(Sqrt[2] + 1)]]]; 
ListPlot[Callout[{Table[{t, uexact[t]}, {t, a, n*h, 0.1}]}, "Exact", 
  Above, 0.4, "CalloutStyle" -> Red, CalloutMarker -> "CirclePoint"], 
   PlotMarkers -> {"\!\(\*\nStyleBox[\"\[FivePointedStar]\",\n\
FontSize->18]\)"}, PlotStyle -> {Blue}]

I want to use of Callout for this code. Any suggestions?

$\endgroup$
1
$\begingroup$
a = 0;
n = 50;
h = 1/50;
uexact[t_] = 
  1 + Sqrt[2]*Tanh[Sqrt[2]*t + (1/2)*Log[(Sqrt[2] - 1)/(Sqrt[2] + 1)]] // 
   Simplify;

Eliminate the extraneous list brackets around Table.

ListPlot[Callout[Table[{t, uexact[t]}, {t, a, n*h, 1/10}], "Exact", Above, 
  0.4, "CalloutStyle" -> Red, CalloutMarker -> "CirclePoint"], 
 PlotMarkers -> Style["★", 18], PlotStyle -> Blue]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.