18,263 reputation
443109
bio website wolfram.com
location United States
age 38
visits member for 3 years, 2 months
seen 11 mins ago

The gravatar was made with Mathematica, and inspired by this.

The contents of my posts are my own opinion, and do not reflect the opinions of my employer.


12h
comment How to iterate through a list of rules?
@Kuba yep. That's one I usually forget exists.
12h
revised How to iterate through a list of rules?
fixed typo, added variant code
13h
answered How to iterate through a list of rules?
1d
comment Display of ConfusionMatrixPlot depends on Stylesheet
That's interesting ... I can reproduce it.
1d
revised ListDensityPlot and RegionFunction
reformatted code
Mar
24
comment How to find out where an error occurs?
Try appending info to each message.
Mar
23
comment ContourPlot color problems
Use Blend to create your own. I've done some interesting things with it in the past.
Mar
23
comment ContourPlot color problems
Dividing by 5 won't help as that is just rescaling the function. In that case, you want to set PlotRange -> {0,5} which changes what the z-range that is displayed and used to scale the ColorFunction.
Mar
23
comment ContourPlot color problems
Yes, ContourPlot scales from 0 to 1, by default. I'd let ContourPlot do its thing and then supply ShowLegend with the correct scale.
Mar
23
comment How to accelerate my code?
Although, I would probably offload it into a separate function, e.g. spanClip[s : Span[1, All, ___], max_] := s spanClip[Span[a_, All, k___], max_] := Span[Clip[a, {1, max}], All, k] spanClip[Span[1, b_, k___], max_] := Span[1, Clip[b, {1, max}], k] spanClip[Span[a_, b_, k___], max_] := Span[##, k] & @@ Clip[{a, b}, {1, max}] or something like that.
Mar
23
comment ContourPlot color problems
If you remove the manual rescaling and let ContourPlot do it, it usually will give you a lot more variation. I tend to manually scale things only when they have to match across multiple plots.
Mar
23
comment How to accelerate my code?
@2012rcampion I agree, hence the need for Apply (@@).
Mar
23
comment ContourPlot color problems
What version of Mathematica are you using? The PlotLegends` package was deprecated in v9 in favor of the built-in option PlotLegends which is superior in many ways.
Mar
23
comment How to accelerate my code?
@2012rcampion it isn't shorter, but there's Clip, e.g. Span @@ Clip[{#1 - 1, #1 + 1}, {1, Length@#2}], which reads a bit cleaner.
Mar
21
awarded  Nice Answer
Mar
21
comment How to convert a notebook to an association and back?
@LeonidShifrin I think data duplication is only relevant with BiographicalDetails as Author and Category would uniquely identify a set of quotes, so denormalization with regards to that data is reasonable. Although, I'd consider building a secondary table which those are details are drawn from with the Author as the unique ID for it. Maybe have a structure <| “CollectedQuotes” -> …, “AuthorDetails” -> …|>.
Mar
19
comment Why the axis labels are not visible?
Because you don't have axes, you have a frame. Try FrameLabel.
Mar
19
comment How do I convert an argument list to a list of arguments?
I blame laziness; on my part for pointing it out (and not editing it), etc.
Mar
19
comment How do I convert an argument list to a list of arguments?
Hold accepts any number of arguments, so putting them in a nested list is unnecessary. Then, that allows foo @@ args.
Mar
18
answered Plotting 4 separate lines on a graph