Step 1.: Creating 2D Graphs
Step 1.: Creating 2D Graphs
Step 1.: Creating 2D Graphs
Step 2. Create an X-Y Plot by choosing Graph > X-Y Plot from the
Insert menu. Alternatively, click the X-Y Plot button on the Graph toolbar:
Step 3. You see a blank graph with two empty placeholders. Enter your
data set names in the appropriate axis placeholders (in this example, x is on
the x-axis and y is on the y-axis). Then click outside the graph or press
[Enter] to finish.
01.Histograme.xmcdz 1 4/17/2020
7
y 5
3
1 2 3 4
x
By default, Mathcad plots the data as a line and then sets the axis limits
from the minimum to the maximum of the x-axis data.
y 4
0 1 2 3 4 5
x
01.Histograme.xmcdz 2 4/17/2020
Step 5. To change the axis limits, click on the graph and enter new values at
the ends of each axis.
10
6
y
4
0 2 4 6 8 10
x
To Create a Histogram
There are three steps to creating a histogram plot of a set of
one-dimensional data:
1. Enter or import the data in your worksheet.
2. Use the built-in histogram function to "bin" the data.
3. Plot the results returned by the histogram function.
01.Histograme.xmcdz 3 4/17/2020
2
3
4
8
5
data H histogram ( 3 data)
6
Sort the data into three bins to
9
get three bars on the plot.
1
2
8
You can view the results of calling the histogram function by typing, in
this case, H [=].
Step 3. Insert an X-Y Plot by choosing Graph > X-Y Plot from the Insert
menu. Then, in the x-axis enter the first column of the histogram result and in
the y-axis enter the second column of the result.
01.Histograme.xmcdz 4 4/17/2020
4
Hint: Type [Ctrl] 6
to get the or
3.8 column placeholder.
3.6
1 Note: Arrays and
H
Data Tables are
3.4
indexed starting at
0 by default.
3.2
3
2 4 6 8
0
H
Step 4. To display a solid bar plot, double-click the graph. On the Traces
page, select "solidbar" under Type. Click OK.
3.8
Note: Click on the graph to
see the axis limits. Note that
3.6 all the data is not visible for
1
H the second two histogram
3.4 bars. The lower-limit of
y-axis data is the minimum
number of points in an
3.2
interval, so a bar is not
visible, just a line.
3
2 4 6 8
0
H
Mathcad sets the axis limits from the minimum to the maximum of the x-axis
data. So we need to change the limits of both the x and y axes to make this
graph meaningful.
01.Histograme.xmcdz 5 4/17/2020
Step 5. To change the axis limits so you can see all the data on the graph,
click on the graph and enter new values at the ends of each axis.
0 5 10
0
H
01.Histograme.xmcdz 6 4/17/2020