Help with Mathematica: Plotting Graphs & Changing Scales

  • Context: Mathematica 
  • Thread starter Thread starter camillerinadia
  • Start date Start date
  • Tags Tags
    Mathematica
Click For Summary

Discussion Overview

The discussion revolves around using Mathematica for plotting graphs, specifically focusing on customizing axis scales, handling logarithmic functions, and performing vector transformations. Participants seek assistance with specific plotting commands and error messages encountered while using the software.

Discussion Character

  • Technical explanation
  • Homework-related
  • Exploratory

Main Points Raised

  • One participant asks how to change the x-axis ticks to display multiples of pi instead of integers when plotting y=sin x.
  • Another participant suggests using the Ticks option in the Plot function to customize axis ticks.
  • A participant inquires about using LaTeX with Mathematica and reports an error related to .eps files.
  • Another participant responds that they have no experience with LaTeX and hopes someone else can assist.
  • A participant seeks help plotting Ln x and encounters errors with their initial command, asking for guidance.
  • Another participant advises using Abs[x] instead of |x| to resolve the issue.
  • One participant mentions that their graph of Log[Abs[x]] does not intersect the axes and asks how to adjust this and draw an asymptote for Log[x-1].
  • A participant expresses a need for urgent help with drawing vectors and performing transformations such as reflections in Mathematica.
  • Another participant suggests applying transformation matrices to vectors for reflections and mentions using ListPlot for visualization.

Areas of Agreement / Disagreement

Participants generally agree on the methods for customizing plots and resolving specific errors, but there are unresolved questions regarding the intersection of axes and the drawing of asymptotes. The discussion includes multiple inquiries and responses without a clear consensus on all issues raised.

Contextual Notes

Some participants' questions remain unresolved, particularly regarding the behavior of logarithmic plots and the specifics of vector transformations. There are also dependencies on the version of Mathematica being used, which may affect the commands and outputs discussed.

Who May Find This Useful

This discussion may be useful for users of Mathematica looking to customize plots, handle logarithmic functions, and perform vector transformations, particularly those encountering similar issues or errors in their work.

camillerinadia
Messages
22
Reaction score
0
Hello, I need help with Mathematica. I want to plot a graph of y=sin x, but on the x-axis, I want pi, 2pi, 3pi, etc and not 2, 4, 6, etc. How can I change this? and also how can I change the scale for any graphs? For example, if I currently plot y=e^x, I get a big range for the y-axis (4000), how can I alter this?? Thank you
 
Physics news on Phys.org
For changing the tick marks for the axis use the Ticks option:
Code:
Plot[Sin[x], {x, -2 Pi, 2 Pi}, Ticks -> {{-2 Pi, -Pi, 0, Pi, 2 Pi}, {-1, 0, 1}}]

For changing the range use the PlotRange option:
Code:
Plot[E^x, {x, -10, 10}, PlotRange -> {0, 20}]
 
oh thank you so much Moo of Doom. Do you know how to use LaTeX with mathematica? I'm having an error when I try to insert a mathematica file, with an extension .eps in LaTeX. This is because program is not finding a .eps file, or it is not recognizing it. Any ideas?
 
You're welcome.

Nope, sorry. I have no experience with using \LaTeX with Mathematica. Hopefully someone else here can help you with that problem. Good luck.
 
Also, if I want to plot a graph of Ln x, I'm inserting Plot[Log[|x|],{x,-3,3}] and I'm having errors, what shall I use then? Thank you so much
 
Abs[x] instead of |x|.
 
Oh yes it worked! I've written Plot[{{Log[Abs[x]]} etc but the only problem is that the x and y-axis do not intersect. the graph is starting from x=1 onwards. Why is that and how can I alter it. Moreover how can I draw the asymptote on x=1 if for example I have to plot Log[x-1]
 
Can I do transformations with Mathematica??

:cry::cry: Can anyone here help me? I want to draw two vectors on mathematica, namely (1,0) and (0,1), the i and j vectors and want to make some transformations on them, like for example reflections with x-axis, with y=x, etc. How can I do this?? I need urgent help here. Please help me!
 
camillerinadia said:
Oh yes it worked! I've written Plot[{{Log[Abs[x]]} etc but the only problem is that the x and y-axis do not intersect. the graph is starting from x=1 onwards. Why is that and how can I alter it. Moreover how can I draw the asymptote on x=1 if for example I have to plot Log[x-1]
I don't think there is any Mathematica version that will show you anything but errors. You will have to specify at least the domain, and here Plot[Log[Abs[x]], {x, -1, 1}] just works fine.

camillerinadia said:
:cry::cry: Can anyone here help me? I want to draw two vectors on mathematica, namely (1,0) and (0,1), the i and j vectors and want to make some transformations on them, like for example reflections with x-axis, with y=x, etc. How can I do this?? I need urgent help here. Please help me!

You can apply transformation matrices to vectors, like this
{{1,0},{0,-1}} . {a, b}
returns the vector {a,b} mirrored in the x-axis, etc. You can use e.g. ListPlot to plot them and add some labels.
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 1 ·
Replies
1
Views
1K