0% found this document useful (0 votes)
22 views

Programming Languages - 08052018

This document provides instructions for plotting various graphs and animations using programming languages: 1. Plot two datasets on the same plot with different markers and colors. Include a legend and label the axes. 2. Plot a 2D curve defined by two equations varying r and φ. 3. Create a 2x2 subplot with four 3D curves plotted with different colors, widths and line styles. 4. Create a subplot with two surfaces plotted with a configurable color gradient. 5. Plot an animation of a growing 3D spiral from t=π to t=16π.

Uploaded by

Irina Stanciu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

Programming Languages - 08052018

This document provides instructions for plotting various graphs and animations using programming languages: 1. Plot two datasets on the same plot with different markers and colors. Include a legend and label the axes. 2. Plot a 2D curve defined by two equations varying r and φ. 3. Create a 2x2 subplot with four 3D curves plotted with different colors, widths and line styles. 4. Create a subplot with two surfaces plotted with a configurable color gradient. 5. Plot an animation of a growing 3D spiral from t=π to t=16π.

Uploaded by

Irina Stanciu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Programming Languages – Laboratory 8.05.

2018
1. Plot the following two data sets on the same plot. For each set, x = 0, 1, 2, 3, 4, 5. Use a
different data marker and a different color for each set. Use a legend, and label the plot
axes appropriately. The first set is y1 =11, 13, 8, 7, 5, 9. The second set is y2 = 2, 4, 5, 3,
2, 4

2. Plot the 2D curve defined by the equations:


𝑥 = 𝑟(𝜑 − sin 𝜑)
, r =10 and 0 < 𝜑 < 12𝜋
𝑦 = 𝑟(1 − cos 𝜑)

3. Create a 2X2 subplot with the following 3D curves:


𝑥 = 𝑒 . sin 𝑡
a. 𝑦 = 𝑒 . cos 𝑡, for 𝑡 ∈ [0,8𝜋].
𝑧=𝑡
Plot this curve in red with a line width=2
b. 𝑥 = 2 sin(3𝑡) cos(𝑡); 𝑦 = 2𝑠𝑖𝑛(3𝑡)𝑠𝑖𝑛(𝑡); 𝑧 = 𝑠𝑖𝑛(3𝑡), for 0 ≤ 𝑡 ≤ 2𝜋
Plot this curve in green with a dashed line of width=1

c. x=3cos(t)+cos(10t)cos(t) ; y= 3sin(t)+cos(10t)sin(t) ; z= sin(10t), for 𝑡 ∈ [0,2𝜋]


Plot this curve in black with a line width=1,

d. x= 5cos(t)-cos(5t) ; y= 5sin(t)-sin(5t) ; z= t, for 𝑡 ∈ [0,8𝜋]


Plot this curve in cyan with a line width=4.

4. Create a subplot with the following surfaces:

The configuration of the subplot should be the following:


Give each graphic a title. Change the color gradient of the surfaces.

5. Plot the animation of a 3D growing spiral. The equations of the spiral are:
𝑥 = 𝑡 ∗ sin(𝑡)
𝑦 = 𝑡 ∗ cos(𝑡), for 𝑡 ∈ [0,16𝜋].
𝑧=𝑡
The animation should start at 𝑡 = 𝜋 and stop at 𝑡 = 16𝜋

You might also like