4
$\begingroup$

Bug introduced in 10.4.0, and fixed in 11.0.0

PlotLabels is new in 10.4.0.


The regulars here discuss approaches to numerically unstable systems of higher-order PDEs, and I cannot even paint by numbers … (sigh)

A Plot[] of simple curves with Filling and Placed[] labels fails. The following example works, producing a more-or-less pretty picture:

Plot[{Sin[t], Sin[2 t]}, {t, 0, 4 \[Pi]},
 PlotLabels -> {Placed[Style["u(t)", Blue], Scaled@0.18]
   (*,Placed[Style["i(t) [A]",Red],Scaled@0.18]*)
   }
 , Filling -> {1 -> Axis}]

If I uncomment the second "Placed…", I get

Extract::partw: Part 2 of {{{2.5645654315*10^-7,2.5645654315*10^-7},{0.00385433090651,0.00385432136328},{0.00770840535647,0.00770832901842},<<46>>,{0.642814839394,0.599450843234},<<1331>>}} does not exist. >>

Extract::partw: Part 2 of {{{2.5645654315*10^-7,2.5645654315*10^-7},{0.00385433090651,0.00385432136328},{0.00770840535647,0.00770832901842},<<46>>,{0.642814839394,0.599450843234},<<1331>>}} does not exist. >>

Extract::partw: Part 2 of {{{2.5645654315*10^-7,2.5645654315*10^-7},{0.00385433090651,0.00385432136328},{0.00770840535647,0.00770832901842},<<46>>,{0.642814839394,0.599450843234},<<1331>>}} does not exist. >>

General::stop: Further output of Extract::partw will be suppressed during this calculation. >>

Labeled::labpos: {Scaled[0.18]} is not a valid position for the placement of labels. >>

The resulting plot is, of course, not labelled.

What am I doing wrong? (And should I have uploaded images for the working and failing case?)

$\endgroup$
  • $\begingroup$ Strange, works fine without the Filling, works without the PlotLabels but doesn't work with the two combined. Looks buggy to me. $\endgroup$ – KraZug May 16 '16 at 13:30
  • $\begingroup$ The issue isn't the Placed/Scaled part, just PlotLabels -> {"a", "b"} will cause the error but PlotLabels->"a" is fine (as noted in the question, giving one label works fine). $\endgroup$ – KraZug May 16 '16 at 13:37
  • $\begingroup$ My bad, I am using earlier version so Mathematica did not recognize this syntax $\endgroup$ – e.doroskevic May 16 '16 at 13:39
3
$\begingroup$

I tested this with V.10.4.1 running on OS X.

The following both work as expected

Plot[{Sin[t], Sin[2 t]}, {t, 0, 4 π},
  Filling -> Axis]

Plot[{Sin[t], Sin[2 t]}, {t, 0, 4 π},
  PlotLabels -> Placed[{"A", "B"}, Above]]

but

Plot[{Sin[t], Sin[2 t]}, {t, 0, 4 π},
  PlotLabels -> Placed[{"A", "B"}, Above],
  Filling -> Axis]

fails to produce any filling and emits the message

msg

I say this is a bug and have tagged the question with .

Update

I reported this problem to Wolfram tech support and received an answer. I quote from the relevant part:

It does appear that combining PlotLabels and Filling would causes error, and I have forwarded an incident report to our developers with the information you provided.

Therefore, we may take it that the tag is officially blessed.

$\endgroup$
  • $\begingroup$ Thank you very much for narrowing this down and confirming; I appreciate your trouble. $\endgroup$ – Felix Kasza May 18 '16 at 21:20

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.