I have a project that has weighted edges between nodes. The edges have been imported as floats and have too many values after the decimal to be presentable.
For example, I may have three edges of weights 3.4785949828, 5.2828181992, and 2.4249882928. If I'm showing the weight between nodes, the graph could begin to look very cluttered if I keep all of those values after the decimal. I would like to be able to automatically change them to integer values of 3, 5, and 2 respectively
Is there any way I can automatically change all those floats to integers in the existing project?
... [edges] have too many values after the decimal to be presentable.
Data Laboratory
For edge labels, create new column (where 1.234567890 becomes [1.]) by using a regular expression like \d*\. via:
Data Laboratory > Data Table > Edges > Create column with list of regex matching groups
Overview
A Hide non-selected -option is available via:
Overview > Labels -tab > Hide non-selected
Preview
Edge label-display can be adjusted via:
Preview > Preview Settings > Settings > Edge Labels > Shorten Label
and
Preview > Preview Settings > Settings > Edge Labels > Max Characters
Example:
Related
I am trying to solve with Comsol the problem of the figureTwo blue big electrodes with fixed potentials V1,V2. One red small electrode that moves above the others along x axis at constant distance and voltage V0. The charge in V0 depends on the electric field at each point 8(x). I have one small electrode with a potential V0 moving along x axis above two bigger electrodes with fixed potentials V1,V2.
I can easily compute with comsol the potential and field at each point in 3D and the resulting charge in V0 electrode. However i would like to simulate this charge along the x axis and eventually map it also for z and y direction so i have a V0 charge 2D map at a fixed distance.
How can i do this in COMSOL without changing the geometry coordinates manually and computing again the charge at each point?
Thank you for your answers,
Jorge
I'll describe how to setup the system so that you can move V0 around. Note that this requires changing the mesh throughout the simulation. For this reason, I don't think you want a "time dependent" study but instead you want to use the "parametric sweep" option.
First, go to your Global Parameters and create a parameter called block_x_pos or whatever you want.
Go to Component → Geometry and select V0 and in the appropriate field under the "Position" tab (in the Setting Panel), write block_x_pos in the X Position. This makes that position controllable by whatever value is in block_x_pos.
Right click on the appropriate Study and select "Parametric Sweep". The purpose (as far as I know) for the Parametric Sweep is that when the geometry is changing during computation, it updates the mesh accordingly, so you don't have to do it manually through some painful repetition. Select the "Parametric Sweep" node which has now appeared. Look in the Settings Panel and find the "Study Settings" tab. Below the empty table, you'll see some arrows and a "+" sign. Click the "+". This will add a new sweep parameter to the table. Click the dropdown menu on the table and select the "time" Global Parameter. In the "Parameter Value List" field, write the range of values you'd like to have it take.
i.e. if you want the block_x_pos parameter to vary from 0 to 10 in steps of 0.1, you would write range(0, 0.1, 10). Or you could write '-3 0 1 2 4 5 9 11' and it will take those values.
Now Compute using that same Study.
When you are making plots, be sure to use the correct Solution. It will be labeled something like "Study1/ParametricSolutions1". When you select this as your "Data Set", you will find (in your Settings Panel) a new dropdown menu below the "Data Set" field called "Parametric selection (time)". You can choose to show multiple values for the "time" parameter on most plot types.
I'm in the process of evaluating Highcharts as a replacement for our current platform, and have some questions about how we can replicate one of our existing charts:
I've been able to recreate the basic floating stacked column chart, but need help with some of our specific features.
1) Is is possible to replicate the multiple y-axes with the columns displayed to the right of each within a single chart? If not, I suppose we could do 3 charts next to one another - and draw our own titles above (and data table below). If we go this route, is there a way to group all these elements in a single "container"? We need to export these charts to images and need to end up with a single image that looks like the one attached.
2) How would I create the inner box within each column? Do I need to draw it myself, or can I create another column series with a border and transparent fill and somehow set the width of the column to be less than the width of the main columns (note that the number of columns on each chart is dynamic, so the column widths can't be a fixed size. i.e. the inner box width needs to be a percentage of the main column width)?
3) Assuming #2 is possible, I could probably use the same technique to plot the horizontal line - just make the height 0 (or very small) and make the bar wider instead of smaller. Is there a better way?
4) How do I get the x coordinates of the columns so we can align our data table under each column?
5) Can I separate the individual points within the column. You'll notice in my jsfiddle, product 1 and product 2 are vertically aligned in the center of the column. Can I spread them out within each column as the 2 points are in the screenshot?
Thanks in advance for advice on all or any of the above.
Mike
1) You can use multiple yAxis, see the example
2) You can use renderer or mix column/column range and border parameter, example
plotOptions: {
columnrange: {
pointPadding:0.2,
color: 'rgba(255,255,255,0)',
borderColor: '#303030'
}
},
3) Use renderer, as above or scatter series with customied marker
4) Column is shape in point.element.graphic, so you can extract it.
5) as far as I know, it is not possible
Transposing the table does not help. Every time I get this graph:
I tried to swap the axes in the Select Data Source dialogue but then I get this:
Now the letters (they are departments in real world, I just simplified it) are on the vertical axis, but the horizontal axis is wrong. Of course the graph is also wrong as I don't need two vertical axes. I need the columns to be horizontal as that graph would be much easier to read.
Is this possible?
You have to choose another type of graph. Try the 'bar'-type. (You can change it by right-click -> Change type).
Scenario:
1) Three plots: One 'datum' plot (default) and three comparison plots; each with their own Y Ranges.
The user could choose either:
2a) One stand-alone'datum' plot (default) or...
2b) A combo of {datum & 1 comparison plot}: 2 plots sharing a combined range (max/min Y of both).
All three plots are initially created/graph.
They are to be toggled to displayed per their ranges on demand.
Problem: Changing the graph's Y-Range appears to have an unfavorable (or no) effect: sometimes using the wrong Y-Range (e.g., the combo comparison plots is still using the default datum y-range).
Question: What is the best way to change the graph's Y-Range per demand to accommodate the plot scenarios?
Note: I've been toggling the plots via add/remove plot from graph. Essentially, I just re-assign the new Y-Range/graph when I add the new plot(s).
The plot(s) should change to reflect the new xRange or yRange whenever you change them. If you're modifying the existing range, remember that plot ranges are immutable. You need to make a mutable copy of the existing range before modifying it and assigning the new range to the plot space.
I have been working on a project that requires a bar graph to be populated with price results. The chart displays the number of items within a given price range. For instance, if on amazon there are 9 items within the price range of $0-$10 the x-axis would display $0-$10 and the y-axis would be populated with a value of 9.
My bar graph has 8 bars, all with similar price ranges. $0-$10, $10-$20, $20-$30... etc.
My question is this: What is the best way to define those individual points? There is no common price range between these items, so the x-axis cannot be static numbers. They must be dynamically calculated within the range of results.
As such, currently I am creating the x-axis points as follows:
I take the lowest result:
#numbers[0] = results[0];
And I take the highest result:
#numbers[8] = results[-1];
Then I find the median of the two:
#numbers[4] = (#numbers[0]+#numbers[8])/2;
I then repeat the process 6 more times
#numbers[2] = (#numbers[0]+#numbers[4])/2; #numbers[6] = (#numbers[4]+#numbers[8])/2; #numbers[1] = (#numbers[0]+#numbers[2])/2; #numbers[3] = (#numbers[2]+#numbers[4])/2; #numbers[5] = (#numbers[4]+#numbers[6])/2; #numbers[7] = (#numbers[6]+#numbers[8])/2;
This gives me the results I need, but it seems awfully repetitive and I would imagine there is a better way.
I tried creating a loop, but I could not write it in a less verbose manner.
Is there a quicker way to do this, or perhaps something more along the lines of DRY?
Are your bins always of equal size? In your example, all share range=10. If so, then you could do:
binspacing = overall range / (numberofbins-1);
and the position of bin n would be the x-axis position of numbers[0] plus n times the binspacing.