0% found this document useful (0 votes)
8 views8 pages

Python Data Plotting Assignments

This document contains instructions for several Python plotting assignments from Spoken Tutorial tutorials on plotting data and other types of plots. The assignments include: plotting experimental data with large and small dots and including error bars; squaring a sequence of numbers and plotting data from a simple pendulum; plotting percentage profit data from a file using scatter plots with different markers and colors; plotting a log-log chart; and comparing scatter and plot functions.

Uploaded by

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

Python Data Plotting Assignments

This document contains instructions for several Python plotting assignments from Spoken Tutorial tutorials on plotting data and other types of plots. The assignments include: plotting experimental data with large and small dots and including error bars; squaring a sequence of numbers and plotting data from a simple pendulum; plotting percentage profit data from a file using scatter plots with different markers and colors; plotting a log-log chart; and comparing scatter and plot functions.

Uploaded by

Darshana Nagale
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Spoken Tutorial, IIT Bombay

Python 3.4.3
Plotting Data -Assignment
Group Members:
Aditya Anil Patade
Advait Powale

Tutorial 9
Assignment-1
1. Plot the given experimental data with large dots.
∂l ∂t
0.08 0.04
0.09 0.08
0.07 0.03
0.05 0.05
0.06 0.03
0.00 0.03
0.06 0.04
0.06 0.07
0.01 0.08
:-

Assignment-2
1. Plot the given experimental data with small dots. Also include the error in your plot.
S n ∂S ∂n
0.19 10.74 0.006 0.61
0.38 14.01 0.006 0.69
0.57 18.52 0.005 0.53
0.77 20.23 0.003 0.38
0.96 22.88 0.004 0.46
1.15 24.59 0.007 0.37
1.34 27.55 0.004 0.46
1.54 28.48 0.004 0.46
1.73 30.20 0.007 0.37
-
Assignment-3
1. Square the following sequence.
➢ distance_values = [2.1,4.6,8.72,9.03]
:- square(distance_values)

2. Plot l versus t in red pluses from the Simple Pendulum Data.


- plot(l, t, ’r+’)

Spoken Tutorial, IIT Bombay

Python 3.4.3
Other Types Of Plots –Assignments

Tutorial 10
Assignment-1

1. Plot a scatter plot showing the percentage profit of a Company A from the year 2000-2010.

Note: The data for the same is available in the file “[Link]”. This file is available in
the code file link of this tutorial. Please download and use it.
Assignment-2

1. Read the documentation of scatter.

2. Plot a scatter plot of the same data in [Link] with red diamond markers.

-
Assignment-3

1. Plot a log-log chart of y = 5x3 for x from 1-20.

-
Assignment-4

1. scatter(x, y, color=’blue’, marker=’d’) and plot(x, y, color=’b’, marker=’d’) does exactly the
same? ➢ True or False

-false

Common questions

Powered by AI

The function call scatter(x, y, color='blue', marker='d') creates a scatter plot with the specified color and marker, focusing on displaying individual data points with diamond markers ('d'). In contrast, plot(x, y, color='b', marker='d') connects data points with a line using the same markers. The underlying difference is in how data continuity and relationships are represented .

Log-log plots are advantageous for functions like y = 5x^3 because they linearize exponential relationships, making it easier to analyze and compare power-law distributions visually. In this form, the power of x becomes a slope on the plot, enabling clearer identification of proportional patterns .

A scatter plot displays individual points based on pairs of numerical values, emphasizing the distribution and relationship of data points, whereas a regular line plot typically connects data points in a series to emphasize trends over a continuum. Scatter plots are often better for observing correlations, outliers, and specifics of individual data differences .

When plotting data with error bars, it's important to ensure the error values are accurately calculated and represented, consider the scale of axes to correctly interpret the data, choose appropriate marker sizes and colors to maintain clarity, and ensure the error bars do not overlap significantly causing confusion .

Choosing marker sizes and types is crucial because they directly affect the readability of plots. Small markers can become invisible or indistinct when many data points overlap, while large markers may crowd the plot, obscuring data points and errors. Selecting appropriate markers helps accurately convey information without misrepresenting or overly simplifying the complexity of the dataset .

Assumptions affecting interpretation can include the accuracy and completeness of the provided data, potential external factors influencing profit that are not documented, and biases introduced by representing values as a scatter plot without additional context (e.g., economic conditions, market changes). These could skew perception towards identifying patterns or trends that may not exist .

To square a list of distance values like [2.1, 4.6, 8.72, 9.03], you can use a list comprehension in Python: squared_values = [x**2 for x in distance_values].

Assignment-1 requires plotting experimental data with large dots for certain data sets. In contrast, Assignment-2 specifies using small dots and additionally including error bars in the plot. This indicates different visual emphasis and data representation requirements .

In the instruction 'plot(l, t, 'r+')', 'plot' is a function that creates a 2D line plot, 'l' and 't' are data sequences for the x-axis and y-axis respectively, 'r+' indicates the plot style where 'r' is the color red for the plot lines or markers, and '+' specifies that markers should be plus signs .

To plot a log-log chart of y = 5x^3, you must first compute the logarithm of both x and y values. You can use functions such as numpy's np.log10() to transform these values to their logarithmic scale before plotting them on a log-log graph .

You might also like