How to plot hexagon to represent scores on ArcMap? - arcgis

I want to plot hexagon to represent each point's scores in different aspects and show it on the map. Each score will be saved in the data table. How to plot them? Or are there any symbol which can has same effect like hexagon?

Related

Why do we use crs.PlateCarree() instead of crs.Geodetic() when using Matplotlib and Cartopy to plot a map based on lat and lon?

I've been learning how to use Cartopy and Matplotlib to plot map. But I have a question regarding the argument transform. According to the Cartopy document, transform specifies "what coordinate system your data are defined in". Suppose I am going to plot temperatures of an area, and the area has been split into several grid cells. Each grid cells has a corresponding coordinate defined in lat and lon (Geodetic Systems). Based on the Cartopy document, I need to use crs.PlateCarree() instead of crs.Geodetic(). I'm a bit confused about it. Because,I think the PlateCarree is a way of projection. In other words, coordinates defined in PlateCarree projections are projected data. But latitude and longitude should be unprojected data. Can anyone help me with it? Thanks!

Color scheme for a 2D matrix where near points are colored similarly

I have a 2D matrix of 2-tuples representing x,y coordinates which I plot using plt.scatter(), resulting in a square grid of points. I'd like to color all points in different colors in such a way so nearby points (Euclidean or Manhattan distance, doesn't really matter) are colored in similar colors, while taking advantage of a wide as possible range of colors for the whole grid (so points in general are as distinguishable as possible). How can this be achieved?

How to plot histogram where a country is a bin

I am attempting to plot a histogram where the y-axis should be the count and the x-axis (i.e. the bins) should be composed of all the countries, but I cannot seem to figure out the code.
I have tried following https://datasciencelab.wordpress.com/tag/pandas/ and How to create Histograms in Panda Python Using Specific Rows and Columns in Data Frame, but both of those are for bar graphs and not for histograms.
per_country = df.groupby(['COUNTRY'])[['TOTAL']].sum()
per_country = per_country.sort_values('TOTAL')
per_country.head()
medals_per_country['TOTAL'].plot(kind='hist') # if hist is changed to bar, then it works, but I need a histogram and not a bar graph
The result should be a histogram where the x-axis includes a label for each country and the y-axis is the total for each country. Right now the bins are just based on the 'TOTAL', whereas the y-axis is the number of countries with said 'TOTAL'.
Can someone please point me in the right direction? Thank you!

How to adjust Pixel Spacing and Slice Thickness in DICOM data?

I have a large dicom mri dataset for several patients. For each patient, there is a folder including many 2d slices of .dcm files and the data of each patient has different sizes. For example:
patient1: PixelSpacing=0.8mm,0.8mm, SliceThickness=2mm, SpacingBetweenSlices=1mm, 400x400 pixels
patient2: PixelSpacing=0.625mm,0.625mm, SliceThickness=2.4mm, SpacingBetweenSlices=1mm, 512x512 pixels
So my question is how can I convert all of them into {Pixel Spacing} = 1mm,1mm and {Slice Thickness = 1mm}?
Thanks.
These are two different questions:
About harmonizing positions and pixel spacing, these links will be helpful:
Finding the coordinates (mm) of identical slice locations for two MR datasets acquired in the same scanning session
Interpolation between two images with different pixelsize
http://nipy.org/nibabel/dicom/dicom_orientation.html
Basically, you want to build your target volume and interpolate each of its pixels from the nearest neighbors in the source volumes.
About modifying the slice thickness: If you really want to modify the slice thickness rather than the slice distance, I do not see any chance to do this correctly with the source data you have. This is because the thickness says which width of the raw data was used to calculate the values for a slice in your stack (e.g. by averaging or calculating an integral). With a slice thickness of 2 or 2.4mm in the source volumes, you will not be able to reconstruct the gray values with a thickness of 1 mm. If your question was referring to slice distance rather than slice thickness, answer 1 applies.

How to clip and assign points to individual polygons of shapefile

I'm in a little over my head on this one. I have approximately 300 shapefiles containing about 7000 polygons, each of which I'm trying to clip a systematic grid of points. Each shapefile has a unique number of polygons (buffers around a point location) and I need to have the grid points assigned to each polygon so that they can be recognized as discrete sets later on.
For example, polygon 1 in shapefile 1 will have a set of grid points associated with it. Polygon 2 in shapefile 1 will have another set of grid points, including many that may be the same as those in polygon 1. I would need an attribute field that identifies those points as belonging to that polygon. If it helps, this is for a discrete choice model being applied to resource selection. Any help is greatly appreciated!
Image: Polygons with grid points.
Image: Single shapefile containing polygons
Using Intersect should connect the two layers in a new feature class with one attribute table.
You can also try Spatial Join which will ad the table of one layer to the table of the other according to location.