I don’t have a good reason for using one or the other. You could also instead of starting from the matplotlib objects start from the pandas dataframe methods (as I did in my prior histogram post). After defining my figure and axis objects, I add on the ax.scatter by pointing the x and y’s to my pandas dataframe columns, here Burglary and Robbery rates per 100k. My_dir = r'C:\Users\andre\OneDrive\Desktop\big_scatter'Ĭrime_dat = pd.read_csv('Rural_appcrime_long.csv')įirst, lets start from the base scatterplot. I technically do not use numpy in this script, but soon as I take it out I’m guaranteed to need to use np. So first for the upfront junk, I load my libraries, change my directory, update my plot theme, and then load my data into a dataframe crime_dat. Here you can download the dataset and the python script to follow along. customizing a template, adding legends, etc.)įor this post, I am going to use the same data I illustrated with SPSS previously, a set of crime rates in Appalachian counties. Notes on making matplotlib and seaborn charts (e.g.I made some ugly scatterplots for a presentation the other day, and figured it would be time to spend alittle time making some notes on making them a bit nicer.įor prior python graphing post examples, I have: My current workplace is a python shop though, so I am figuring it out all over for some of these things in python. Many of my programming tips, like my notes for making Leaflet maps in R or margins plots in Stata, I’ve just accumulated doing projects over the years.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |