Filling Areas to Complete a ColorMap

Hello People,
I am rather new to Julia so I would be very thankful if someone was able to help or guide me, I am trying to plot a 2D grid of 126 3-nodes triangular finite elements with color representing a main strain.
I have the CSVDataMatrix with the coordinates of the 80 nodes’ xy coordinates in the third and fourth column, another 3*126 matrix with the connectivity of the nodes called Conectivity, and an array with the 126 strains relative to each element. So I wanted to paint each element in a range of colors depending the value of said straing, but, as every datta is discrete, I havent been able to properly use heatmap().

Thanks in advance.


for i=1:Num_Ele
global SecondPlot

SecondPlot=plot!(CSVDataMatrix[1:Col_Points,3,framenum],CSVDataMatrix[1:Col_Points,4,framenum]) #upper line plot
SecondPlot=plot!(CSVDataMatrix[1:10:71,3,framenum],CSVDataMatrix[1:10:71,4,framenum]) #ending points 
SecondPlot=scatter!(CSVDataMatrix[:,3,framenum],CSVDataMatrix[:,4,framenum],legend=false) #wanted to see the points aswell



I’m having a hard time understanding what you’re after… Could you bake a runnable minimal example that we can copy-paste and run along with a clear explanation of what is not working for you and what you would want? (Maybe drawing a sketch can help?)

Yeah, sorry, I would like to colour each triangle of the previous mesh depending of the value of the stretch , as you can see, I have already plotted the mesh but cant figure a way to fill the area of each traingle with its correspondant color.

This is an non relevant example, but something like this:

I don’t think heatmap, contourf, surface, and so on, support unstructured meshes at this stage. But maybe you could use an extra package like TriplotRecipes.jl?

Also Makie.jl hopefully will handle this at some point (see, e.g., issue #748)?

1 Like