<div dir="ltr"><div class="gmail_default" style="color:#000000"><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jun 20, 2014 at 10:27 AM, Jamie Mitchell <span dir="ltr"><<a href="mailto:jamiemitchell1604@gmail.com" target="_blank">jamiemitchell1604@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div><div class="h5"><br>
</div></div>That's great Jason thanks for the detailed response, I went with the easier option 1!<br>
<br>
I am also trying to put hatches on my histograms like so:<br>
<br>
plt.hist(dataset,bins=10,hatch=['*'])<br>
<br>
When it comes to plt.show() I get the following error message:<br>
<div class="gmail_default" style="color:rgb(0,0,0);display:inline">[snip]</div><br>
File "/usr/local/sci/lib/python2.7/site-packages/matplotlib-1.3.1-py2.7-linux-x86_64.egg/matplotlib/path.py", line 888, in hatch<br>
hatch_path = cls._hatch_dict.get((hatchpattern, density))<br>
TypeError: unhashable type: 'list'<br>
<br>
Do you have any idea why this is happening?<br></blockquote><div><br></div><div class="gmail_default" style="color:rgb(0,0,0)">lists are mutable types, so they are not hashable (and therefore cannot be used as dictionary keywords). You need an immutable type (which _is_ hashable) to act as a dictionary key. Like strings, tuples, and basic number types (int, float, etc.).</div>
<div class="gmail_default" style="color:rgb(0,0,0)"><br></div><div class="gmail_default" style="color:rgb(0,0,0)">The hatch should be a string (allowable symbols are given in the API documentation). So try</div><div class="gmail_default" style="color:rgb(0,0,0)">
<br></div><div class="gmail_default" style="color:rgb(0,0,0)">plt.hist(dataset, bins, hatch='*')</div><div class="gmail_default" style="color:rgb(0,0,0)"><br></div><div class="gmail_default" style="color:rgb(0,0,0)">
HTH,</div><div class="gmail_default" style="color:rgb(0,0,0)">Jason</div><div class="gmail_default" style="color:rgb(0,0,0)"><span style="color:rgb(34,34,34)"><br></span></div><div class="gmail_default" style="color:rgb(0,0,0)">
<span style="color:rgb(34,34,34)">-- </span><br></div></div><div dir="ltr">Jason M. Swails<br>BioMaPS,<br>Rutgers University<br>Postdoctoral Researcher</div>
</div></div>