Plot a scatter plot in python with matplotlib with dictionary -
I need help plotting a dictionary, data sample data is set below. I want to make a scatter graph Where x: y (x, y) coordinates and title 'x' will be the legend of graph. I want to create a graph below the data set so that all the data is added to a graph. For example: {x: y, x: y}: In the red (or any other color): Title (or whatever color) is for title 1, P>
Title 2: {X: y, x: y} (in a different color) .... and so on.
Any help would be greatly appreciated Thank you.
data = {'title1': {x: y, x: y}, title 2: {x: y, x: y, x: y}, 'title3': { X: y, x: y} ....} I also followed this advice, but it was for the individual graph.
That is what I have tried, I do not have much experience in matplotlib and nothing can be found useful. Any help will be very much appreciated.
Import as plt import nppy NP D as matplotlib.pyplot = { '5000cca234c1c445': {382877: 7, 382919: 3}, '5000cca234c94a2e': {382873: 1 , 382886: 1}, '5000cca234c89421': {383173: 1, 383183: 2, 382917: 1, 382911: 1}, '5000cca234c5d43a': {382889: 1, 382915: 1, 382917: 8}, '5000 cc 234 C 56488 ': {38290 9: 2, 382911: 5}} xval = [] yval = [] ttle = [] data_dict print D, d.iteritems () for the title: x = data_dict.keys () #print 'Headline is', Title # Printing 'print x value', xxval = xvl + x print xval y = data_ dict.values () yval = yval + y ttle.append (title) print just print # print 'value' ', Y #plt. Figure () Print Axel Print Jawal Print TLT Plat Seater (excel, uval) plt.show ()
can try, and the narrative thereafter, something like:
Import matplotlib.pyplot as plt d = { '5000cca234c1c445': {382877: 7, 382919: 3}, '5000 CCA 234 C-94 A2': {382873: 1, 382886: 1}, '5000cca234c89421': {383173: 1, 383183: 2, 382917: 1, 382911: 1}, '5000cca234c5d43a': {382889: 1, 382915: 1, 382917: 8}, '5000cca234c56488': {38290 9: 2, 382911: 5}} data = Colors.pop ()) plt.legend (d.keys ()) plt.show () < / Code>
Comments
Post a Comment