# Polar Histogram JCF Cracks

Dear all,

I am plotting the polar histogram of cracks obtained using JCF in an dense aggregate.

However the polar histogram I am obtaining is not distributed over 360º, but only from 90 to 270º.

Here is the MWS:

import pylab # the matlab-like interface of matplotlib

pylab.ioff()

import numpy

import os.path

with open("cracks_

lines = f.readlines()

lines = [l.split()[7:10] for l in lines]

lines = [[float(v) for v in l] for l in lines]

angles = []

for a in lines:

norm1=a[0]

norm2=a[1]

norm3=a[2]

angles.

pylab.hist(

# polar histogram

pylab.figure()

## prepare data

values,

## prepare polar plot

pylab.subplot(

## plot bar chart, with the histogram data

### bins has one edge extra, remove it: [:-1]

pylab.bar(

pylab.show()

## Question information

- Language:
- English Edit question

- Status:
- Answered

- For:
- Yade Edit question

- Assignee:
- No assignee Edit question

- Last query:
- 2020-11-17

- Last reply:
- 2020-11-18

Jérôme Duriez (jduriez) said : | #1 |

Hi,

There is no reason to distinguish between n and -n for a contact normal. Polar representations spanning 180° are then just fine, you do need to cover the 360°.

PS: the "W" in "MWS" is obviously insincere ;-)

FileNotFoundError: [Errno 2] No such file or directory: 'cracks_shp.txt'

## Can you help with this problem?

Provide an answer of your own, or ask Luis Barbosa for more information if necessary.