JuliaAcademy / DataScience

Data Science in Julia course for JuliaAcademy.com, taught by Huda Nassar
https://juliaacademy.com/p/julia-for-data-science
MIT License
488 stars 256 forks source link

[Violin Plot] Issue while using the "side" keyword #27

Closed shaksham95 closed 3 years ago

shaksham95 commented 3 years ago

Hey,

In Video 13, I am facing issues while trying to plot the violin plots side by side using the side keyword. Below is the code that I am using:

## data: 2020-02
ca = CA_df[!,Symbol("2020-02")]
ny = NY_df[!,Symbol("2020-02")]
fl = FL_df[!,Symbol("2020-02")]

## plot
violin(ny, legend=true, alpha=0.8, label="New York", side=:left)
violin!(ca, alpha=0.8, label="California", side=:left)
violin!(fl, alpha=0.8, label="Florida", side=:left)

## data: 2010-02
ny = NY_df[!, Symbol("2010-02")]
ca = CA_df[!, Symbol("2010-02")]
fl = FL_df[!, Symbol("2010-02")]

## plot
violin!(ny, legend=false, alpha=0.8, side=:right)
violin!(ca, alpha=0.8, side=:right)
violin!(fl, alpha=0.8, side=:right)

Expected Outcome:

image

Actual Outcome:

image

The same goes for the next plot, with the label being the year.

Expected Outcome:

image

Actual Outcome:

image

What am I doing wrong? Can anyone please help?

logankilpatrick commented 3 years ago

I also fixed this, thanks again!