Hey guys! I asked this before but I no longer remember how you do it. Which function should I use to edit a plot after it was outputed. For instance, changing the plot label?
A quick question, how can I write a data object in Mathematica, like ContinuousWaveletData? For example, it has many properties that can be used like ContinuousWaveletData[...]["Properties"].
@xslittlegrass No, I'm only familiar with it from objects and operator forms from Wolfram. I'd just start coding however feels simplest and then you can always adjust later if you run into problems.
In the course of making some RLink wrappers I want to have some richer containers like Mathematica does with its FittedModel code. I thought I had a good idea of how this might be done, i.e make a custom Format specification that hides some arguments and use DownValues to give different parts of...
@rm-rf Thanks, that's very useful! When using this data objects (like FittedModel, ContinuousWaveletData, etc.), it's very convenient and coherent. I've been always wanted to learn how to structure a package with coherence similar to those objects. So are you aware of any source specifically discuss this kind of objects/data structure in Mathematica?
@rm-rf Also, Do you know any examples of this kind of data objects in the AddOn package folder that I can look at the source code?
@xslittlegrass Sorry, don't know much about stuff in the add on folders. I've used this style extensively to create custom data objects in my packages but none of them are public.
@Sosi I think I agree with the implementation here. Note that {All, 3} is not a valid specification even for Part. I'm guessing ReplacePart is implemented as a replacement rule applied to the array rules for the input list. This makes sense given that you can use patterns and it can also be applied to sparse arrays.
A very simple toy implementation of ReplacePart like my guess:
ClearAll@replacePart replacePart[list_, patt_ -> value_] := ArrayRules[list] /. HoldPattern[pos_?(MatchQ[patt]) -> _] :> pos -> value // SparseArray // Normal