data-visualization

How can I plot 2d FEM results using matplotlib?

天涯浪子 提交于 2019-12-02 00:04:17
问题 I'm developing a 2D plane finite element tool. One of the features is the ability to visualize the stresses on a particular object. This tool creates a quadrilateral mesh using the following data: nodes : numpy array [[x1 y1], [x2 y2], etc] -> x and y coordinates of every node in the mesh elements : numpy array [[1 2 3 4], [2 3 5 6]] -> every line of the array corresponds to the 4 points of one particular element of the mesh. I was able to implement a method that plots the mesh: import

LinearAxis without decimal numbers

人盡茶涼 提交于 2019-12-01 21:23:45
问题 I want to avoid from decimal numbers in my Axis, how can I do that ? XAML: <Charting:Chart VerticalAlignment="Stretch" HorizontalContentAlignment="Stretch"> <Charting:Chart.Axes> <Charting:LinearAxis Orientation="Y" Minimum="0" Title="" Location="Left" /> </Charting:Chart.Axes> <Charting:Chart.Series> <Charting:ColumnSeries ItemsSource="{Binding Persons}" DependentValueBinding="{Binding Count}" IndependentValueBinding="{Binding Category}"> </Charting:ColumnSeries> </Charting:Chart.Series> <

How can I plot 2d FEM results using matplotlib?

旧时模样 提交于 2019-12-01 20:22:55
I'm developing a 2D plane finite element tool. One of the features is the ability to visualize the stresses on a particular object. This tool creates a quadrilateral mesh using the following data: nodes : numpy array [[x1 y1], [x2 y2], etc] -> x and y coordinates of every node in the mesh elements : numpy array [[1 2 3 4], [2 3 5 6]] -> every line of the array corresponds to the 4 points of one particular element of the mesh. I was able to implement a method that plots the mesh: import matplotlib.pyplot as plt import matplotlib.collections import matplotlib.cm as cm import numpy as np def

Plot point markers and lines in different hues but the same style with seaborn

旧街凉风 提交于 2019-12-01 16:58:56
Given the data frame below: import pandas as pd df = pd.DataFrame({ "n_index": list(range(5)) * 2, "logic": [True] * 5 + [False] * 5, "value": list(range(5)) + list(range(5, 10)) }) I'd like to use color and only color to distinguish logic in a line plot, and mark points on value s. Specifically, this is my desired output (plotted by R ggplot2 ): ggplot(aes(x = n_index, y = value, color = logic), data = df) + geom_line() + geom_point() I tried to do the same thing with seaborn.lineplot , and I specified markers=True but there was no marker: import seaborn as sns sns.set() sns.lineplot(x="n

Visualize a social network to show how often a user is mentioned in R [closed]

╄→尐↘猪︶ㄣ 提交于 2019-12-01 14:48:26
Given a data frame as following: v1 v2 v3 v4 v5 tom A pinky A 3 ben B hugo C 2 lily A tom A 1 ... Which denotes that v1 from group v2 has mentioned v3 from group v4 for v5 times. For instance, tom from group A has mentioned pinky from group A for 3 times. Now I'd like to plot a social network, each user denoted by a point and its size is proportional to the times he or she has been mentioned totally. And there is a line linkage two points if they have mentioned each other mutually or unilaterally. As I look into the ggplot document, I can not find any function to do it. Do you have any idea?

Plotting binned data using sum instead of count

亡梦爱人 提交于 2019-12-01 13:11:57
I've tried to search for an answer, but can't seem to find the right one that does the job for me. I have a dataset ( data ) with two variables: people's ages ( age ) and number of awards ( awards ) My objective is to plot the number of awards against age in R. FYI, a person can have multiple awards and people can have the same age. I tried to plot a histogram and barplot, but the problem with that is that it counts the number of observations instead of summing the number of awards. A sample dataset: age <- c(21,22,22,25,30,34,45,26,37,46,49,21) awards <- c(0,3,2,1,0,0,1,3,1,1,1,1) data <-

How can I append text to and render that text from a line in a force directed graph in D3.js?

杀马特。学长 韩版系。学妹 提交于 2019-12-01 11:46:38
问题 I'm trying to learn how to use the force.layout features in D3.js and have been building a "Force Directed Radial Graph". I've been able to successfully append and render text from nodes (e.g. Node Names) but I can't seem to get text to render from the lines (or what others might call the links or edges) (e.g. Relationship Names). Does anyone know where I can find good examples that teach how to do so or have code snippets that can correct what I've done? Thanks for any help you can offer. It

How to produce scatterplot with a factor as y in highcharter?

我是研究僧i 提交于 2019-12-01 11:46:18
Problem: I would like to produce a scatter plot with highcharter::hchart , where y is a factor , and x is a date . Apparently, highcharter::hchart "scatter" does not accept factor variables as y. Is there any workaround? Or is "scatter" just the wrong charttype? (Comment: I know ggplotly would be a good alternative, but I actually need a highcharter solution) Example: Let's suppose I want to produce a timeline of publications by type . I want a scatterplot with d$type (=y-axis) and d$date (=x-axis) and the highcharter tooltip should show me d$title , d$type and d$date (properly formatted).

Is there any way to manipulate the titles of a ctree plot?

假如想象 提交于 2019-12-01 11:42:28
Is there any way to change the title sizes of a ctree plot? Use the following variables to quickly set up a ctree plot a<-c(41, 45, 50, 50, 38, 42, 50, 43, 37, 22, 42, 48, 47, 48, 50, 47, 41, 50, 45, 45, 39, 45, 46, 48, 50, 47, 50, 21, 48, 50, 48, 48, 48, 46, 36, 38, 50, 39, 44, 44, 50, 49, 40, 48, 48, 45, 39, 40, 44, 39, 40, 44, 42, 39, 49, 50, 50, 48, 48, 47, 48, 47, 44, 41, 50, 47, 50, 41, 50, 44, 47, 50, 24, 40, 43, 37, 44, 32, 43, 42, 44, 38, 42, 45, 50, 47, 46, 43, 37, 47, 37, 45, 41, 50, 42, 32, 43, 48, 45, 45, 28, 44,38, 41, 45, 48, 48, 47 ,49, 16, 45, 50, 47, 50, 43, 49, 50) X1<-c(NA

Plotting binned data using sum instead of count

霸气de小男生 提交于 2019-12-01 10:49:14
问题 I've tried to search for an answer, but can't seem to find the right one that does the job for me. I have a dataset ( data ) with two variables: people's ages ( age ) and number of awards ( awards ) My objective is to plot the number of awards against age in R. FYI, a person can have multiple awards and people can have the same age. I tried to plot a histogram and barplot, but the problem with that is that it counts the number of observations instead of summing the number of awards. A sample