Plotting 2D Graph in Mathematica: y>=340 & y<340

  • Mathematica
  • Thread starter James Wine
  • Start date
  • Tags
    2d Graphing
In summary, to plot a 2D graph in Mathematica that meets the condition y>=340 and y<340, you can use the Plot function with the added constraint of y>=340. Yes, you can plot multiple 2D graphs with different conditions in Mathematica by using the Show function. To change the color or style of your 2D graph in Mathematica, you can use the PlotStyle option within the Plot function. You can also add a legend to your 2D graph using the PlotLegends option. Finally, you can save your 2D graph in Mathematica as an image or PDF file using the Export function.
  • #1
James Wine
8
0
If someone could supply the code to plot this graph in Mathematica would be awesome.

Would also be best if it checked the y's at units of t {0,1,2,3...,inf}

y >= 340
Plot[100 (t) - 340 (t/2), {t, 0, 20}]
y< 340
Plot[100 (t) - 115 (t/2) , {t, 0, 20}]
 
Last edited:
Physics news on Phys.org
  • #2
Plot3D[Piecewise[{{100 t-340 t/2, y>=340}, {100 t-115 t/2, y<340}}], {t, 0, 20}, {y, 0, 1000}]

but that does not graph y to infinity.
 
  • #3
Thank you, sadly I won't be able to check it until i get home. On the road working.
 

1. How do I plot a 2D graph in Mathematica that satisfies the condition y>=340 and y<340?

To plot a 2D graph in Mathematica that meets the condition y>=340 and y<340, you can use the Plot function with the added constraint of y>=340. This will limit the range of the y-axis to values greater than or equal to 340. For example: Plot[x, {x, 0, 10}, PlotRange -> {{0, 10}, {340, All}}]

2. Can I plot multiple 2D graphs with different conditions in Mathematica?

Yes, you can plot multiple 2D graphs with different conditions in Mathematica by using the Show function. This allows you to combine multiple plots into one graph, each with its own specified conditions. For example: Show[Plot[x, {x, 0, 10}, PlotRange -> {{0, 10}, {340, All}}], Plot[x^2, {x, 0, 10}, PlotRange -> {{0, 10}, {340, All}}]]

3. How can I change the color or style of my 2D graph in Mathematica?

To change the color or style of your 2D graph in Mathematica, you can use the PlotStyle option within the Plot function. This allows you to specify the color, thickness, and other style properties of the graph. For example: Plot[x, {x, 0, 10}, PlotRange -> {{0, 10}, {340, All}}, PlotStyle -> Red]

4. Is it possible to add a legend to my 2D graph in Mathematica?

Yes, you can add a legend to your 2D graph in Mathematica by using the PlotLegends option within the Plot function. This allows you to specify the labels for each plot in your graph. For example: Plot[{x, x^2}, {x, 0, 10}, PlotRange -> {{0, 10}, {340, All}}, PlotLegends -> {"Linear", "Quadratic"}]

5. How can I save my 2D graph in Mathematica as an image or PDF file?

To save your 2D graph in Mathematica as an image or PDF file, you can use the Export function. This allows you to specify the file format and location for your graph. For example: Export["mygraph.png", Plot[x, {x, 0, 10}, PlotRange -> {{0, 10}, {340, All}}]]

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
248
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
121
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
9
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
928
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
3K
Back
Top