Strange text in matplotlib window under Docker - docker

I'm running matplotlib in a Docker container on my MacBook. When I use plt.show(), it pops open the window on my screen and the figure I've created is just fine, but the text at the lower-left is gibberish (see example, below). How can I get it to show the usual x,y position of the cursor?
Some additional details:
It's a Centos 7 base docker image with our code layered on top. To keep the size down, we don't install the kitchen sink. Perhaps a package or two is missing?
The effect is observed no matter what I plot.
This is using matplotlib 2.0.2 installed via Conda.
The default backend (according to matplotlib.get_backend()) is apparently Qt5Agg.
I get a reasonable result if I use the TkAgg backend.
Qt5 is coming from Conda.

Related

Why does running fmask detection code give me wrong results when I run the script?

I used ubarsc's fmask scripts to detect clouds,shadows,water and snow in Sentinel satellite images. here is the repo link :https://github.com/ubarsc/python-fmask/blob/master/fmask/cmdline/sentinel2Stacked.py
But when I run script, I saw obvious mistakes in detection. For example the script detect shadows as snow. I am attaching the related images. Here is satellite image and its mask. the pink one is cloud, the blue one is snow and the yellow one is cloud shadows. But you can obviously see in here that the blue one is not snow it is cloud shadow. It is mislabeled. Is there anyone encounter this problem before and know the solution?
Thank you

Set WebCamera focus with OpenCv in Raspberry Pi

I have a logitech C920 Web camera.
I was able to follow this https://stackoverflow.com/a/42819965 to get the autofocus turned off and manually set the desired focus while I ran the python code on My Windows 10 pc. Also, I could see the changes in focus when adjusting value.
But when I tried to connect the same camera to Raspberry Pi (3 B+ ) and run the same code, for whatever the value of focus I set, it just doesn't respond. Same blurry images always.
What could be the possible reason for this?
Depends on the driver and/or video backend used by cv::VideoCapture.
You can try setting the focus directly with v4l2-ctl:
https://www.christitus.com/logitech-c920-linux-driver/

Octave only prints last line segment plotted

I am having trouble creating plot files with octave. When executing
imagesc([1,2,3],[1,2,3],[1,3,1;3,2,3;1,3,1]);
line([0,1,2,3,4],[1.5,1.3,1.7,1.5,1.9]);
print("test.pdf);
the bitmap image is displayed correctly in the plot window, with a wiggly line superimposed on top. But the .png file only shows the image from "imagesc", plus the last of the four segments drawn by the "line" command. This happens when printing to .png files as well.
I am using octave 4.2.1 on Windows 10, with the "qt" graphics toolkit. Changing toolkits to "fltk" effects no change, while going to "gnuplot" will trigger some error message about the "imagesc" command which I am currently not interested in.
Does anyone know how to get the file output right?
Adding a third dimension to the line coordinates solved my problem. I have implemented the following changes following a workaround found in bug report #51464 on savannah.gnu.org:
imagesc([1,2,3],[1,2,3],[1,3,1;3,2,3;1,3,1]);
line([0,1,2,3,4],[1.5,1.3,1.7,1.5,1.9],[4,4,4,4,4]);
zlim ([0 4]);
print("test.pdf");

How do i turn layer visibility off for specific layers in a .PSD file using image magick

I am writing a program to check layer visibility on specific layers and if they are visible turn the visibility off. I have all of it working except for being able to turn the layers off. In order to do so I am trying to use image magick version 6.8.8.
In my attempts to figure this out I have found that it seems the Compose attribute of the layers is responsible for determining the visibility of the layer. When the layers are turned on the compose value is 'Over' and if the layer is off Compose is set to 'None'. I tried using the following command to modify this value from over to none to turn the layers visibility off:
mogrify.exe -set compose None test.psd
The command appears to run fine, it doesn't throw any errors. However, when reopening the file it seems as though nothing changed. I have also tried adding in [layer#] to the end of the source file to operate on the specific layers I wanted to change and it still did not turn the layer off. In addition I have tried all manner of quoting both the parameter and the attribute name to no avail.
While I remain unable to turn the layer off I do seem to be able to turn a layer's visibility on. By using the command:
mogrify.exe +set compose test.psd
This command uses the +set operator which resets the specified attribute to its default value. In a PSD file layer visibility's default is on and running this command did appear to turn the layers that were off on as it is their default. So from what I can see this is an editable field but I can not seem to be able to change it in my attempts.
Does anyone know of an image magick command which will allow specific layers visibility to be toggled to off in a PSD file.

Extra vertical bar when rendering subscript using inline Latex in iPython Notebook

So, I'm trying to get the hang of using inline Latex in iPython Notebook, and I get a funny rendering of even the simplest of code to just add a subscript:
code in my markdown cell: The slope $J_1$
renders like this:
I notice that when I first open the notebook, as the page is loading, the subscript displays properly (no vertical bar) but only briefly, but when the page is fully loaded, the rendered result changes and shows the vertical bar. The font appears to change in that process as well.
I've also downloaded other people's notebooks that use inline Latex, which look fine when viewed with the Jupyter nbViewer online;
(for example, http://nbviewer.jupyter.org/github/rszeto/umich-eecs545-lectures/blob/master/lecture02_linear-algebra-optimization/Lecture%202%20-%20Linear%20Algebra%20and%20Optimization.ipynb renders fine, but if I download the notebook and look at it with my local Jupyter viewer, I see the same vertical bar thing happening for subscripts in the Latex bits of the notebook)
I'm running iPython ver 4.0.1, viewing the notebook using Chrome (Version 48.0.2564.109 m) running on Win 7.
Is there a fix to render things properly? I don't see the vertical bar problem when I open the notebook using Internet Explorer.

Resources