The Stack Overflow podcast is back! Listen to an interview with our new CEO.

New answers tagged

6

You can use PercentForm to express tick labels in percents: ticks = {#, ToString[PercentForm[#]]} & /@ Range[0, 1, .1]; Plot[x, {x, 0, 1}, Ticks -> {Automatic, ticks }] Alternatively, you can use Quantity[x, "Percent"] to get x%: ticks2 = {#, ToString[Quantity[100 #, "Percent"], StandardForm]} & @ Range[0, 1, 1/10]; Plot[x, {x, 0, 1}, Ticks -&...


2

You can add the option Ticks -> {Automatic, Transpose@{Range[0., 1., 0.1], ToString[#] <> "%" & /@ Range[0, 100, 10]}} For example Plot[x, {x, 0, 1}, Ticks -> {Automatic, Transpose@{Range[0., 1., 0.1], ToString[#] <> "%" & /@ Range[0, 100, 10]}}] Or for a more general range of data we can use a function in Ticks percentticks[...


4

You can use Save in this way: func[i_] := func[i] = i; Do[func[i], {i, 1, 3}]; FullDefinition@func (* func[1] = 1 func[2] = 2 func[3] = 3 func[i_] := func[i] = i *) Save["out.m",func]; ClearAll[func]; Get["out.m"]; FullDefinition@func (* func[1] = 1 func[2] = 2 func[3] = 3 func[i_] := func[i] = i *) So, here, we show that memoization can be used as ...


1

list = ToString[#] <> "=" <> ToString[ReleaseHold@#] <> ";" &@ HoldForm@func[#] & /@ Range[3] (# >>> out.m) & /@ list


2

func[i_] := i Do[ "func["<>ToString@i<>"] = "<>ToString@func@i >>> "out.m" , {i,1,3} ] Edit 1: It's not clear to me what's your scope but, this does what you asked "func["<>ToString@#<>"] = "<>ToString@func@# & /@ Range@3 // Export["out.m", #~StringRiffle~"\n"<>"\n","Text"]& Edit 2: ...


1

The question is not very clearly formulated. Therefore I present a solution that works specifically for the given case. Notice that what you are asking is essentially a polynomial division with a small difference that highest, not lowest power of y should go into the reminder. This can be realized by inverting the variable, i.e. y->1/z. The procedure ...


2

Change your style sheet to use the following CellDingbat for your "ItemNumbered" style: Cell[ TextData[{CounterBox["ItemNumbered", CounterFunction->RomanNumeral], ")"}], FontWeight->Bold ] For example, you could try: SetOptions[ EvaluationNotebook[], StyleDefinitions -> Notebook[ { Cell[StyleData[StyleDefinitions-&...


6

The following code does what I think you want: Right clicking converts the selected portion into a button with a ». Clicking on the » expands the button back into the selected portion. The "HotKeys" option allows you to define rules so that a hot key will apply a desired function on the selected portion. The tooltip that is created can be customized by ...


Top 50 recent answers are included