-
-
Notifications
You must be signed in to change notification settings - Fork 358
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simple patch drawing #605
Comments
seriestype = :shape
…On Thu, Dec 8, 2016 at 2:26 PM StreetLevel ***@***.***> wrote:
Hi,
sometimes it would be useful if one could draw 2D and 3D Matlab-like patch
objects via Plots.jl:
[image: patch]
<https://cloud.githubusercontent.com/assets/12096700/21011334/12302100-bd51-11e6-9079-7864bb60c188.png>
For me it would be useful for visualizing small finite element models in
Julia without using a post processing tool but I think it's useful in many
other cases too.
I think it's a basic feature for a plotting library and should be
implemented in Plots.jl
Best, Max
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#605>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AA492jH5ETAnbJKQQoe5B3EZNMHjO_Ccks5rGAV_gaJpZM4LH0MA>
.
|
There's nothing like this built into Plots. I'm curious how you'd use this in practice (i.e. why is it useful?) |
I would find this useful in some numerical methods as for example in the Finite Element method where nodal interpolation is usually done to better visualize fields (as displacement, temperature, etc.) |
I am migrating from MATLAB as well and visualizing data over an triangular mesh is paramount to my work. I made a small example that could showcase the usefulness of this. Using delaunay to create a triangular mesh over random points and and coloring each triangle with the Y position. I still did not manage to get a colorbar to show up. Any ideas? I tried to figure out how to use the seriestype = :shape tip but could not figure out how to use @recipes. To the best of my knowledge, there is no way to plot a triangular mesh in 3D. Doing that is quite straightforward with PyPlot or plotly and that is how I am doing those plots now but I would rather use Plots. using VoronoiDelaunay
using Plots
##
N = 100
x = 1.0 + rand(N)
y = 1.0 + rand(N)
tess1 = DelaunayTessellation()
pts1 = [Point(x[n], y[n]) for n=1:N]
push!(tess1, pts1)
##
scatter(x, y,leg=false,palette=:heat)
for i in tess1
t=Shape([geta(i)._x,getb(i)._x,getc(i)._x],[geta(i)._y,getb(i)._y,getc(i)._y])
plot!(t,fill = (0, 0.5, RGB(geta(i)._y-1, geta(i)._y-1, geta(i)._y-1)))
end
gui() |
see also the discussion here #392 |
Can't you do this with |
Hi,
sometimes it would be useful if one could draw 2D and 3D Matlab-like patch objects via Plots.jl:
For me it would be useful for visualizing small finite element models in Julia without using a post processing tool but I think it's useful in many other cases too.
I think it's a basic feature for a plotting library and should be implemented in Plots.jl
Best, Max
The text was updated successfully, but these errors were encountered: