<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: matplotlib, need float rather than int in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/matplotlib-need-float-rather-than-int/m-p/343153#M26864</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And if we can rotate the text 90 degrees as well, that would be even more awesome. Of course, I need to get the first item working first, but thought I would throw that out there.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 26 Apr 2018 15:55:48 GMT</pubDate>
    <dc:creator>ChrissyWhite</dc:creator>
    <dc:date>2018-04-26T15:55:48Z</dc:date>
    <item>
      <title>matplotlib, need float rather than int</title>
      <link>https://community.esri.com/t5/python-questions/matplotlib-need-float-rather-than-int/m-p/343152#M26863</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a matplotlib bar chart and I want to add the y-values to the bars themselves. I found some stuff on the web about how to get this done, but I am having an issue. My y-values are:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;SPAN style="color: #3d3d3d; font-size: 10.5pt;"&gt;2.76 3.95 6.22 7.23 9.51 10.69 11.11 11.65 11.82 12.11 13.37 14.04 15.11 15.44&lt;/SPAN&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But when I&amp;nbsp;use the following code:&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;for rect in rects:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; width = rect.get_x() + rect.get_width()/2.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; height = rect.get_height()&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; plt.text(width, height/1.5,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '%d' % float(height),&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ha='center', va='bottom', color='pink')&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The values that appear (and they do appear, so yay!)&amp;nbsp;in my bars are:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;2 3 6 7 9 10 11 11 11 12 13 14 15 15&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It seems that the get_height() function of matplotlib (.rectangle?) brings through an integer rather than a float, maybe? I have tried several different ways to get my full values to show, but all I ever get are the int values. How do I go about get the real values instead?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Apr 2018 15:17:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/matplotlib-need-float-rather-than-int/m-p/343152#M26863</guid>
      <dc:creator>ChrissyWhite</dc:creator>
      <dc:date>2018-04-26T15:17:34Z</dc:date>
    </item>
    <item>
      <title>Re: matplotlib, need float rather than int</title>
      <link>https://community.esri.com/t5/python-questions/matplotlib-need-float-rather-than-int/m-p/343153#M26864</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And if we can rotate the text 90 degrees as well, that would be even more awesome. Of course, I need to get the first item working first, but thought I would throw that out there.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Apr 2018 15:55:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/matplotlib-need-float-rather-than-int/m-p/343153#M26864</guid>
      <dc:creator>ChrissyWhite</dc:creator>
      <dc:date>2018-04-26T15:55:48Z</dc:date>
    </item>
    <item>
      <title>Re: matplotlib, need float rather than int</title>
      <link>https://community.esri.com/t5/python-questions/matplotlib-need-float-rather-than-int/m-p/343154#M26865</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;height &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1.51&lt;/SPAN&gt;

&lt;SPAN class="string token"&gt;'%d'&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;%&lt;/SPAN&gt; float&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;height&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="string token"&gt;'1'&lt;/SPAN&gt;

&lt;SPAN class="string token"&gt;'{: 3.2f}'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;float&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;height&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="string token"&gt;' 1.51'&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# --- put a variable in to make it cleaner&lt;/SPAN&gt;
label &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&amp;nbsp; &lt;SPAN class="string token"&gt;'{: 3.2f}'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;float&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;height&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

label
&lt;SPAN class="string token"&gt;' 1.51'&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: arial,helvetica,'helvetica neue',verdana,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; word-wrap: break-word;"&gt;put the label = line before this&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: arial,helvetica,'helvetica neue',verdana,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; word-wrap: break-word;"&gt;plt.text(width, height/1.5, label, &lt;/SPAN&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: arial,helvetica,'helvetica neue',verdana,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; word-wrap: break-word;"&gt;ha='center', va='bottom', color='pink')&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 16:10:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/matplotlib-need-float-rather-than-int/m-p/343154#M26865</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-11T16:10:59Z</dc:date>
    </item>
    <item>
      <title>Re: matplotlib, need float rather than int</title>
      <link>https://community.esri.com/t5/python-questions/matplotlib-need-float-rather-than-int/m-p/343155#M26866</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;PS &amp;nbsp; It is useful just to examine their gallery for code snippets... seeing what you want is sometimes easier&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://matplotlib.org/gallery/index.html"&gt;https://matplotlib.org/gallery/index.html&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Apr 2018 16:17:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/matplotlib-need-float-rather-than-int/m-p/343155#M26866</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2018-04-26T16:17:58Z</dc:date>
    </item>
    <item>
      <title>Re: matplotlib, need float rather than int</title>
      <link>https://community.esri.com/t5/python-questions/matplotlib-need-float-rather-than-int/m-p/343156#M26867</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Again, thank you so very much! You've been a life saver today. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Apr 2018 16:20:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/matplotlib-need-float-rather-than-int/m-p/343156#M26867</guid>
      <dc:creator>ChrissyWhite</dc:creator>
      <dc:date>2018-04-26T16:20:59Z</dc:date>
    </item>
  </channel>
</rss>

