Assignment- plotting-1
Create a single pdf file with question and output and share it in group. File name rollno-name
1.Create a matplotlib plot with two lines representing the
functions y=sin(x) for
0≤x≤2π (use a solid line) and y=cos(x) for 0≤x≤2π (use a
dashed line).
Customize the plot by adding appropriate ticks, labels for
the x and y axes, and a
legend to distinguish between the two functions. Set the
title “RollNo Name”.
2.Plot the function y=x^2 and y=sig(x) as two separate
graphs with suitable legends, labels and a Title with your roll number and name.
Lean about sigmoid function. Popular function used as activation function in
machine learning
https://en.wikipedia.org/wiki/Sigmoid_function
3.Write a Python program to plot the bar graph to depict the popularity of various programming languages. Label the graph with x-axis, y-axis, x-ticks,y-ticks, legend and title your roll number and name.
Data :
Programming languages: Python, C++, Java, Perl, Scala, Lisp
Usage= 10,8,6,4,2,1
4.
x = np.arange(1,101)
y=np.random.randint(1, 101, size=100).tolist()
learn the two functions in numpy arrange(1,101) which will
generate numbers 1,2,3,….,100 and radom.randint(1,100,size=100) which will
generate 100 random between 1 and 100( both inclusive).
Use these x and y values to plot a scatter plot(popular plot
for data analysis)
plt.scatter (x,y,size) , where size is the size of dots used in
plotting, change it with your roll number. Set the title with your name.
Comments
Post a Comment