How to reduce white space in octave legend function - octave

I have build some algorithm and now I should make things pretty enough for presentation. Only problem what I have is a "strange" legend behaviour in octave. I dont know if the problem is because I am using "subplot" function, but I have tried several ideas what was possible to find on google, but none of that really works.
At the uploaded picture we can see that diagram lines names are moved all the way to the left (nothing wrong with that), however there is too much space on the right side of the line names. The legend box is simply too big for the context inside. I have tried already with reducing the size of the font, but is not the best solution.
Can somebody please provide some solution for my problem. My current code status is:
hleg1 = legend({"sample1", "sample2", "sample3"});
set(hleg1, "FontSize", 8);
I currently using Octave version 5.1.0 on windows 10 x64.

The fix for me was te execute the plotting script twice.
The first time you resize the window in full screen mode.
Then you execute the script again (without closing the figure window)
Now legends should not take half the space of your plot ;)

Related

Border behaviour when drawing a rectangle in Pygame

I'm following a Pygame tutorial on YouTube published by Clear Code. So far it's gone well but I've run into an inconsistency between the demo on the video and the behaviour of my code, I'm pretty sure I'm doing exactly what the tutorial instructs, but my results are different.
I'm attempting to draw a border around a rectangle, the rectangle was created from a surface that contains some text as follows.
test_font = pygame.font.Font('font\Pixeltype.ttf',50)
score_surf = test_font.render('My Game', False, 'Black')
score_rect = score_surf.get_rect(center = (400,50))
#Later in the main loop
pygame.draw.rect(screen,'Pink',score_rect)
pygame.draw.rect(screen,'Pink',score_rect, 6)
My understanding is that the first pygame.draw.rect should colour in the area of the score_rect, and the second should create a border that goes slightly outside the area of the score_rect. This should leave a bit of pink visible all the way around the text. In the video I can see this happening, but when I run the code on my system the second pygame.draw.rect that specifies a border width doesn't seem to have any effect.
I've experimented a bit by removing the first pygame.draw.rect, this works mostly as expected I get a pink rectangular border around my text, but this border is strictly insisde the score_rect.
According to the Pygame documentation specifying the width argument should cause the border to go slightly outside the score_rect. However I'm not seeing this behaviour.
Link to Pygame documentation I'm reading
https://www.pygame.org/docs/ref/draw.html#pygame.draw.rect
Link to Youtube video I'm following, and location in video
https://youtu.be/AY9MnQ4x3zk?t=4879
Edit: Sorry I forgot to note my software versions
Pygame: 2.1.2
Python: 3.10.2
OS Windows 10
Any help would be appreciated.
I've come across people asking this exact question on other sites (not in a way that's very searchable, don't worry), so I'm mainly copy pasting my last answer.
In a recent version of pygame, draw.rect was changed to give "actual rectangles." This has an advantage of looking cleaner in many situations, and the algorithm for them is now significantly faster, helping performance.
I actually talked to someone with your exact same issue (like coming from the same tutorial) on discord, and we decided to use a rect.inflate() call to grow the rectangle out before drawing it behind the text.
For example, you could do something like
pygame.draw.rect(screen, 'Pink', score_rect.inflate(10,10))
Instead of both Clear's rect calls.
Or if you want to preserve the slight corner rounding you could do
pygame.draw.rect(screen, 'Pink', score_rect.inflate(10,10), border_radius=3)
So this just uses the return value of a Rect.inflate call instead of the original Rect itself. Inflate takes an x margin and a y margin, and returns a Rect larger/smaller by those amounts, but still centered in the same location.

Is there any work around for Sikuli IDE image replacement?

I am using Sikulix for UI testing, the problem is that when ever there are changes in UI I need to replace all the images which got changed using the IDE and I need to again describe the actions ( accuracy, click position) which is becoming a sort of overhead in my case. Is there any work around by which I can simply replace the new UI images in the project folder with the same old name ( It wont work directly as the new coordinates might be different + the new image should be of same resolution that of older one)
PS: I have completely understood that sikuli works at pixel level, but still curious to find out if any one has found a work around.
Unfortunately, you will need to recreate the images. What could make it a bit easier, is if you had more descriptive names than the ones generated by Sikuli IDE automatically. Keep in mind these are just image files stored on your PC. If you have names like button1.png, button1.png, etc.., it will make your life easier.
This may or may not work for you depending on your project development:
In my case, the changes that occur at times reduces the image similarity from say 0.9 defined to ~0.7. Now, rather than going ahead to replace the image with a totally new image where i would have to manipulate the offsets as well now, I capture the same region image at 0.7 similarity and replace it. You can easily create a script for this and even integrate it into your project. Use find to figure out the matching region and capture to take the screenshot of the area. The image caught using this way will now again match at 100% for you also, you have rid yourself from the headache of adjusting the targetoffset. Hope this helps.

My SVG's are consistently rendering 'smaller' than they should be

I'm not sure entirely what's going on here. I'm exporting SVG's from Illustrator artboards. In the boards, they are exactly the same size (this is an icon set).
However when I set them as a background image there are some that will consistently not "fill up" the space they're set to take up in the height/width parameters.
Here's a jsFiddle to show what I mean. These were both exported the same exact way from Illustrator.. and if you inspect the smaller one it physically takes up as much space, as if there was an inside padding. So even if it make it twice as large in CSS with a width/height: 110px;, it becomes hard to position as it pushes other elements away.
I have a total of 6 icons used in this set, and 4 of them are exactly the same. There's 4 that are smaller like this though & I'm not sure why this is.
First of all shouts out to ccprog for noticing I had an embedded PNG of a prostate massager in my SVG file. Definitely defeats my purpose of using SVGs. Took it out and while the filesize went down by 2mb I still was facing my original issue.
If someone has any insight as to what's going on here that would be amazing, but hopefully this helps out someone else running into this.
I was using Shopify when I noticed this but this appears to also affect my jsFiddle so I don't think it's specific to certain services (although I know Shopify does a lot of stuff in the bg in regards to compression, etc.) I had tried every export option I could in Illustrator. Someone in this answer suggested something about saving normally rather than exporting, and allowing the -01 suffix Illustrator automatically appends.
I did this and it worked all of a sudden. I played around and took the -01 off of the filename and had the SAME issue as before. So next I saved straight from Illustrator and made sure there was no '-01'. Again, the issue persisted. I just renamed the file, putting -01 there. No issues.
I have no idea why this is but using '-01' at the end of the file name corrected my issue. I didn't change anything else.

SSRS Page Breaks. Past the end of my rope

(This is for SSRS 2012)
Hey guys. I know this really isn't the way to do things, but I am just completely done struggling with this.
Here is a zipped-up .rdl file for a report I'm working on: http://www.flowdex.net/files/amalgam_rdl.zip. Included in the .zip file is a .pdf with a typical output of that report.
I am getting several phantom page breaks that I simply cannot understand. I have scoured the internet, including stack overflow, and none of the regular suggestions have worked. I have made sure everything fits within the dimensions of a page, margins included, and have looked at the properties of every element in the report. Nothing gives ANY CLUE WHATSOEVER why a blank page must be inserted within a tablix that goes past one page, or why there is a page break in-between the two tablixes.
I don't know how viewing my .rdl will work... obviously you're not getting a database, so you won't have any way to test it. All I'm asking is for someone to take a quick glance at how everything is formatted and let me know if anything major stands out.
Sorry for the terseness, and I guess I'd understand if this question gets ignored / rejected. I just do not understand why this is so difficult. Teaching myself PHP was a million times easier than finding a stupid page break in SSRS.
Thanks in advance, and apologies again for being rude. This is crazy frustrating.
It looks to me like what you should do is take the DIV6 image and [Seiten] move them over to the left a little, then take the report body and collapse it to be right up against them. Right now, with your margins I think you are going over and it creates that phantom page thing.
Put visible borders onto everything. Start with the obvious: tablix's,text boxes, lists, images but also add to Report, Header, Footer, Body etc.
Make them all a different colour. You should then see which object is spilling onto the other page.
Note: adding a border adds a pixel (or point) to the width and height, so make sure you adjust for that when removing them or identifying the culprit.
Plan B:
From the screenshot, your empty page does not have a Batch:[Name] which indicates it could the way you are calculating your group maybe causing the problem (if it was due to pushing an element too wide, the header should have the same [Name] as the previous page.

Making the points always visible in a flex line chart

I'm trying to do something very similar to this example (source code enabled):
http://www.sunild.com/proto/line_chart_example.html
When you hover over each data point, a circle appears indicating that this is a point. How do I keep those circles visible at all times?
Edit: this example isn't mine, but you can view the source enabled here:
http://www.sunild.com/proto/line_chart_example_src/index.html
Umm, the case you show is a working example giving no details about the code itself. There are enormous ways the code could be.
For Eg - The code could be keeping an event listener over & out a mouse event...So removing it pretty much keeps the circles there.
But still I suggest show at least what you are doing, if not that code to get some clue.