Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Specify and control how Mathematica formats its output, including rich text, equations and graphics.

7
votes
3answers
177 views

HoldForm: Display exactly as entered?

Sometimes, Mathematica's internal representation of expressions can give somewhat surprising results. Specifically, I noticed this when I tried to preserve products of fractions for display. E.g. ...
2
votes
1answer
44 views

How to change space between y-axis and first bar in a stacked barchart

I have a stacked barchart like this one: BarChart[{{1, 3, 5}, {4, 7, 9}}, ChartLayout -> "Stacked"] Is there a way to change the space before and after the ...
2
votes
0answers
18 views

The default FormLayoutFunction

FormLayoutFunction allows you to specify a custom layout for form's items. But what if you want to only slight fix the default layout? It is not so clear what is ...
0
votes
1answer
27 views

Formatting a list of values and dependent formatting of corresponding errors list

I am making a table of data that I wish to output using TeXForm. Rather than manipulate the values in LaTeX (e.g. using the ...
2
votes
0answers
74 views

How to draw such boxes in Netron?

How to draw a box like this: This was drawn by https://github.com/lutzroeder/netron My attempt: ...
1
vote
1answer
64 views

Copy-paste with annoying trailing 0s

When one copies an output containing machine-precision numbers to a input, many trailing 0s appears. For example : Evaluate the following expression : ...
0
votes
0answers
16 views

Outputting a concatenation of a string and a variable within a loop [duplicate]

In this question, it was mentioned that one can output the concatenation of a string and a variable by using StringForm[]: ...
0
votes
1answer
42 views

How to export histogram legends correctly?

Found it really hard to export a high resolution .png while keeping the legends. Here is the code: ...
0
votes
0answers
34 views

How can I suppress traditional form output in a frame label? [duplicate]

When I draw a plot with the frame label $P_z$, the $P$ is shown in italic auto. What I want is a normal $\rm P_z$. How can I get it? Here is an example: ...
2
votes
1answer
57 views

creating a data framework using matrix tensor

I want to create a data framework using matrix tensor. The framework should have the following features: An (n,n) matrix, ...
2
votes
1answer
39 views

Unexpected behavior of ScientificForm when applied to a list [duplicate]

Consider a = Table[1, 100] la = Length[a] b = ScientificForm[a] lb = Length[b] la = 100 and ...
1
vote
0answers
62 views
1
vote
0answers
55 views

Mathematical symbols appear grey/faded/opaque

I admit this is quite a strange question. The mathematical symbols in my output appear as grey and faded, instead of bold black like my input. I attach a photo. Both the curly brackets and the minus ...
1
vote
1answer
51 views

Simplifying a Sum of Fractions by Removing Fractions in Denominators

I have a sum of fractions of the form $x1 - \frac{(x2 + x3)}{(x4 + x5)} - \frac{(x6 + \frac{x7}{x13})}{(x8 - x9 - \frac{x10}{(x11 + x12)})}.$ How might I simplify it to remove fractions from the ...
4
votes
3answers
174 views

Handling expression differently for display vs. calculation?

I have a function I wrap a lot of my numbers with to factor them and display them out a certain way. Usually I do this at the last step of a calculation, but sometimes it would be nice if I could ...
1
vote
2answers
62 views

About writing a file using Do loop

I want to write a file using Do loop. The loop computes a list of 9 functions whose outputs are floating point numbers. One of the functions produces large numbers ...
0
votes
3answers
95 views

Replacements within a mathematica expression?

Say I have many expressions of the form $$\text{expr} = \frac{1}{AB(C+D)^n E^m}$$ where $A,B,C,D$ and $E$ are symbols and $n,m$ arbitrary powers. In order to convert between the mathematica output and ...
3
votes
2answers
79 views

How to convert the solution of this recurrence like this form?

I am trying to solve the recurrence sequence. I tried RSolve[{a[n] == 1/2 (a[n - 1] + 9/a[n - 1]), a[1] == 1}, a[n], n] // Simplify I got {{a[n] -> 3 Coth[...
2
votes
2answers
54 views

Maximizing number of positive elements in formatted output

The following code $Assumptions = {0 < x < 1, 0 < y < 1, z > 1}; myexpr = Expand[(1 - x) (1 - y) (z - 1)]; TraditionalForm[Simplify[myexpr]] ...
7
votes
1answer
219 views

How does Mathematica determine when to use scientific notation?

I have code that takes an initial guess for a set of parameters to use in a function that I want to minimize, calculates the function, prints the value, recalculates new parameters via the gradient ...
1
vote
2answers
82 views

For loop not working as expected from a C programmer's perspective [closed]

Why does Print[n] produce output inside a For loop, while Sqrt[n] (as well as many other ...
5
votes
3answers
299 views

How can I stop $\sqrt{1}$ from being evaluated in a recursively defined sequence?

I want to list five terms of a sequence $(u_n)$ with $u_1 = 0$ and $u_{n+1}= \sqrt{1 + u_n}$, but I don't want to reduce them. My code ...
0
votes
0answers
57 views
0
votes
1answer
37 views

Dynamically updating the output of a loop

Consider the following simple loop: n=0; Do[n++;Print[n],{10}] Mathematica writes: 1 2 3 ... I want mathematica to ...
3
votes
2answers
56 views

Manipulate: Show result in Engineering/Scientific Form

I have a simple definition as follows and the result expected is in either EngineeringForm or ScientificForm ...
1
vote
1answer
46 views

Adjust font size in `Grid` [closed]

I have a simple table given by ...
3
votes
1answer
47 views

Replacement rule to display negative exponents as denominators

Suppose I have an expression of the form: expr=f[t]^b + f[t]^a g[t]^-a + g[t]^-c And I want to create a rule to convert negative exponents to denominators. In ...
1
vote
1answer
59 views

How do I hold the form of terms in an output?

Consider the following expression: EXPR = Map[Simplify@Exp[#] &, b Log[f[t]] + a (Log[f[t]] - Log[g[t]]) - c Log[g[t]]] whose output is: $f(t)^a g(t)^{-a}+...
3
votes
1answer
50 views

Why the parenthesis for the output -CenterDot[x,y]?

Why do 2 CenterDot[x,y] - CenterDot[x,y] produce output that looks like $2 \, x\cdot y$ for the former but $-(x\cdot y)$ with parentheses for the latter? Both ...
0
votes
2answers
47 views

How do I get more control over table headings when using TableForm? [closed]

I'm creating some multi-column tables with multi-line headings. The following is an example I created the above table using the Table statement as follows ...
0
votes
1answer
60 views

Padding a number doesn't work when transferring to LaTeX

I have some numbers which I calculate via some previous code. The calculation works fine. However since I want to compare it with experimental data I only need the numbers to a certain number of ...
0
votes
1answer
41 views

`PlotLegends` formatting mixing italics and upright letters

If I do: ListPlot[Range[10] ,PlotLegends->Placed[LineLegend[{"Subscript[N, σ] f(m; μ, p)"},LabelStyle->{FontFamily->"Times"}],{0.8,0.35}] ] where ...
6
votes
4answers
114 views

Suppress trailing 0s in numerical values

For example, this is what I want In[1]:= N[Table[4^(i/4), {i, 1, 4}]] Out[1]= {1.41421, 2., 2.82843, 4.} But if I want a few more digits only from the irrational ...
4
votes
0answers
35 views

Is it possible to embed the Manipulate into a WordPress post?

I have a manipulate Manipulate[n, {n, 1, 100}], I want to put it in my Wordpress blog post. Should I CloudDeploy it as below ...
2
votes
1answer
234 views

How to force 2=={} as a Boolean output?

I have a code as below:- x = 2; If[x == {}, 1, 0] I want the output to be 0, but the output I got is the entire ...
2
votes
1answer
23 views
0
votes
2answers
75 views

Why does my Solve output contain this symbol? [duplicate]

I have a pair of coupled polynomial equations that I need to solve, so I tried using Mathematica's solve tool. This is the code that I wrote: ...
1
vote
1answer
46 views

Distributing complex conjugate

If you have a statement like: Conjugate[a+b] you get back Conjugate[a+b] but I'm expecting ...
0
votes
2answers
44 views
4
votes
2answers
60 views

How to get the input string of Entity as output?

I have the following codes:- ...
8
votes
1answer
92 views

How to make GeoListPlot rectangular?

I have a GeoListPlot as below:- gr = {{20, 70}, {-30, 30}}; GeoListPlot[Entity["City", {"Paris", "IleDeFrance", "France"}], GeoRange -> gr] As you can see, ...
5
votes
2answers
72 views

Convert floating point numbers to string like sprintf/fprintf?

I am trying to export some floating point numbers into a csv/txt file. I would like to have a efficient way to control the space between numbers as well as the accuracy of the numbers, as we do in C: ...
3
votes
1answer
96 views

How to convert entity to string?

I have an entity city. For example, I run {city} = GeoNearest["City", GeoPosition[{41.8, -87.7}]] and then I got The entity "...
0
votes
1answer
46 views

Format numerical input as text [closed]

I currently have the following code: ...
0
votes
1answer
70 views

How to format Print to display in Panel

The following code prints the the value of the solution $x(t)$ to an ODE at a user defined time $t_f$. I want the value (0.350232) to appear within the Panel and not below the Panel as the following ...
0
votes
0answers
35 views

Decimal representation in Mathematica 10

I am using a slider to assign the value for a dynamic variable x, and want to display the value of y=10^Dynamic@x in decimal ...
7
votes
3answers
279 views

Neural network illustrations

(Since this post was met with a certain reluctance to be given answers, a version of it is also posted in Community.) Please share neural networks diagrams you have made in Mathematica / WL. Here is ...
0
votes
1answer
40 views

How can I Reduce the covariance Matrix?

How can I reduce this covariance matrix? And also plot its eigenvalues? and how to compute its eigenvectors? Can we compute its eigenvalues and eigenvectors without reducing in compact form? ...
0
votes
1answer
79 views

How to force Mathematica to show the plots in one row? [closed]

Consider we have two different plot commands in Mathematica. In the output there are one plot and another one below. But I want the output to be organized in one row: on the left there is one plot, ...