The first line of IrisData.txt contains two integers. The first represents how many lines of data
are in the file. The second how many features are associated with each line. Each line after that
contains four floating point values representing the sepal length, sepal width, petal length, and
petal width of a type of iris flower, followed by the name of the iris type: either setosa,
versicolor, or virginica. Values are tab separated.Python Program
Write a Python program that will print out a two-dimensional plot of any two features for all
three varieties of iris flowers in the plot area of Spyder using the features of matplotlib.pyplot.
Your program should begin by asking for the name of the input file. For example (blue is user
response):Enter the name of your data file: Irisdata.txt
Then the program should prompt the user for two features to plot. For example, it could say:
You can do a plot of any two features of the Iris Data setThe feature codes are:
0 = sepal length
1 = sepal width
2 = petal length
3 = petal width
Enter feature code for the horizontal axis: 0
Enter feature code for the vertical axis: 1Once the program does a plot it should ask the user if they want to another plot. For example:
Would you like to do another plot? (y/n) yIf the answer is y, then the user should be prompted for new features to plot on the horizontal
and vertical axes as before and a new plot generated. N should end the program.Plots should be labelled with a title, axes should be labelled, there should be a legend and all
three varieties should be color coded and have different symbols. An example is shown below.
Your Python program should be named yourlastname_yourfirstname_P0.py, then zipped and
uploaded to Canvas.
Basic, matplotlib.pyplot, plotting, Project, python, solved, with
[SOLVED] Project 0: basic plotting in python with matplotlib.pyplot
$25
File Name: Project_0:_basic_plotting_in_python_with_matplotlib.pyplot.zip
File Size: 546.36 KB
Only logged in customers who have purchased this product may leave a review.
Reviews
There are no reviews yet.