How to get matplotlib figure size

For a project, I need to know the current size (in pixels) of my matplotlib figure, but I can’t find how to do this. Does anyone know how to do this ? Answer import matplotlib.plt fig = plt.figure() size = fig.get_size_inches()*fig.dpi # size in pixels To do it for the current figure, fig = plt.gcf() … Read more

How to Get Pixel Color in Android

I’m using Intent to call and show an image from Gallery, and now I made it enable to get me the coordinates of the image in a TextView using these: final TextView textView = (TextView)findViewById(R.id.textView); final TextView textViewCol = (TextView)findViewById(R.id.textViewColor); targetImage.setOnTouchListener(new ImageView.OnTouchListener(){ @Override public boolean onTouch(View v, MotionEvent event) { // TODO Auto-generated method stub … Read more

Get pixel’s RGB using PIL

Is it possible to get the RGB color of a pixel using PIL? I’m using this code: im = Image.open(“image.gif”) pix = im.load() print(pix[1,1]) However, it only outputs a number (e.g. 0 or 1) and not three numbers (e.g. 60,60,60 for R,G,B). I guess I’m not understanding something about the function. I’d love some explanation. … Read more