Group Abstract Group Abstract

Message Boards Message Boards

0
|
4K Views
|
4 Replies
|
0 Total Likes
View groups...
Share
Share this post:

PlotRange function problem

Posted 10 years ago

I am trying to graph a few linear functions and restrict their x and y ranges from 0 to 50, so I use the command:

Plot[{x, 4*x, 3*x/2, (4/3)*(x - 10)}, {x, 0, 50}, PlotRange (backslash)[Rule] {0, 50}]

However, Mathematica is interpreting this as Plot[x^2, {x, -1.2, 1.2}]. It's probably not a problem with any of the functions, as without PlotRange, it seems to work fine.

POSTED BY: Sham Mahmud
4 Replies
Posted 10 years ago

Notice that he has a "-" followed by a ">" and you have the single character \[Rule].

There have been examples in the past where users have had "desktop published" characters that look almost identical to other characters, but that mean completely different things to Mathematica. But I am not claiming that is the cause of your problem.

Perhaps try typing

Plot[{x, 4x, 3x/2, (4/3)*(x - 10)}, {x, 0, 50}, PlotRange{0, 50}]

EXACTLY that way and then click to put the cursor between the e and the { and tap the - key and the > key and then Shift Enter and see if that works for you. (Any other characters and Mathematica may automatically translate the - and > into a single character.)

POSTED BY: Bill Simpson
Posted 10 years ago

Strange, I typed in the exact same thing as you did, but I'm still getting the same output as I originally posted.

POSTED BY: Sham Mahmud

Copy and paste the code I displayed in my original reply; it should work just fine.

When you want to enter the abbreviation for Rule in an Input cell, type a hyphen (-) then a greater-than (>). The combination will automatically change to the correct symbol. Ditto if in the Input cell you type the longer form \[Rule].

POSTED BY: Murray Eisenberg

Seems to work OK:

Plot[{x, 4 x, 3 x/2, (4/3)*(x - 10)}, {x, 0, 50}, PlotRange -> {0, 50}]

enter image description here

POSTED BY: Murray Eisenberg
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard