YES! Thanks to EVERYONE who took a look at this, MORE EYES is better than TWO! ;-)
Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Best posts made by mtrevino57
-
RE: Help with Menu/window for Pythonista..
-
RE: Help with Menu/window for Pythonista..
GOT IT! The ValueError was related to how I was loading the image. And I once I got the columns and size right(Thanks brumm), it works.
-
RE: Help with Menu/window for Pythonista..
@Phuket2@Webmaster4o, will do. Right now I am the only one using this particular script that generates these gauges, but there are times when it would be helpful to send alerts with graphics included. Will post followups here
Latest posts made by mtrevino57
-
RE: Help with Menu/window for Pythonista..
YES! Thanks to EVERYONE who took a look at this, MORE EYES is better than TWO! ;-)
-
RE: Help with Menu/window for Pythonista..
GOT IT! The ValueError was related to how I was loading the image. And I once I got the columns and size right(Thanks brumm), it works.
-
RE: Help with Menu/window for Pythonista..
@brumm, Thanks!!!
You are Correct, as far as the size of the final image, it would be 1256. When pasting I would start a 0,314,628,942 for the x-axis and the four across should work. I am still getting the cannot determine the region size. HOWEVER!!! I am getting closer, now am able to save the plots to files, so eventually I should be able to create a gridded image and paste the files back into it. Seems a bit redundant since all I really want to do is paste the current figure/plot into a 4x3 grid. Getting the math correct on figure size, I am left with the ValueError: cannot determine region size; use 4-item box. -
RE: Help with Menu/window for Pythonista..
Any chance there is a file with Posting guidelines/tips somewhere that I missed?
-
RE: Help with Menu/window for Pythonista..
Okay using PIL, have the following in Pythonista on the Iphone, and it works great to display projects one at a time.
i=0 # set ii,jj for creating 4x3 gridded image with all projects ii=0 jj=0 # create a grid to hold project status images grid_image = Image.new('RGB', (942,792),'white') thumbnailsize = 314,264 #print Image.getbbox(grid_image) print "\f\a" .... ....code for generating charts was here .... #--------------------------------------- ## setup for gauge plot fig, ax = plt.subplots() # ax = plt.subplots() ax.axis('equal') # Width of the "rings" (percentages if the largest "radius"==1) width = 0.2 kwargs = dict(colors=['#FFFFFF', '#FFFFFF', '#0077be',"#FFffFF"], startangle=0) kwargs_outer = dict(colors=['#FF0000', '#FFFF00', '#0000FF',"#FFffFF"], startangle=0) # outside, _ = ax.pie([spspc,fpspc,cpspc,totspc], radius=1, **kwargs_outer) inside, _ = ax.pie([totspc-resspc,0,resspc,totspc], radius=1-width, **kwargs) # Set the edgecolor to match background to hide "Pie Chart" plt.setp(outside,edgecolor='white') plt.setp(inside,edgecolor='white') # set size of plot - this size works best on Iphone 5 Screen... fig.set_size_inches(4.75,4) labeltext= globals()[stcode[i]].Name +" on "+cdate+"\nStorage: "+str("%.2f" % float(storelev2[0]))+" AF\nElev: "+str(elevnow)+" ft @"+lasttime+"\nis "+str("%.2f" % cspace)+" ft below top of\n"+str(cpool[2])+": "+str(cpool[1])+" ft" # check which pool is active to set colors for bounding box. if cpool[2]=='CONSERVATION Pool': kwargs1 = dict(size=20,color='white',va='center',ha='center') ax.text(0,-.75,labeltext,bbox=dict(facecolor='blue',edgecolor='none'),fontsize=20,**kwargs1) elif cpool[2] == 'FLOOD Pool': kwargs1 = dict(size=20,color='black',va='center',ha='center') ax.text(0,-.75,labeltext,bbox=dict(facecolor='yellow',edgecolor='none'),fontsize=20,**kwargs1) elif cpool[2] == 'SURCHARGE Pool': kwargs1 = dict(size=20,color='white',va='center',ha='center') ax.text(0,-.75,labeltext,bbox=dict(facecolor='red',edgecolor='none'),fontsize=20,**kwargs1) else: ax.text(0,-.75,labeltext,fontsize=20) #display gauge with text plt.show() #--------------------------------------- # add plt to grid g_img=fig grid_image.paste(g_img, (ii,jj)) ii+=314 if ii==942: ii=0 jj+=264 #--------------------------------------- i+=1 grid_image.show()
I must be missing something, BUT if I understand this, the actual plot is stored in fig, and the size of each gauge is 314 x 264 based on saving images on iphone and looking at properties, so for a 4x3 grid the new image would be 942x792. When I run the program, I get the ValueError: cannot determine region size; use 4-item box error. I have seen plenty of examples for opening an existing image file and pasting that to a second image, but apparently I am missing something with trying to save the gauge "fig" which is displayed using plt.show(). Suggestions?
-
RE: Help with Menu/window for Pythonista..
Plan B, Looking at StatusBoard I am thinking it would be better to to merge the gauges into a single image which could then be posted to Twitter. I am thinking I would need to use Canvas but if there is a simple way, I am all ears. The final image would look something like the following
-
RE: Help with Menu/window for Pythonista..
@Phuket2@Webmaster4o, will do. Right now I am the only one using this particular script that generates these gauges, but there are times when it would be helpful to send alerts with graphics included. Will post followups here
-
RE: Help with Menu/window for Pythonista..
Just downloaded Status Board and think it will work well for Ipad. I am running this script on my iphone which generates the gauges and I am pretty sure I can save them to dropbox. Will be working to create a Status Board which pulls these images into a status board on the ipad and could share it from there. Interesting Thanks again!