Mathematica: DiscretePlot type plot with x values from a list

In summary, the speaker is looking for a way to plot vertical lines with dots at the top, using x-positions and heights from a set of coordinates. The suggestion is to use ListPlot with the option Filling->Axis. The speaker also asks for advice on how to plot complex numbers as a function of t using ListPointPlot3D, but notes that the Filling->Axis option doesn't work in this case. They mention having to manipulate the data to get the desired plot and ask for the best approach for this type of plot.
  • #1
Swamp Thing
Insights Author
978
698
TL;DR Summary
Is it possible to get something that looks like DiscretePlot, but taking both the X *and* Y values from a list?
I would like vertical lines with dots at the top of them, with the x-positions and heights coming from
{{1.2, 3.5}, {2.3, 4.2}, {5.5, 6.7}} for example.
 
Physics news on Phys.org
  • #2
Try ListPlot with the option Filling->Axis
 
  • Like
Likes Swamp Thing and DrClaude
  • #3
That's exactly what I needed, thanks.

And another question, if I may: I have used ListPointPlot3D to show some complex numbers as a function of some ##t## that goes along the length of the box:
1585187196967.png


However, the Filling->Axis doesn't help here because it sends each line downwards rather than towards the ##t## axis.

I had to doctor the data and insert ##0 + i0## before and after each complex number to get the above plot -- so ListPointPlot3D is probably the wrong type of plot for this.

What is the best way to do this?
 
Last edited:

Similar threads

Replies
1
Views
2K
Replies
4
Views
865
Replies
1
Views
1K
Replies
1
Views
1K
Replies
1
Views
3K
Replies
6
Views
3K
Replies
5
Views
2K
Back
Top