Advertisement
Guest User

Untitled

a guest
Jan 16th, 2020
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Julia 1.04 KB | None | 0 0
  1. using Plots
  2. using Random
  3. using ORCA
  4. using Plots.PlotMeasures
  5. plotly()
  6.  
  7. function pltsv()
  8.     colz = distinguishable_colors(41)
  9.     colz = colz[2:end]
  10.     my = maximum(y)
  11.     p1 = plot(
  12.     leg=false,
  13.     x,
  14.     y,
  15.     title=ttl,
  16.     xlabel=xlb,
  17.     ylabel=ylb,
  18.     lw=3,
  19.     xtickfont=xf,
  20.     titlefont=10,
  21.     seriestype=:bar,
  22.     color=shuffle(colz),
  23.     yticks=0:round(Int,my/11):my,
  24.     ylim=(0,my*1.15),
  25.     # bar_position = :dodge,
  26.     # scatter,bar,pie,curves,hline,line,scatterpath,sticks
  27.     fmt = :png,
  28.     size=(1400,900),
  29.     xrotation=-5,
  30.     )
  31.  
  32.     scatter!(p1, x, (x -> x+my/20).(y),
  33.     txts = map(i->text(y[i], font(round(Int, 15+15*y[i]/my))), 1:length(x)),
  34.     ms=0,
  35.     markeralpha=0,
  36.     leg=false,
  37.  
  38.     # formatter=x->"",
  39.     )
  40.  
  41.     Plots.savefig(p1,"$ttl.png")
  42. end
  43.  
  44.  
  45. x = split("
  46. ### x-values go here
  47. ",'\n')
  48. x=x[2:end-1]
  49. y = (x -> parse(Int,x)).(split("
  50. ### y-values go here ###
  51. "))
  52. ttl="### title goes here ###"
  53. xlb="### x-label goes here ###"
  54. ylb="### y-label goes here ###"
  55. xf=13
  56. pltsv()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement