How do I plot a function with frequency and energy using Mathematica?

In summary, the conversation was about a comparison between Planck's, Rayleigh's, and Wien's formulas and plotting a function in Mathematica. The function had a label written in scientific notation, but the asker wanted it to be written as 10^11. After some troubleshooting, it was discovered that enclosing 10^11 in quotation marks solved the issue.
  • #1
TheDestroyer
402
1
Hello guys,

I'm doing a comparison between Planck's, Rayleigh's and Wien's formula, and I'm plotting the following function in mathematica


Plot[{(2 h (v 10^11)^3)/c^2 10^17/(Exp[(h (v 10^11))/(k T)] - 1), (
2 (v 10^11)^2)/c^2 k T 10^17, (2 h (v 10^11)^3)/
c^2 Exp[-((h (v 10^11))/(k T))] 10^17}, {v, 0 10^0,
5}, {PlotRange -> 2 10^0, PlotStyle -> Thick,
AxesLabel -> {Frequency (10^11 Hz),
Energy/surface\[Cross]time (10^-17 J/(m^2 s))}}]

If you plot this, you'll see that the label is written as 100000000000 Hz.

Can anyone tell me please how to write it as 10^11?

I'm tired of trying, please help.

Thanks
 
Physics news on Phys.org
  • #2
Help guys! please!
 
  • #3
You can write text as "text" and Mathematica will plot exactly what you wrote (but will no longer interpret it as mathematics). You can find info like this in the Documentation Center built into Mathematica for every command (e.g., AxesLabel).
 
  • #4
I tried text, but it's still taking it as a number! I don't understand why! :(
 
  • #5
Hey guys! come on! please help!
 
  • #6
Are you enclosing 10^11 in quotation marks? Works for me.
 
  • #7
That's a lot pal :), Problem solved :)
 

Related to How do I plot a function with frequency and energy using Mathematica?

1. How do I plot multiple functions on the same graph in Mathematica?

To plot multiple functions on the same graph in Mathematica, you can use the Plot function and simply list all of the functions you want to plot within the same set of curly brackets. For example, Plot[{Sin[x], Cos[x], Tan[x]}, {x, 0, 2π}] will plot the sine, cosine, and tangent functions all on the same graph.

2. Why is my Mathematica plot not showing up?

There could be several reasons why your Mathematica plot is not showing up. Some common issues include not using the correct syntax for the Plot function, not including the necessary variables or ranges, or having other errors in the code. Double-check your code and make sure everything is entered correctly.

3. How can I customize the appearance of my Mathematica plot?

There are many ways to customize the appearance of your Mathematica plot. You can change the color, style, and thickness of the lines, add labels and titles, adjust the axes and grid lines, and much more. The easiest way to do this is by using the various options available in the Plot function, or by using the Graphics options to manually customize the plot.

4. Can I export my Mathematica plot as an image or file?

Yes, you can export your Mathematica plot as an image or file in various formats such as PNG, PDF, or SVG. To do this, use the Export function and specify the file type and file name. For example, Export["myplot.png", Plot[x^2, {x, -3, 3}]] will export the plot of x^2 as a PNG file named "myplot" in your current directory.

5. Is there a way to add a legend to my Mathematica plot?

Yes, you can add a legend to your Mathematica plot by using the PlotLegends option in the Plot function. You can specify the labels for each function and customize the placement and appearance of the legend. Alternatively, you can use the Legended function to add a legend to an existing plot. Both options allow for a lot of customization to create a visually appealing and informative legend for your plot.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
645
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
3K
  • Introductory Physics Homework Help
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • Introductory Physics Homework Help
Replies
5
Views
1K
  • Programming and Computer Science
Replies
2
Views
1K
  • Programming and Computer Science
Replies
6
Views
1K
Replies
10
Views
819
  • Atomic and Condensed Matter
Replies
7
Views
472
Back
Top