When a matplotlib figure is shrunk below a given size, the controls on the bottom disappear. I want to save the figure, at the size that I have stretched it too, but it seems that I cannot, because the save button disappears when the figure is that small. Is there any way around this, other than manually calling fig.savefig() in the code?
Edit: Backend is TkAgg
Ah, well it turns out there are keyboard shortcuts to the controls.
You can press CTRL-S to save (even on Mac - not Command-S).
The full list of shortcuts is here: https://matplotlib.org/users/navigation_toolbar.html
When using "Qt4Agg" or "Qt5Agg" as backend,
import matplotlib
matplotlib.use("Qt4Agg")
the navigation toolbar can be extended with the two small arrows as shown below.
Related
I have a matplotlib figure with tooltips on the point markers:
And the zoom in/out is working:
However after the zoom in/out is performed the tooltips no longer function: and even restoring the original (non-zoomed) size they do not come back.
If you use the pan-and-zoom tool (crossed arrows icon), tooltips should remain unchanged after zooming. If you use the box zoom (magnifier icon), while box zoom is active, the tooltips are turned off. The tooltips should appear again after clicking the box zoom magnify icon a second time to deactivate it.
Perhaps this UI could be clearer.
Here is scatter plot with tooltips example you can use to see this in action.
There is a tool button and a textctrl in the toolbar. I'm trying to expand the textctrl in the horizontal direction to fill all the remaining space.
wxSizer maybe a good choice but it seems not suitable with toolbar because I can't add tool button directly in a sizer.
There is no built in support for this, you will need to handle wxEVT_SIZE (either in the toolbar itself or in the frame containing it, as the size of the toolbar only changes when the size of the frame does), compute the available size (which is going to be tricky, there is no function to find this out neither so I expect you'd have to do some kind of binary search using wxToolBar::FindToolForPosition()) and resize your text control.
It would definitely be much simpler to put both the toolbar and the text in a sizer instead. But it's true that it wouldn't appear quite the same, so if you really want to have the text-inside-toolbar appearance, you would have to do the above. Good luck!
I'm making a full screen application in visual basic and is having some issues with full screen and control resizing.
I've looked around both google, stack overflow and youtube for answers but none seems to be working for me. What I have worked my way to is that i need to use anchor or docking or something like that if I am not all incorrect
Edit:
Picture examples:
The main window in my editor.
When the program runs in maximized screen
Resolution of the program is 800x600 as its going to be made for a screen with that resolution.
You probably want to use anchor points. You can anchor a control to any side, all sides, or any combinations of sides in its container (the form, usually). When the form is resized, the control is automatically sized accordingly. You can also use the form's resize event and change the size or location of the controls manually when the form size changes.
I'd like to create a toolbar item like the central item seen in Xcode/iTune/Instruments/etc:
Can anyone tell me what it's called and how to go about creating my own?
Also, will I face problems getting my app approved by Apple when I submit it to the Mac App Store, for imitating Apple's own apps too much?
I finally implemented the solution from here:
iTunes or Xcode style information box at top of window
Here are the initial results:
This is an Apple's private control, but you cannot create it as a NSToolbarItem. Check this other Q/A to know how to add a custom view in the window's main frame.
Is it possible to draw in the label area of NSToolbar?
I've noticed some interesting things about Instruments:
If you make the window narrow such that the overflow menu is triggered, the items in that menu are all blank.
You can't change the icon size or turn labels on/off.
Colors does not have a label when you add it to the toolbar.
The labels on Space, Flexible Space, and Colors do not line up with the other items' labels.
These are interesting because they seem to fit an idea I had for implementing this: turn labels off, and give all your items custom views, where normal-looking items actually have manually drawn labels. It would obviously be a lot of work, but it gives you enough freedom to effectively do full-height items.
The nice thing is that, unlike the view/window hack that Xcode seems to use, you still have a customizable toolbar with draggable items.
I'm using a webview to display a PDF.
The webview displays the PDF at it's actual size which is a little smaller than the size of the webvieww itself, revealing the scroll view underneath it.
I've tried setting the Webview to opaque and setting it's background color to another color, which works fine and dandy in the simulator, but fails to change the color on the device. On the device it changes the color of the background of the view behind the scroll view, this can be seen when the PDF is pulled all the way down.
I've also tried setting all the UIView's backgrounds, by iterating through the subviews but to no avail.
I've updated a diagram to help illustrate which area I'd like to color.
Uploaded Diagram
You really shouldn't mess around with UIWebView's internals.
They can change anytime and your code might just crash on the next version of iOS.
If you need more control about pdf display, you might wanna take a look at other possibilities to show pdf, like using the CGPDFDrawPage* functions. Of course they are pretty low-level and it's a lot of work required until you can get fast page display, zooming, etc all right.