How do I visualize points in Paraview 5.4.1? - points

To whom it may concern,
I write a Fortran program to track particles. It creates the following output in .vtk format for Paraview:
<?xml version="1.0"?>
<VTKFile type="UnstructuredGrid" version="0.1" byte_order="LittleEndian">
<UnstructuredGrid>
<Piece NumberOfPoints="16" NumberOfCells="0">
<Points>
<DataArray type="Float64" NumberOfComponents="3" format="ascii">
-3.743016E-0003 5.787635E-0002 -1.104483E-0010
-3.244210E-0003 5.700748E-0002 5.074001E-0011
-2.747819E-0003 5.623541E-0002 9.991296E-0011
-2.246957E-0003 5.556635E-0002 -5.163316E-0011
-1.749140E-0003 5.501747E-0002 1.470107E-0010
-1.248574E-0003 5.460318E-0002 -1.527216E-0011
-7.487991E-0004 5.432458E-0002 -9.874857E-0012
-2.504589E-0004 5.418813E-0002 8.798235E-0012
2.504575E-0004 5.418813E-0002 -2.789069E-0011
7.487986E-0004 5.432458E-0002 1.118293E-0011
1.248530E-0003 5.460317E-0002 -1.385613E-0011
1.749141E-0003 5.501748E-0002 1.227365E-0011
2.246955E-0003 5.556635E-0002 -4.099211E-0011
2.747817E-0003 5.623541E-0002 8.857913E-0012
3.244206E-0003 5.700748E-0002 1.460764E-0010
3.743038E-0003 5.787647E-0002 3.815671E-0011
</DataArray>
</Points>
<Cells>
<DataArray type="Int64" Name="connectivity" format="ascii">
</DataArray>
<DataArray type="Int64" Name="offsets" format="ascii">
</DataArray>
<DataArray type="Int64" Name="types" format="ascii">
</DataArray>
</Cells>
</Piece>
</UnstructuredGrid>
</VTKFile>
Sixteen points are defined in the file, with their coordinates, no cells, and no point data too. When I read this file with Paraview (I use version 5.4.1) I just don't see the points. I tried the 3D Glyph and then Sphere, but that doesn't help.
Is something missing in the file I create?
Cheers

I would suggest using the "Point Gaussian" representation.

What you do is correct, but you are facing a problem of camera. All you need to do is use the "Reset" or the "Zoom To Data" button in the toolbar .
I hope it helps.

Related

XPath 1.0 trace ONLY element names at top nodes along path

I edited this for clarity with a much clearer example.
interesting XPath problem I have not found an answer for.
"I would just like to trace the path from the top of the tree to a leaf without including any of the sub-branches at any node...just the node along the way without its contents...just its element name."
given:
|tree doc|
tree := '
<bookstore>
<book category="COOKING">
<title lang="en">Everyday Italian</title>
<author>Giada De Laurentiis</author>
<year>2005</year>
<price>30.00</price>
</book>
<book category="CHILDREN">
<title lang="en">Harry Potter</title>
<author>J K. Rowling</author>
<year>2005</year>
<price>29.99</price>
</book>
<book category="WEB">
<title lang="en">XQuery Kick Start</title>
<author>James McGovern</author>
<author>Per Bothner</author>
<author>Kurt Cagle</author>
<author>James Linn</author>
<author>Vaidyanathan Nagarajan</author>
<year>2003</year>
<price>49.99</price>
</book>
<book category="WEB">
<title lang="en">Learning XML</title>
<author>Erik T. Ray</author>
<year>2003</year>
<price>39.95</price>
</book>
</bookstore>'.
doc := (XMLDOMParser on: tree) parseDocument.
doc explore.
each ancestor going up the tree in reverse document order is giving me all of its contents, I just want its QName .
The intent is for didactic purposes in documentation I am writing for it.
Say I want the ancestors of <author>Erik T. Ray</author>, I just want to see <bookstore><book><author>.
What I end up with is The bookstore node and its children, the book node and its children and the author node and its child.
These are the correct nodes, but it is not the output I am looking for.
The intent is didactic, I would like to show that localName of the ancestor nodes without any other clutter
Thank you for your time
For all nodes that have children:
//*[*]
In [4]: root.xpath('//*[*]')
Out[4]:
[<Element I at 0x10bd40d00>,
<Element w at 0x10bdb4e40>,
<Element j at 0x10bca5f40>]
For all nodes with children that are not below a specific node in the document:
//*[*][not(./preceding::<node>) and not(./<node>)]
In [13]: root.xpath('//*[*][not(./preceding::ould) and not(./ould)]')
Out[13]: [<Element I at 0x10bd40d00>]
In [14]: root.xpath('//*[*][not(./preceding::ust) and not(./ust)]')
Out[14]: [<Element I at 0x10bd40d00>, <Element w at 0x10bdb4e40>]
However, a 1.0 XPath cannot return a set of strings, such as the local names: Get a nodeset of all local-names with xpath

Unicode Character for Funnel to Signify Filtering

Is there a unicode character that signifies filtering (for example, a funnel) that is widely available on common computer operating systems?
Some of the most similar chars I've found so far:
∀, ∨, ∇, ▼, Y, Ⴤ, V, ᗊ, ⑂,
ツ
You can use search engines that allow you to draw like
http://shapecatcher.com/
http://www.mausr.com/
http://detexify.kirelabs.org/classify.html
I'm not able to find anything similar to the funnel but here are some possible results:
Turned shogi piece: ⛉ ⛊
Sector: ⌔
Down-pointing triangle with right half black: ⧩
Alchemical symbol for water: 🜄
Alchemical symbol for horse dung: 🝖
Canadian syllabics carrier hee: ᐶ
Rightwards arrow through superset ⭄
Subset above rightwards arrow ⥹
Rightwards arrow through greater-than ⭃ (probably should be rotated when display)
Greater-than above rightwards arrow ⥸
Rightwards arrow with tail ↣
Z notation range antirestriction ⩥
Excel does have a funnel shape when filtering data (see the icon in the c column above "7" in the below table) but I'm not sure whether they use an image or character for that since window inspection tools can't work out that symbol
In some cases the scissors ✀ can be used to signify "cut out unnecessary parts"
This is not really an answer, but possibly useful for anyone finding this page looking for a filter funnel icon. Here's a hack to make something look like a funnel - stack a triangle and a bar!
.filter-triangle,
.filter-bar {
position: absolute;
top: 0;
left: 0;
width: 1em;
text-align: center;
}
.filter-bar {
top: 0.1em;
}
<div class=filter-bar>❘</div>
<div class=filter-triangle>▼</div>
Alternatively this is an SVG icon I made:
<svg viewBox="0 0 80 90" focusable=false><path d="m 0,0 30,45 0,30 10,15 0,-45 30,-45 Z"></path></svg>
Both need aria attributes for accessability, amongst other problems! Both snippets are WTFPL-licenced!
Or you can use the MIT licenced filter icon from Feather.
I usually use the following:
y filter
Y active filter
¥ cancel or disable filter
Late here, but I like this ⫧
Found it by using shapecatcher.com which someone here suggested.
It works particularly well as a small placeholder in the inputs for my column filters.
(image)
https://unicode-table.com/en/2AE7/
I needed the same, and as far as I can tell there is no FUNNEL, FILTER or REDUCE symbol in Unicode.
However there is this:
⊆ U+2286 SUBSET OF OR EQUAL TO
You can use the character "X" with the Webdings Font, and it will give you a Speaker icon. Rotate it 90° and it'll be like a Funnel.
There is a proposal for a funnel (filter):
https://www.unicode.org/wg2/docs/n5181-repertoire-postAmd1.pdf
1CE08
Until it is released, the best character is the one provided by #phuclv (https://stackoverflow.com/a/51728429/5390321)
🝖 (1F756)
This is the best character I could find for myself ⊕
Unicode Character 'CIRCLED PLUS' (U+2295)
Which is by no means a funnel, but a kind of like a cross-hair insinuating "target more specific results". There are literally thousands of characters though...
In my case, I am going to use IcoMoon to replace the icon for this character, check out the IcoMoon app here
If you dont have a character map tool, you can use this quick PHP snippet to print out a range of unicode characters:
<?php
for ($i=hexdec("25ff");$i<=hexdec("26ff");$i++) echo sprintf("&#%u; ",$i);
Prints
◿ ☀ ☁ ☂ ☃ ☄ ★ ☆ ☇ ☈ ☉ ☊ ☋ ☌ ☍ ☎ ☏ ☐ ☑ ☒ ☓ ☔ ☕ ☖ ☗ ☘ ☙ ☚ ☛ ☜
☝ ☞ ☟ ☠ ☡ ☢ ☣ ☤ ☥ ☦ ☧ ☨ ☩ ☪ ☫ ☬ ☭ ☮ ☯ ☰ ☱ ☲ ☳ ☴ ☵ ☶ ☷ ☸ ☹ ☺ ☻
☼ ☽ ☾ ☿ ♀ ♁ ♂ ♃ ♄ ♅ ♆ ♇ ♈ ♉ ♊ ♋ ♌ ♍ ♎ ♏ ♐ ♑ ♒ ♓ ♔ ♕ ♖ ♗ ♘ ♙
♚ ♛ ♜ ♝ ♞ ♟ ♠ ♡ ♢ ♣ ♤ ♥ ♦ ♧ ♨ ♩ ♪ ♫ ♬ ♭ ♮ ♯ ♰ ♱ ♲ ♳ ♴ ♵ ♶ ♷ ♸ ♹
♺ ♻ ♼ ♽ ♾ ♿ ⚀ ⚁ ⚂ ⚃ ⚄ ⚅ ⚆ ⚇ ⚈ ⚉ ⚊ ⚋ ⚌ ⚍ ⚎ ⚏ ⚐ ⚑ ⚒ ⚓ ⚔ ⚕ ⚖ ⚗ ⚘
⚙ ⚚ ⚛ ⚜ ⚝ ⚞ ⚟ ⚠ ⚡ ⚢ ⚣ ⚤ ⚥ ⚦ ⚧ ⚨ ⚩ ⚪ ⚫ ⚬ ⚭ ⚮ ⚯ ⚰ ⚱ ⚲ ⚳ ⚴ ⚵ ⚶ ⚷ ⚸
⚹ ⚺ ⚻ ⚼ ⚽ ⚾ ⚿ ⛀ ⛁ ⛂ ⛃ ⛄ ⛅ ⛆ ⛇ ⛈ ⛉ ⛊ ⛋ ⛌ ⛍ ⛎ ⛏ ⛐ ⛑ ⛒ ⛓ ⛔ ⛕
⛖ ⛗ ⛘ ⛙ ⛚ ⛛ ⛜ ⛝ ⛞ ⛟ ⛠ ⛡ ⛢ ⛣ ⛤ ⛥ ⛦ ⛧ ⛨ ⛩ ⛪ ⛫ ⛬ ⛭ ⛮ ⛯ ⛰ ⛱
⛲ ⛳ ⛴ ⛵ ⛶ ⛷ ⛸ ⛹ ⛺ ⛻ ⛼ ⛽ ⛾ ⛿
Good luck
While it won't be a funnel, I would suggest to use the web symbol: 🕸
After all, a web allows to catch the resource after which its user is looking for while letting much of the rest going to some ignored places.
Ψ 03A8
ψ 03C8
¥ 00A5
⁝ 205D
⁞ 205E
⥺ 297A (Rotated to point down)
⦀ 2980
⧨ 29E8
⧩ 29E9
⧪ 29EA
⏚ 23DA
🔍 128269
🔎 1F50E
There are a lot pictured here https://www.vertex42.com/ExcelTips/unicode-symbols.html
This may help. While looking for the same thing I found that I could print a funnel using this JavaScript line:
String.fromCharCode(57710); // Prints: 
But it doesn't work all the time. Most of the time I end up with a box, like: "". I'm still trying to figure out why that is.

Google Charts offsetting the horizontal axis marker labels

Does anyone know if its possible to offset the markers so they appear between the column of a google chart?
So that it appears like this design mockup...
Instead of the markers being directly inline with the columns like below which is the default behaviour of the google.visualization.ColumnChart api.
I have search through the documention, however cannot find any references to options that would allow for this kind of customisation. Does anyone know if perhaps there is a way of manipulating the layout after it has been rendered? Or if in fact there is an option to do this but I've just overlooked it?
Thanks
The chart is rendered in a <svg> structure containing <g>, <rect>, <text> (and other) elements. The structure differs a lot form chart to chart, and the internal ordering can change if basic chart elements are left out. The horizontal axis elements is rendered as something like
<text text-anchor="middle" x="468.46875" y="343.05" font-family="Arial" font-size="13" stroke="none" stroke-width="0" fill="#222222">12</text>
To get an idea of where to look for those <text> elements in the <svg> structure you can copy the rendered code of the chart to a editor capable of styling code, or use a online code beautifier.
Then simply iterate through the <svg> by using DOM methods such as querySelector, querySelectorAll, getElementsByTagName etc.
See this google.visualization.ColumnChart :
By changing the x attribute of each <text> element that belongs to the horizontal axis we can get the labels to appear between the columns :
google.visualization.events.addListener(chart, 'ready', updateAxis);
function updateAxis() {
var x,
svg = document.getElementById('chart').querySelector('svg'),
g = svg.querySelectorAll('g'),
chartArea = g[3].querySelectorAll('g'),
hAxisTexts = chartArea[5].querySelectorAll('text');
//0-15 labels, the rest belongs to the yAxis
for (var i=0;i<16;i++) {
x = parseFloat(hAxisTexts[i].getAttribute('x'));
if (x>9) {
x = x-15;
} else {
x = x-18;
}
hAxisTexts[i].setAttribute('x', x);
}
}
demo -> http://jsfiddle.net/hrrL45oq/
This is only an example. You will perhaps need to target a different <g> element holding the <text>'s, and how you manipulate x or other attributes of <text> depends of the layout of the chart.

Is there a limit to the amount of data you can put in a MATLAB pie/pie3 chart?

I have everything going swimmingly on my pie chart and 3D pie charts within MATLAB for a dataset, however, I noticed that even though I have 21 pieces of data for this pie-chart being fed into the pie-chart call, only 17 appear.
PieChartNums = [ Facebook_count, Google_count, YouTube_count, ThePirateBay_count, StackOverflow_count, SourceForge_count, PythonOrg_count, Reddit_count, KUmail_count, Imgur_count, WOWhead_count, BattleNet_count, Gmail_count, Wired_count, Amazon_count, Twitter_count, IMDB_count, SoundCloud_count, LinkedIn_count, APOD_count, PhysOrg_count];
labels = {'Facebook','Google','YouTube','ThePirateBay','StackOverflow', 'SourceForge', 'Python.org', 'Reddit', 'KU-Email', 'Imgur', 'WOWhead', 'BattleNet', 'Gmail', 'Wired', 'Amazon', 'Twitter', 'IMDB', 'SoundCloud', 'LinkedIn', 'APOD', 'PhysOrg'};
pie3(PieChartNums)
legend(labels,'Location','eastoutside','Orientation','vertical')
This goes for the labels and the physical graph itself.
Excuse the poor formatting in terms of the percentage cluster, this is just a rough version. I tried every orientation and even splitting labels between the orientations without any luck.
Quasi-better resolution for Pie Chart -- Imgur Link
Like Daniel said - it appears that there simply isn't any non-negative data for the missing slices. I tried reproducing your problem with the following initialization, yet it resulted in normal-looking chart:
[ Facebook_count, Google_count, YouTube_count, ThePirateBay_count, ...
StackOverflow_count, SourceForge_count, PythonOrg_count, Reddit_count, ...
KUmail_count, Imgur_count, WOWhead_count, BattleNet_count, Gmail_count, ...
Wired_count, Amazon_count, Twitter_count, IMDB_count, SoundCloud_count, ...
LinkedIn_count, APOD_count, PhysOrg_count] = deal(0.04);
In order to verify this hypothesis - could you provide the data you're using for the chart? Do you get any warnings when plotting the chart?
From inside the code of pie.m:
if any(nonpositive)
warning(message('MATLAB:pie:NonPositiveData'));
x(nonpositive) = [];
end
and:
for i=1:length(x)
if x(i)<.01,
txtlabels{i} = '< 1%';
else
txtlabels{i} = sprintf('%d%%',round(x(i)*100));
end
end
You can see that MATLAB doesn't delete valid slices, but only renames them if the data values are small.

Two LineSeries with the same Y Axis in WPF Toolkit charts

I want to do the following with the WPF toolkit charts:
I have two line series that should use the same y axis (i.e I want them both to be on the same scale). I could give each of them the same axis definition so they would overlap (and then have one of them with collapsed visibility), but that is not my best choice.
This is the solution I'm talking about:
<charts:LineSeries Name="ExternalMeasureSeries"
IndependentValueBinding="{Binding Time}"
DependentValueBinding="{Binding ExternalMeasure}">
<charts:LineSeries.DataPointStyle>
<Style TargetType="charts:LineDataPoint">
<Setter Property="Background" Value="Red"/>
<Setter Property="Opacity" Value="0" />
</Style>
</charts:LineSeries.DataPointStyle>
<!-- Vertical axis for external measure curve -->
<charts:LineSeries.DependentRangeAxis>
<charts:LinearAxis
Orientation="Y"
Title="Measurement"
Minimum="0"
Maximum="30"/>
</charts:LineSeries.DependentRangeAxis>
</charts:LineSeries>
<charts:LineSeries Name="InternalMeasureSeries"
IndependentValueBinding="{Binding Time}"
DependentValueBinding="{Binding InternalMeasure}">
<charts:LineSeries.DataPointStyle>
<Style TargetType="charts:LineDataPoint">
<Setter Property="Background" Value="Orange"/>
<Setter Property="Opacity" Value="0" />
</Style>
</charts:LineSeries.DataPointStyle>
<!-- Vertical axis for internal measure curve -->
<charts:LineSeries.DependentRangeAxis>
<charts:LinearAxis
Orientation="Y"
Minimum="0"
Maximum="30"
Visibility="Collapsed"/>
</charts:LineSeries.DependentRangeAxis>
</charts:LineSeries>
Is there a way to define more than one series with the same Y axis?
I found that toolkit version 3.5.0.0 has something called StackedLineSeries but that version 3.5.40128.1 which is what gets installed in the February 2010 version of the toolkit, it isn't there. Did it move to another clr-namespace?
I faced the same issue and found the following way around. You can add the two series to the same chart and hide the second series Axis label by setting the Width to 0;
<charts:LinearAxis
Orientation="Y"
Title="Measurement"
Minimum="0"
Maximum="30"
**Width = "0"**
/>
Hope this helps
I have a chart with 3 line series. The first 2 series represent the relative humidity and the third one represent the dew point.
I want to draw the first 2 series on the same Y axis. I created my axes in a resource section. In my example, this is in a TabItem.
<TabItem Header="rH">
<TabItem.Resources>
<chartingToolkit:LinearAxis Orientation="Y" HorizontalAlignment="Left" Title="rH /%" x:Key="RHYAxis" />
<chartingToolkit:LinearAxis Orientation="Y" HorizontalAlignment="Right" Title="Dew point /°C" x:Key="DewPointYAxis" />
</TabItem.Resources>
<chartingToolkit:Chart HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Title="Relative Humidity" IsEnabled="True">
<chartingToolkit:Chart.Series>
<chartingToolkit:LineSeries DependentRangeAxis="{StaticResource RHYAxis}" IsSelectionEnabled="False" ItemsSource="{Binding Path=RHCollection}" IndependentValuePath="TimeStamp" DependentValuePath="rH" Title="Measured rH" />
<chartingToolkit:LineSeries DependentRangeAxis="{StaticResource RHYAxis}" IsSelectionEnabled="False" ItemsSource="{Binding Path=CorrectedRHCollection}" IndependentValuePath="TimeStamp" DependentValuePath="CorrectedRH" Title="Corrected rH" />
<chartingToolkit:LineSeries DependentRangeAxis="{StaticResource DewPointYAxis}" IsSelectionEnabled="False" ItemsSource="{Binding Path=DewPointCollection}" IndependentValuePath="TimeStamp" DependentValuePath="DewPoint" Title="Dew point" />
</chartingToolkit:Chart.Series>
</chartingToolkit:Chart>