How to customize marker/symbol properties in matplotlib? - matplotlib

Example command:
prop = matplotlib.pyplot.scatter(x,y,s=s,c=c)
dir(prop) shows set_edgecolor, set_edgecolors, set_linestyle, set_linestyles - why so many variations on the same thing?
Also, how do I remove the edgecolors? Setting values to None does nothing. And how do I change the marker size after the plotting? There does not appear to be a markersize attribute that I can access...
Edit
If the symbols are generated through plyplot.plot, there is a markersize attribute to change it seems. But with pyplot.scatter, not present.

It'd give using 'none' a go to see if that solves your issue with edgecolor. That typically sets attributes to no color.

Related

How to assign a label to go.layout.Shape(type="line"...)?

I produce the following figure.
The figure has a number of add_trace applied to it with go.Scatter as arguments.
A list of 4 go.layout.Shape, type="line", with fixed color attributes, is created and the figure layout is updated with that list: fig.update_layout(..., shapes=...)
The traces have labels assigned to them that we can see to the extreme right.
Is there a way to add labels to assign to the lines as well?
You would like your lines to appear in the legend of the figure (https://plot.ly/python/legend/). However, only traces can appear in the legend, not shapes which are a kind of annotation. What you could do is to create the lines using go.Scatter(..., mode='lines'), and then they would appear in the legend. You just need to give the starting and end points in go.Scatter (see https://plot.ly/python/line-and-scatter/).

Line_width not working in Vulkan

I enabled wide_line feature in VkPhysicalDeviceFeatures and i am giving appropriate value in pRasterizationState as well. But i dont see the width increased for the lines. What am I missing here?
Does the implementation support wide lines? Check the value of VkphysicalDeviceFeatures:: wideLines you get from vkGetPhysicalDeviceFeatures. Also check the lineWidthRange and lineWidthGranularity in VkPhysicalDeviceLimits.
Are you setting VK_DYNAMIC_STATE_LINE_WIDTH in VkPipelineDynamicStateCreateInfo::pDynamicStates? If so, you need to set the line width using vkCmdSetLineWidth rather than VkPipelineRasterizationStateCreateInfo::lineWidth.

How to fill available tableview width with columns?

When tableview is created, the default behaviour of columns is to leave a lot of empty space. Is there a way to automatically fill the space?
One solution is described here:
JavaFX 2 Automatic Column Width
but this seems a little cumbersome.
TornadoFX comes with an advanced column resize policy called SmartResize. You assign it to a TableView like this:
columnResizePolicy = SmartResize.POLICY
By default it tries to do something useful depending on the data, and it will assign any left over width to the last column.
You can configure resizing options per column by calling the appropriate configurator function. For example, to tell the policy to give remaining width to a given column:
column("Name", Person::nameProperty).remainingWidth()
You can configure multiple columns to receive remaning width, so that they will share the remaining width between them.
contentWidth() will make sure the column width fits the content, with optional additional padding: contentWidth(padding = 50.0).
Most resize options also take an optional useAsMin parameter which will enforce the given setting as a minimum width for the column. useAsMax does the same for max width. You will get a fixed size by setting both useAsMin and useAsMax or specifying the fixedWidth(width) option.
You can distribute space using the weigthedWidth(weightNum) function, or even the pctWidth(pctNum) function. All these modes can be combined
Please see the TornadoFX Guide chapter about the resize policy for more information:

wxWidgets child sizer not expanding

I've got a very frustrating sizer problem.
I have two wxFlexGridSizers (and a few other things) inside a vertical wxBoxSizer, like so:
mMainSizer->Add(topsizer, wxSizerFlags(0).Expand());
mMainSizer->Add(1, lineheight);
mMainSizer->Add(mTypeLabel);
mMainSizer->Add(mTypeSizer, wxSizerFlags(0).Expand());
mMainSizer->Add(1, lineheight);
Each wxFlexGridSizer is filled using the same code:
sizer->Add(label, wxSizerFlags(1).Expand());
sizer->Add(fieldwidth, 1); // To separate label and data
sizer->Add(data, wxSizerFlags(0).Border(wxRIGHT, rborder).Right());
But the wxFlexGridSizers aren't being Expanded to the same width, as I intend. The lower one, with smaller labels, is always narrower than the upper one, leaving the data fields misaligned between them. Since they were both added with the Expand() flag, the narrower one should expand to the same width as the wider one, right?
(I've even tried adding the Right() flag to the lower one too, when adding it to the wxBoxSizer, but it did nothing, which really confused me.)
Can anyone save my sanity by pointing out where I'm going wrong?
EDIT: As far as I can tell, this is a wxWidgets bug. The Expand flag should tell items in a vertical sizer to expand themselves to their maximum width. If I'm wrong, someone please correct me.
As it turns out, the bug was mine. I thought I'd given the wxFlexGridSizers a growable column, with wxFlexGridSizer::AddGrowableCol, but that must have been in an earlier iteration of the code. Once I'd done that, they expanded just as I wanted them to.

What does setTextMatrix of contentByte class in iText do?

I am using iText and am very new to it. There have been several situations where I think I could have figured out the problem with my code if I knew what I was doing - I use examples without knowing the workings behind the code, and even as I look at the source I can't figure out what the programmer was thinking.
What does setTextMatrix of contentByteArray in iText do? And how do I figure out the parameter values I need?
For example:
cb.setTextMatrix(1, 0);
The input parameters are x,y coordinates in points, unless CTM scaling was defined.
0,0 would be the bottom left of the template you are referencing.
The position is the 'baseline' of the text, rather than the top or the bottom.
Transcribed from this source:
https://sourceforge.net/p/itext/mailman/message/12855218/
first parameter sets left margin, second parameter sets bottom margin.