Graphics and Plots

1D Plots

Simple graphical representation of the function Sin x 
in the range from 0  to 4 Pi

Plot[Sin[x],{x,0,4  Pi}]

What are the options to modify the standard settings?

?Options

Options[Plot]

Plot[Sin[x],{x,0,4  Pi},Frame->True]

This is to have always a frame

Options[Plot,Frame->True]

We need axis labels and Heading, do it.

3 D Plots

f = Plot3D[Exp[-(x^2 + y^2)],{x,-2,2},{y,-2,2}]

g = ContourPlot[Exp[-(x^2 + y^2)],{x,-2,2},{y,-2,2}]

Show[GraphicsRow[{f,g}]]

Parametric Plots

h =ParametricPlot3D[{Sin[t],Cos[t],t/5},{t,0,10}]

Need to transport your Plot or File

Idea: save the plot to a file on the system which runs  mathematica
The ending of the filename determines the format of the plot

Export["MyFirstPlot.eps",%2]

Save the plot in a directory called  plotsPhysikI in different formats

Create a table of random numbers between [-45,55] and export the table to a file

data=Table[50+RandomReal[{-5,5}],{n,2000}];
Export["MyFirstDataFile.txt",data]

ReadList reads the data back in in a number format. It understand also exponential Formats as used in Fortran.
After reading we plot all the data

myData = ReadList["MyFirstDataFile.txt",Number]
Histogram[myData]

export data to an Excel spreadsheet

Export["MyExcelFile.xls", ({{1, 3}, {2, 7}, {3, 31}, {4, 127}, {5, 8191}, {6, 131071}, {7, 524287}, {8, 2147483647}, {9, 2305843009213693951}, {10, 618970019642690137449562111}})]

Import your Plot or File

import data from any accessible URL

Import["http://edcftp.cr.usgs.gov/pub/data/gtopo30/global/e100n40.tar.gz",ImageSize->Medium]

Try to write a file to your public_html and import the file in mathematica.

import the first 5 rows from our exported Excel spreadsheet

Take[Import["MyExcelFile.xls",{"Data",1}],5]//TableForm