12:00 AM
@Mr.Wizard I mean, when I have first plot, then your in same Grid. if NOT using AspectRatio I get the above. So I have to use AspectRatio->0.68 to get it out correctly.
THis is ONLY when the 2 plots are in same grid ofcourse.
any way, will play with it. no problem...
now I know it was the aspect ratio so I can sort it out....

@Nasser Your image illustrates the behavior that I expect. Further, you state that this only applied inside Grid but that is not the case in version 7, where inside or outside of Grid the default produces the tall skinny (useless) plot. Are you sure it's not the same in your version?
Hello, @Liam

@Mr.Wizard I show what I got in the image above? I am using version 9. You can see the effect of putting it inside Grid. It seem like SHow[], where the first plot options are used for the next plot...
It has to be like this to come out ok, ONLY when put in grid with the first plot:
Grid[{
{Plot[fUnion[x], {x, 55.3346, 55.3565}]},
{ParametricPlot[fMap[x], {x, 1, 13}, AspectRatio -> 1/GoldenRatio]}
}]
So, it is no problem really. Just to point out that if one removes the AspectRatio it will not look right, since it will use the first plot options....

@Nasser I swear I'm not trying to be obtuse. I just don't see the behavior I think you're describing, either in your image or in Mathematica 7. Are you saying that using this exactly: ParametricPlot[fMap[x], {x, 1, 13}] outside of Grid produces a usable plot?
I don't think that options are carried over between plots in a Grid; they are in Show however.

@Mr.Wizard opps, you are right. Sorry. I NEED the aspect ratio even outside. Too many things going on. OK. Will use AspectRatio all the time ! Sorry.
Plot[fUnion[x], {x, 55.3346, 55.3565}]
ParametricPlot[fMap[x], {x, 1, 13}, AspectRatio -> 1/GoldenRatio]

Okay. By the way you can always change the default AspectRatio of ParametricPlot if you prefer a fixed ratio, using e.g. SetOptions[ParametricPlot, AspectRatio -> 1/GoldenRatio]

12:12 AM
@Mr.Wizard sure. I have not used ParametricPlot much before, so this was new for me, that is why. Will update my answer now with the 3 methods....

Alright. See you later.

8 hours later…
7:45 AM
if any one around who like to test a demo, just to make sure it is clear and no questions on it, please let me know. It is on finite difference methods. it is pretty much done..... V 9.01 but should run on older versions...

6 hours later…
1:19 PM
how does one extract the first symbol from any symbolic expression? I have a function that returns an expression, and it can be anything, and I just want to process the first symbol, whatever it is from that expression? For example -3/4 x D[f[x],x] so in this case "-" will be the first "thing". I tried converting to String, but did not work

@Nasser have you considered analyzing the FullForm of your expression?

I just wanted to find out if the expression has minus sign or not in front of it. The minus sign can only be the first thing.
@YvesKlett looked at it, but the expression can be complicated. Much easier if I convert it to string, and just take the first letter, but it does not work
But now when I search for "-" it finds many of them !!
I think I need a pattern to look for minus sign anywhere in the expression. There can be only ONE minus sign...
I do not like pattern matching!

What about a combination of ...//CForm//ToString?

How does not matches a MINUS anywhere in an expression tree?

Will there ever be only one negative term?

1:32 PM
YES. It will be either -(1/6) h^2 .... OR no minus
very simple. But been on it for 30 minutes and can figure it out.

Can you paste the InputForm or FullForm of some expressions (too lazy to type)?

This is an error term from finite difference. I just need to know if it start with minus or not. that is all.
(-(1/6))*h^2*Derivative[3][f]
I am using a Mathematica function that return the error term. I just need to know if it starts with minus or not.

StringTake[ToString[x // CForm], 1] == "-" for this case ;-)

Thanks, will try it now!

or perhaps:
(x /. Thread[Variables[x] -> 1]) < 0
which seems more in the spirit of things...

1:38 PM
Sure, will try that also....
@YvesKlett the second one worked !!
(x /. Thread[Variables[x] -> 1]) < 0  that is neat trick
thanks. If you think this is a good question to post on main board, I will do that and you can answer it. I struggled with this for almost 40 minutes now

@Nasser yes, please post. I feel that much better solutions will drop in at any rate!

Sure, will do.
Ibet Mr Wizard will have a 3 letters solution :)
@YvesKlett btw, this is the function I was using:
FDFormula[m_(*order of derivative*), n_(*number of grid intervals*),
s_(*set to n/2 to get centered differenrer*)] :=
Block[{}, F = Table[f[Subscript[x, i + k]], {k, -s, n - s}];
CoefficientList[Normal[Series[x^s Log[x]^m, {x, 1, n}]/h^m], x],
Length[F], 0];
Wfact = 1/Apply[PolynomialGCD, W];
W = Simplify[W Wfact];
taylor[h_] = Normal[Series[f[Subscript[x, i] + h], {h, 0, n + 2}]];
error =
Drop[CoefficientList[
Expand[(Table[taylor[h k], {k, -s, n - s}].W)/Wfact], h], 1];
Just call it like this
Last@FDFormula[2, 3, 3]
Just make sure "n" is always larger than "m"
So it is just one term.

2:11 PM
@YvesKlett I am about to post this:

"Given a symbolic expression how to find if starts with a minus or not?"

I just feel it is strange no one asked this before? It seems easy at first, yet I found it hard. I am sure this was asked before?

@Nasser if you searched the site and nothing scanned, then go ahead.

hard to search for this. I did. But it is so generic. Will post it now !
@YvesKlett You can post your answer if you like. it is a useful one

3:08 PM
How come when I entered 'math' in the chat room list, this one doesn't show?
Never mind... I didn't select "all" so I just saw Mathematics rooms. Doh!
I haven't seen J.M. around for a while. Is he on a break?

3:40 PM
Hi everyone
@Mr.Wizard No, I meant to have several ContourPlots, where the ranges of each plot change. So, one would have an xx axis that goes from -21 to -18, the other has one that goes from -18 to -15, and so on. In the end, I'll use Grid or something similar to display all of them, side by side
Of course I could change it manually, but that isn't very elegant
So my question is: is there any way to change the range of one of the axis automatically, using a map (or something similar)?

4:08 PM
@robjohn Hi, I happen to see you in this Chat, I think I have many math questions to ask you in the future. J.M disappeared from my posts for a long time.

@robjohn according to his profile, yes.

@robjohn Apparently so. He was quite after for a while again a few months ago after a long break, but he has not been around since late June.
@robjohn And as @rcollyer notes his profile says: "Taking an externally-imposed and much-needed break from SE activities."

So sad, everybody, so many downvotes today, haha, good night Mr.Wizard, good night rcollyer

I'm annoyed with the whole: mathematica won't solve this, help! type questions.
I may have been a little harsh here.
@HyperGroups good morning! :)

@Nasser Good thing I do like pattern matching. :^)

4:12 PM
@Mr.Wizard I knew if you saw the question you'll solve it in least keystrokes than anyone else. I struggled with this for more than 30 minutes :(
I am not good with patterns. I need to learn it more.

@Nasser been there, done that, have scars. Pattern matching can be a right pain in the arse.

@Nasser I hope the struggle wasn't entirely fruitless; even if you didn't get a solution you probably learned something. I wish the process were more enjoyable.

@Mr.Wizard yes. I also just finished a demo for WRI. Nice one, on finite differences. You see this RED term in here? This is the one I was trying to parse from another function.
I need it to added it, and needed to a way to know if I should add a "+" or not. Hence the question.

@Nasser You quite possibly are doing it the hard way. Plus should format automatically with the + or - as needed. You can use HoldForm to prevent any other ordering or evaluation from taking place.

@Mr.Wizard hummm, I was doing this Row[{formula, redTerm}] and so, if redTerm was not negative, I'll have no sign between and it will look multiplication. I should try now HoldForm[formula + redTerm] and see. Did not think about it, will be much simpler.... will check it now....

4:25 PM
@Nasser You'll need to make sure your Symbols formula and redTerm evaluate, assuming those are actual symbols and not merely names for this discussion. You may want: HoldForm[+##]&[formula, redTerm]

@Mr.Wizard trying it now....

If it works for you be sure to read this and the linked questions:
3

Related questions: Displaying a series obtained by evaluating a Taylor series How to keep Collect[] result in order? How do I get a two-term polynomial with a leading negative sign to display in the correct (i.e. textbook) order? As shown in answer to the third question above you could use: ...

hummm. small problem... it works like this:
{Item[TraditionalForm@HoldForm[+##] &[formula, lte],
ItemSize -> {50, 4}]}
where lte is the RED term. But I need to find how to make it red. This does not work:
ItemSize -> {50, 4}]}
but will play with it..... good idea, thanks
Before, I did it this way:
If[(lte /. Thread[Variables[lte] -> 1]) < 0,
Style[lte, Red],
Style[Row[{"+", lte}], Red]
]}], Large
], ItemSize -> {50, 4}]}
(before I saw your solution on the main board)
using Row....
the Style gets in the way....
@Mr.Wizard do not worry about it. it is working ok using a Row[]....

@rcollyer take a deep breath and relax

@Nasser That's a good point; I'm not sure how to fix that, but I'll be thinking about it. Since this (the main question) is a formatting issue it may be best addressed as one; I'll update my answer soon with an alternative approach.

4:41 PM
@Mr.Wizard your method of HoldForm[+##] &[formula, lte] is neat. But I wanted to make lte RED since it represents truncation error in finite difference, I thought that will look nice for the demo. That is why. thanks again for your help.

@Nasser Yes, I understand why HoldForm isn't working in this case. Unrelatedly I'm going to add a different leading-negative test to my answer.

@Mr.Wizard sure...

5:01 PM
@YvesKlett I did, then I wrote my nasty gram. :)
Had to get the wording right.

@HyperGroups Why did you delete a recent question about export to HTML? I was just about to look at that when it disappeared. (Of course as a moderator I can see it, but that's not the point.)

@Mr.Wizard I am glad to see that I wasn't missing something simple when I tried to do something like that :-)

5 hours later…
9:45 PM
@Mr.Wizard I'm here

@rm-rf Hello, and thanks.

No problem

As a v7 user I can't make sense of this:
I take the exact code you have in the extension, run it in a notebook (mathematica 9 on windows), Select some or all the output in the notebook, right click and go "Copy as Latex". When I paste it, I got things like: \text{$\$$CellContext\grave{ }a}(1)+\text{\$$CellContext$\grave{ }$a}(2)+(\text{$\CellContext$\grave{ }$bx}(1))^2- However, following your suggestion, if I remove the Interpretation from the Extension code, it seems to copy/paste as I had hoped. — jlperla 17 mins ago
(See preceding comments.) I'm hoping you know what's wrong, and a simple fix.

@Mr.Wizard Hmm... I don't have a fix, but he's right that Interpretation is what's messing it up. It changes b to $CellContextb in the cell expression, which is why this comes up Cell[BoxData[ RowBox[{"{", RowBox[{"{", RowBox[{ InterpretationBox[ SubscriptBox["b", "2"],$CellContextb[2]], "->",
RowBox[{
FractionBox["1", "2"], " ",
RowBox[{"(",
RowBox[{
InterpretationBox[
SubscriptBox["a", "1"],
$CellContexta[1]], "+", InterpretationBox[ SubscriptBox["a", "2"],$CellContexta[2]], "+",
SuperscriptBox[
RowBox[{"(",
InterpretationBox[
SubscriptBox["bx", "1"],

Okay, I'll let him know there's not a mistake on his end.
Thanks again.

9:54 PM
No problem :)

2 hours later…
11:49 PM
I have found the anti-Leonid! (see gravatar)