graphing with matplotlib pyplot in this graph each dot represents the amount of time people of different ages spend on three different activities the program that was used to generate the above graph is shown belowimport matplotlib pyplot as pyplot create data riding (( )( )swimming (( )( )sailing (( )( )plot the data pyplot scatter( =riding[ ] =riding[ ] ='red'marker=' 'label='riding'pyplot scatter( =swimming[ ] =swimming[ ] ='green'marker='^'label='swimming'pyplot scatter( =sailing[ ] =sailing[ ] ='blue'marker='*'label='sailing'configure graph pyplot xlabel('age'pyplot ylabel('hours'pyplot title('activities scatter graph'pyplot legend(display the chart pyplot show(in the above example the plot scatter(function is used to generate the scatter graph for the data defined by the ridingswimming and sailing tuples the colours of the markers have been specified using the named parameter this parameter can take string representing the name of colour or two dimensional array with single row in which each value in the row represents an rgb color code the marker indicates the marker style such as 'ofor circlea '^for triangle and '*for star shape the label is used in the chart legend for the marker other options available on the pyplot scatter(function includealpha indicates the alpha blending valuebetween (transparentand (opaque