I'm using PyQt5 (5.13.1) in python 3.7.4
I'm using macos for now (10.14.5) on an imac with one retina display and one non-retina display
I'm plotting a graph using matplotlib inside a scroll area
I've encountered a strange issue. I do not know if posting any code would be useful, but if you think some specific code will help, please let me know what code and i'll post.
here is the weird issue:
On the non-retina monitor, everything works fine. I can scroll up and down and see my graph and other scroll content. When I save the scroll area widget to an image, it is nice. All content is there. But, of course the resolution isn't great because it's the non-retina display.
On the retina monitor, as I scroll down, the bottom of the graph starts to disappear. and more disappears the more I scroll. The saved image looks exactly the same: whatever has disappeared on the screen is actually missing in the image (even though saving the whole scroll area should not do that, and in fact this error does not happen on the non-retina monitor or for content on the retina monitor that is not the matplolib graph. So, just to be clear, the issue is that matplotlib graphs seem to disappear at they are scrolled on my retina monitor.
As you can see from the images, the part of the graph that disappears starts at the bottom, not the part that is no longer visible because of scrolling.
scroll window on non-retina display. no problems
after dragging window to retina display, the bottom of the figure (from the x-axis) begins to disappear
So, does anyone know about this matplotlib issue? is there a setting that I seed to implement?
Related
I have tried a bunch of stuff over the last few months to only find the best way is as per the attached image which is to use a fixed container in the window to then carry on as per normal but it then makes it hard to have everything else resize properly.
Just curious if there would happen to be a better way to have the drawing area behind everything else to draw on with out having to use a "fixed" container.
In trying over the last few months if I use say a table then put a drawing area in it fills on of the boxes which is not how i feel it should work for what i am trying to do.
I have found it hard as if i try to resize the window I then have to resize the "fixed" container which is ok but if I try to make the window smaller by the bottom right corner it will not resize, I got round this by hard coding a window size and linking this to a button to "minimize" the window correctly.
If anyone has any pointers to information or has any help to offer that would be great.
If nothing comes up I guess I will keep trying to make it happen as I have worked out so far and have a minimum window size and maximum window size with maybe a x/y input box to customize the window size if required.
I imagine this is a simple question and was hoping it someone would be able to help me figure it out. I have multiple wxpython sliders in my GUI but some of them have black boxes around.
The sliders are placed inside a StaticBox which is placed inside ScrolledPanel. It seems that those that are on top (i.e. are shown without the need to scroll the panel) look normal, as for the 'Annotation font size' but the ones that were hidden have black background behind it. Anyone has any ideas?
I thought it was because I was not calling Layout() but it doesn't make any difference.
I managed to fix this problem on my side. Maybe it helps you too. In my case, I have a lot of text boxes and sliders on a scrolled panel (wx.lib.scrolledpanel.ScrolledPanel):
Black boxes around sliders:
I am fixing it by setting the background color of the panel after I have finished populating it with graphic elements:
self.SetBackgroundColour('WHITE')
Here is the result:
No more black boxes around sliders:
I am using IPython Notebook to make some plots. For most of them I use
%matplotlib inline but for a few I change to %matplotlib notebook to be able to zoom in and stuff like that.
Now to the problem, the window displaying my plot (independent of what matplotlib setting I am using) suddenly became much smaller. Not the figure itself, just the window. I am really confused why this happened, if it was beacause I was switching between the two matplotlib settings or something else I made by mistake.
It is really annoying since I have to scroll in the window to se my whole figure unless I want to minimize it a lot. So if you have any idea how to make the plot window larger, please enlighten me.
Here you can se an example of what I mean by window: Small window. The 'window' according to me is where you can see "Figure 1" and the red button and ends where it cuts my plot.
Click to expand fully and show smaller. Double click to completely collapse it.
I am using wxPython's DataViewCtrl to display some data. On the first column I am displaying an icon using AppendIconTextColumn. The problem is that the icon is shifted to the right and the right portion of the icon is cut off. I have tried using the flag align=ALIGN_LEFT, but that has no affect.
It seems that there should be more options for configuring a cell. Like changing the background color or aligning images.
Can someone please show me how I can move the icon in the cell?
Thank you so much.
wxPython 2.8.10, Python 2.6.2, Windows 7 x64
So I am having a bit of a wxPython issue I am hoping someone can say where I am going wrong. In my application I have Sliders where the background colour changes as you move the slider around. I do this via SetBackgroundColour from within a EVT_SLIDER handler. It mostly works, but I end up with a border of unchanged colour around the outer edge of the widget.
I have tried Refresh up the chain, RefreshRect on the top level Frame around the widget (and a few pixels further out), various combinations of Update and Layout, but nothing seems to erase it. The best I have managed is if I use something like:
frame = wx.GetTopLevelParent(slider)
rect = slider.GetRect()
slider.ClearBackground()
slider.SetBackgroundColour(wx.Colour(red,green,blue))
frame.RefreshRect(rect)
It will correctly draw the background box with the new colour without the border issue, but it will not repaint the slider itself.
However, if I click away so the focus is elsewhere, the border snaps to the new colour.
I could probably use an overlay or custom paint function but I am hoping there is something I am missing here that will get me the desired results.
Any suggestions?
(edited to add)
Looks like resizing the window manually corrects the issue, but Layout() does not.
It also functions correctly if you do the client size trick:
w,h = slider.GetClientSize()
slider.SetClientSize( (w+1,h) )
slider.SetClientSize( (w,h) )