# How do I plot data from a dictionary?

**URL:** <https://discourse.julialang.org/t/how-do-i-plot-data-from-a-dictionary/67249>\
**Category:** New to Julia\
**Tags:** question, plot\
**Created:** [August 28, 2021, 11:06pm UTC](https://discourse.julialang.org/t/how-do-i-plot-data-from-a-dictionary/67249 "2021-08-28T23:06:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hdcpereira](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hdcpereira/32/28705_2.png) [@hdcpereira](https://discourse.julialang.org/u/hdcpereira)\
**Post date:** [August 28, 2021, 11:06pm UTC](https://discourse.julialang.org/t/how-do-i-plot-data-from-a-dictionary/67249/1 "2021-08-28T23:06:43Z")

</div>

Hello there.

I’m trying to plot some data from a dictionary like this:

```julia
Dict{Any, Any} with 7 entries:
  "C" => 13.3147
  "C ffast-math" => 8.47802
  "Python- Built-in" => 1937.68
  "Python numpy" => 4.6551
  "Python hand-written" => 2512.43
  "Julia built-in" => 4.58879
  "Julia hand-written" => 12.8829

```

I’m using the following piece of code:

```julia
 p = plot()
x = 0:length(d)
for k ∈ keys(d)
    scatter!(x,d[k])
end

```

i’m not necessarily trying to scatter plot, it would be better for me to draw a horizontal bar plot, but I have no idea how to do that.

---

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [August 29, 2021, 12:25am UTC](https://discourse.julialang.org/t/how-do-i-plot-data-from-a-dictionary/67249/2 "2021-08-29T00:25:40Z")

</div>

Using Plots, you can try this:

```julia
bar(collect(keys(d)), collect(values(d)), orientation=:horizontal)

```

or using splatting instead:

```julia
bar([keys(d)...], [values(d)...], orientation = :horizontal)

```
