Netlogo, Altering the location of label - netlogo

I am just curious if it's possible to alter the location of the labels in NetLogo. For example in the image below the word "La Grande Soufriere", is it possible to move it above the breed instead of below (as you can see it gets in the way of the other agents. Another case is the Habitants PMA (Actual name is Vieux Habitants) but only half of its name has appeared since the rest of its off-screen. I tried to manually type on a close-by patch but since I have used a fill color, it doesn't appear at all (it's covered by the fill color if you know what I mean). Does anyone have a solution for this?

I am just curious if it's possible to alter the location of the labels in NetLogo.
The short answer is that it is not possible.
The slightly longer answer is that there are ways around it, but they're not very satisfying.
If you want to alter the horizontal location, you can pad your label with spaces at the end or the beginning of the string to move it left or right, respectively.
If you want to alter the vertical location, or have more control over it, you can always create a "dummy" turtle to display the label. You can hide the dummy turtle without hidding its label by setting the size of the turtle to zero or by creating an empty turtle shape and using that for it.
I don't think it matters in your case, since you seem to want to label only stationary turtles, but if you wanted a dummy to move with a particular turtle, you can create a hidden link between them and tie them.
There might be other creative ways to deal with labels (and I'd be curious to read about them in other answers), but that's all I can think of for now.

Related

tableau adjust marks size using number

In Marks, click Size and there pops a slider where I can adjust the size of a shape. But how to accurately control the size, is there some property with numbers to accurately control it? I have two sheets to show something similar and I want to display exactly the same sized shapes.
If you want to ensure 'sizes' are the same across two worksheets, I'd suggest snapping the 'size' setting to the center on both, as this is the easiest option to select. You can then use a measure to set the size, if this is desirable, and then the difference in size will be relative on both worksheets.
There isn't a numerical value override for the size slider.
Ben is correct, there isn't yet a numerical value override for the slider. You can use parameters with Min/Max/Sum etc. and a variable to somewhat change the sizes but they have to have multiple entries per line. It is unfortunate that Tableau still doesn't get that people want both a 'relative' sizing system that uses numbers from the dataset and a 'static' sizing system that allows for shapes to be set to '11px' or something along those lines. Yes, you can control that kind of in the dashboard with a vertical and fill entire box etc; but that doesn't address the very real scenario where you want a user to be able to re-size on the fly. Just my two cents.
I ran into this today. Very annoying. Need to keep shapes the same size across all worksheets and therefore same on dashboard.

Dynamically extendable ladder shape

My question is two parts, and answers to either would be helpful.
I want to make a Master shape that can be expanded on one axis only. When you expand it the image inside repeats itself. I still want to be able to resize the image proportionally. See the picture for example.
Discrete extendable ladder
The second part of my question is how to restrict this expansion to discrete segments, meaning that the expanded image snaps to the next segment when it gets close enough, but nothing in between. I think I can do this with the BOUND() function, just not sure how.

Crystal Reports fields won't align

I have several items that I want to line up. The Width and Height of all fields match. Usually I just use the Align, but it's making it worse. My out of line field which is slighly lower, moves way up, way out of line (with align tops)
So I tried using the Size and Position to set it manually. Several objects have a Y of 0.056, but my last one has 0.061. I change the last one to 0.056 and save it. It doesn't appear to be different, and when I look at it again, it's still 0.061. (When I used align, it went up to 0.028!)
I do NOT have Snap to Grid set (my grid size is 0.083). (Nor does turning on Snap to Grid make them align.) The fields have exactly the same formatting. But unless I can magically make them align by hand, they refuse to align. Why?
You've already done a lot of the regular troubleshooting steps. One more ting that I sometimes do is to select all the fields I want to align, then use the arrow keys and move them up into the section above and then back down into their original section. That usually puts them all into the 0 position. If it dosn't work with all of them selected, try each one separately.

Clickable transparent lines are impossible in MATLAB?

So I have 3 lines (technically patches) that have some transparency enabled. These lines were generated by the patchline FEX submission. The FEX entry works great by making patches seem like lines by adding a NaN to the end of the data so it doesn't create a big black patch between the end points of my line.
My lines looks like this
__ __
\ /
_ \ / _
\ \__/ /
\______/
The patch extends from the left end point to the right end point in a straight line across the top and then follows the line on the bottom. The actual patch is hidden (not drawn) though so all the user sees is the lines
The problem is if I wanted to click the bottom hump of the top line, it acts like I clicked the bottom line because it is part of that patch.
I have thought of a couple of workarounds and was hoping you guys could point out flaws or add ideas I might have missed with my workarounds.
Workaround #1
Ideally, I would create an actual line (line series obj.) over the transparent lines. I would turn hittest off on the patches and I would make the actual line invisible, but turn hittest on. The problem I am 99% sure exists is that if visibilty is off, you can't click the object. If anybody has a work around to that issue (documented or otherwise), that would be great.
Workaround #2
Turn the patchline hittest property to off. Make mock line objs. that follow the patchline coords. and have a line width very very small so as to make the line ideally pretty much invisible and have hit test clicks point to these lines instead. Has anybody tried something like this before? (I'm at work and can't try it now)
Workaround #3
NOTE THAT I REALLY DONT WANT TO DO THIS It is of course possible to turn off hittest for the patch/line objs and use the axes buttondown to figure out what patch obj (just the line part) it was closest to.
Once again, any insight would be much appreciated either about my possible work arounds, the situation in general, etc.
Thanks, Shaun
The problem can be illustrated with two line-thick patches, one of which is NOT parallel to the axes:
patch([2 8 8],[5 10 10],'w','EdgeColor','b','EdgeAlpha',0.4,'LineWidth',3)
patch([2 8 8],[4 4 4],'w','EdgeColor','r','EdgeAlpha',0.4,'LineWidth',3)
xlim([0 10])
ylim([3 11])
You cannot select but those lines which are parallel to one of the axes.
Workaround #1: impossible.
Workaround #2: quite visible, why would you need transparent lines then?
Workaround #3: the only way...
Workaround alternative: submit to the TMW a technical request to improve clickability of patches.
Oleg, your initial post somehow inspired me to come up with my elegant solution. (Don't ask me how, just accept my "thank you" haha)
The elegant solution to my problem required me to go beyond patch properties and turn to the axes child order. Under the assumption that none of the lines would intersect each other, I was able to plot them in a order where the bottom one was first, then the second lowest, etc. until I got to the top (effectively rearranging child order).
If anybody else stumbles upon this, what you can do (assuming your lines don't intersect) is to sort the first Y (or whatever values) to go from lowest to highest (in this case) in your plot, and make sure your sort function returns the indicies.
I don't have my computer in front of me, but what you end up doing is effectively making an acontinuous for loop, looping through the indicies.
something like:
for i=[6 2 5 4 1 3]
plot(X(:,i),Y(:,i))
end
Where the 6th column was my lowest data, 2nd column was second lowest on plot, etc.

Word Styles to get two elements to share same background/border

Within MS Word 2013 I am trying to create a text element plus a list underneath it, all wrapped inside a coloured border with background shading (see image). The attached image shows the text in plain form.
I would like to place a blue border around both the title and the list. I can achieve this by placing both objects within a 1x1 table and applying colouring rules to the cell, but semantically this seems bad (I'm from an HTML development background where it is very wrong!)
When I edit a Style rule to create the border/background, it works well until I create the list, then it goes badly wrong. Is it possible to achieve the output of the table cell approach by only using a style rule and no table?
After a day of experimentation, the closest I can get is by doing the following:
Create a style rule called Tips Heading based on Normal, then set it to be Bold with a blue background.
Create another style rule called Tips List based on List Paragraph, and set it to have a blue background.
Unfortunately the List cannot be indented because the background colour also indents. The border is also affected in this manner, so I ignored the border and indentation. It works really well and is semantically well structured.