Hot answers tagged

8

Histogram does not support a grouped ChartLayout. Hence the workaround using BarChart: I've arranged the 'histogram' into a bar chart so that the data can be displayed side by side. An alternative to using BarChart with "Grouped" layout is to use a custom ChartElementFunction to produce the desired Histogram layout: ClearAll[groupedHistogram] ...


7

I think it may perhaps be easier just to combine plots and modify (e.g. suppress unnecessary frame ticks). I post this as a motivating answer rather than definitive answer. li is a modified version of OP function: li[p_, q_, phi_, {l_, u_}] := DensityPlot[(If[p > 0, Sin[2 Pi p^2 x]/(2 Pi p^2 x), 1] Cos[ 2 Pi p^2 q x + phi/2])^2, {x, -30, 30}, {y, ...


7

Rather than Show, you can use Prolog + Inset with Scaled: Plot[ 140 PDF[SmoothKernelDistribution[#], x] & /@ {S086, T086, X086}, {x, 0, 100}, Evaluated -> True, PlotStyle -> { {Thickness[0.01], RGBColor[0.23, 0.42, 0.63]}, {Thickness[0.01], RGBColor[0.29, 0.53, 0.80]}, {Thickness[0.01], RGBColor[0.62, 0.73, 0.88]}}, Frame -> ...


5

I'm afraid that you are going to have to build your own Grid for that. I don't think that the top left position is accessible through TableHeadings: Grid[ Insert[Transpose@Join[{Range[0, 2]}, modadd], Flatten[{"+", Range[0, 2]}], 1], Dividers -> {{False, True, False}, {False, True, False}} ] Here's a helper function to generate these grids ...


5

There are two issues here: How to write a string that contains a quotation within it, when the quotation mark is what signifies to the system when a string begins and ends. How to export strings with special characters, and have them written in their escaped form: \[Alpha] and not α For the first, you need to construct the string using \" to begin and ...


4

It doesn't seem to be available with Options so let's edit this manually. So you can inspect the output or use ToBoxes to know what needs to be changed. And change it: sound = Sound[{SoundNote["C"], SoundNote["G"]}] ToBoxes[ sound ] /. GraphicsBox[gr_, opts___, ImageSize -> _, opts2___ ] :> GraphicsBox[gr, opts, opts2, ImageSize -> 500 ] // ...


4

I'll make this brief: it's a job for a MakeBoxes rule. In this case a particularly simple one: MakeBoxes[li : LogIntegral, StandardForm] := InterpretationBox["li", li] Now LogIntegral prints as li.


4

MapAt[D[#, x] &, Piecewise[{{x^2, 0 <= x <= 1}, {x, x <= 4}}], {{1, ;; , 1}}] Note: this function works for expressions with Head Piecewise. For general expressions that contain Piecewise subexpressions, it can be used with ReplaceAll as follows: Y[x_] = Piecewise[{{x^2, 0 <= x <= 1}, {x, x <= 4}}]*F + Piecewise[{{x^4, 0 <= ...


4

You can use the option LabelStyle: labelstyle = Directive[12, Italic, FontFamily -> "Times"]; Manipulate[ParametricPlot[{a Sin[b t + c], d Cos[f t + g]}, {t, 0, 6 Pi}, Frame -> True, PlotRange -> {{-5, 5}, {-5, 5}}], {{a, 1}, 0, 5, 0.01}, {{b, 1}, 0, 10, 0.01}, {{c, 1}, 0, 2 Pi, 0.01}, {{d, 1}, 0, 5, 0.01}, {{f, 1}, 0, 10, 0.01}, ...


3

Probably you want the following: UT := 1 + x^2 VT := t*x^2 WT := t Column[{Row[{Plot3D[UT, {x, 0, 1}, {t, 0, 0.8}], Plot3D[VT, {x, 0, 1}, {t, 0, 0.8}]}], Plot3D[WT, {x, 0, 1}, {t, 0, 0.8}]}, Center, BaseStyle -> ImageSizeMultipliers -> 1]


3

Based on the comments I developed the following answer. Not completely simple, but not too onerous to do: In[38]:= TableForm[Part[FactorInteger[FromDigits["1000000000000101",Range[2,10]]],All,All,1]] Out[38]//TableForm= 13 2521 11 251 5197 3 229 520981 4751 6423401 173 281 2677 3613 3 ...


2

Maybe you are looking for something like this: Print[#] & /@ Flatten[ FactorInteger[FromDigits["1000000000000101", Range[2, 10]]], 1];


2

You can check also the docs for PrecedenceForm for examples. Precedence can be used to force parenthesization. If you put a low-ish number, you will likely get a parenthesis. I am afraid I cannot help with the fourth argument (group).


1

You can use Row to accomplish your task. HoldForm needs to be wrapped around the first part. Copy of your code: Subscript[f, H][k_, t_] := 1/(k t + 1) Now try: Row[{ TraditionalForm[HoldForm@D[Log[Subscript[f, H][k, t]], t]], " = ", TraditionalForm[D[Log[Subscript[f, H][k, t]], t]] }] You can style it as you like. Below is a silly example ...


1

I'm not sure if that's what you want to achieve but if you want Mathematica to process your input while keeping the sum only as a symbol you may want to make it inactive (a new feature since version 10.0). Try: Inactive[Sum][f[OverTilde[q]], OverTilde[q] ∈ Subscript[l, i]] This way you can still use it as a part of a formula, or assign it to a variable, ...


1

Not sure if all you want is formatted output. With Interpretation you get output you can copy. Clear[fracform] fracform[e_] /; Denominator[e] =!= 1 := Interpretation[ DisplayForm@ RowBox[{ToBoxes[1/Denominator[e]], " ", ToBoxes[Numerator[e]]}], e]; fracform[e_] := e; fracform[a/b]


1

Perhaps something like: test[steps_] := Module[{}, n = 0; Print["% Complete: ", Dynamic[n*100/steps]]; For[n = 0, n < steps, n++, Pause[1]]; NotebookFind[SelectedNotebook[], "Print", All, CellStyle]; NotebookDelete[]] See also: A self-deleting button to delete Print cells


1

expr = x^α (9/(100 α κ Gamma[α]) - x/(100 (α + α^2) κ Gamma[α]) - Subscript[a, 0]/(α Gamma[α])) + x^(2 α) ((2^(2 - 2 α) Cos[π α] Gamma[ 1/2 - α] Subscript[a, 0])/(5 Sqrt[π] α κ Gamma[α]) - (x \ Subscript[a, 0])/(10 κ Gamma[2 + 2 α]) - (x Gamma[ 2 + α] Subscript[a, 0])/(10 α κ Gamma[α] Gamma[ ...


1

The trouble with many methods is that they only work on integer inputs. Trying Alexei's answer with approximate numbers {1.0, 1.0 + 2 I, 3.0 - 5 I, 7, 9.0 + I} /. x_ /; Head[x] == Complex -> Sqrt[Re[x]^2 + Im[x]^2]*Exp[I ArcTan[Re[x], Im[x]]] (* {1., 1. + 2. I, 3. - 5. I, 7, 9. + 1. I} *) just spits back out the original answer. Also, a simpler ...


1

Try this: {1, 1 + 2 I, 3 - 5 I, 7, 9 + I} /.x_ /; Head[x] == Complex -> Sqrt[Re[x]^2 + Im[x]^2]*Exp[ArcTan[Re[x], Im[x]]] yielding (* {1, Sqrt[5] E^ArcTan[2], Sqrt[34] E^-ArcTan[5/3], 7, Sqrt[82] E^ArcTan[1/9]} *) Edit: to address your question If you want to have the argument shown as fractions of Pi sa for the angles of 45 grad or 60 ...


1

Just going to throw this in to the mix. When I saw this question, it immediately seemed perfect for Jens's function, which I modified and used previously, and in fact I have it defined in my init.m because I use it with such regularity. I have modified the original function to respect the individual aspect ratios of the constituent plots, and the ...



Only top voted, non community-wiki answers of a minimum length are eligible