Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

2
  • 4
    $\begingroup$ This plots the functions as zero out of their piecewise domain. You can get rid of this behavior by using Piecewise[{#, {Indeterminate, True}}] instead. However, this assumes that the original Piecewise does not use a True directive already. $\endgroup$ Commented Feb 1, 2012 at 20:03
  • $\begingroup$ smooth L1. $0.5x^2$, if $\mid x\mid<1$; otherwise $\mid x\mid -0.5$. f = Piecewise[{{0.5 #^2, Abs[#] < 1}, {Abs[#] - 0.5, Abs[#] >= 1}, {Log[#], 2 < #}}] &; works fine with two colors. $\endgroup$ Commented Oct 24, 2021 at 2:21