# Fill a curve in 3D

I want to plot a complex impedance value as a function of frequency.

This results in a line in 3D(real, imaginary, frequency).
How do I fill the area between the line and the z=0 coordinate in 3D.
I tried fillrange and ribbon, but I could not get it to work in Plots.jl

Something like this can be found on page 295:

1 Like

In PGFPlotsX, I would suggest this example as a starting point:

https://kristofferc.github.io/PGFPlotsX.jl/dev/examples/gallery.html#D-Waterfall-1

I am not aware of something similar for Plots.jl, but see the original topic:

1 Like

Don’t know if it applies, but in Gnuplot.jl is quite easy:

``````x = 0.:0.05:3;
y = 0.:0.05:3;
z = @. sin(x) * exp(-(x+y))

using Gnuplot
@gsp xlab="X" ylab="Y" linetypes(:Set1_5, lw=3) :-
@gsp :- "set style fill transparent solid 0.3" :-
@gsp :- "set xyplane at 0" "set grid" :-
@gsp :- x y z z.*0 z "w zerror t 'Data'" :-
@gsp :- x.*0 y z "w l notit" :-  # projection on x=0
@gsp :- x y.*0 z "w l notit"     # projection on y=0
save(term="pngcairo", output="output.png")
`````` 11 Likes

Nice, what about increase transparency in the shaded area (area_gradient)? As in here: https://vega.github.io/vega-lite/examples/area_gradient.html

Is this possible with a plots backend? I want to draw in 3D space a 2D polygon so that the disk or ellipse can be rotated. All I am able to get is an unfilled line. Same commands create a filled shape if 2D points are used. Where do I need to look?

2 Likes

Right, how to do this with Plots.jl? This can be don in 2D using `plot(x, y, fillrange=0)`, but this doesn’t work in 3D.

1 Like
{"ft_lang_label":"__label__en","ft_lang_prob":0.9287633,"math_prob":0.48621887,"size":315,"snap":"2021-04-2021-17","text_gpt3_token_len":81,"char_repetition_ratio":0.10610932,"word_repetition_ratio":0.0,"special_character_ratio":0.24444444,"punctuation_ratio":0.11111111,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.98390627,"pos_list":[0,1,2,3,4],"im_url_duplicate_count":[null,null,null,2,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-04-22T15:03:41Z\",\"WARC-Record-ID\":\"<urn:uuid:bae289d7-5650-474f-b570-a6cba6165713>\",\"Content-Length\":\"27871\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:e1f14a44-8bbf-43cc-a794-1f4e1bd89e86>\",\"WARC-Concurrent-To\":\"<urn:uuid:ce02a706-6b30-43fa-b479-a182675d598f>\",\"WARC-IP-Address\":\"72.52.80.20\",\"WARC-Target-URI\":\"https://discourse.julialang.org/t/fill-a-curve-in-3d/37890\",\"WARC-Payload-Digest\":\"sha1:YGS3W7Y7RDYILLXSWQPYPGMSES5G2BJC\",\"WARC-Block-Digest\":\"sha1:ACPIPMQCCR72FUILQWOV6WDXDPM73VQ4\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-17/CC-MAIN-2021-17_segments_1618039610090.97_warc_CC-MAIN-20210422130245-20210422160245-00451.warc.gz\"}"}