# Need to make a custom plot

#1

I need to make a custom plot type (for a smith chart) and i’m wondering what would be the best approach for this.

i’m most familiar with pyplot, i.e. matplotlib ,but not at all with familiar with creating custom plot types. there is already a python package which uses matplotlib to generate smith charts but it is a fairly substantial amount of python code and it’s not at all obvious how i might port it to julia.

I was also looking at GR but can’t seem to find any documentation on how to create your own graph type.

I was looking for some suggestions.

Thank you !

Why a non Google friendly product name?
#2

#3

PGFPlotsX also allows to create nice smith charts.

julia> using PGFPlotsX

julia> push!(PGFPlotsX.CUSTOM_PREAMBLE, "\\usepgfplotslibrary[smithchart]")
1-element Array{String,1}:
"\\usepgfplotslibrary[smithchart]"

julia> data = [(0.5,0.2), (1,0.8), (2,2)]
3-element Array{Tuple{Real,Real},1}:
(0.5, 0.2)
(1, 0.8)
(2, 2)

julia> TikzPicture("\\begin{smithchart}[title = Impedance Smith Chart,] \\addplot coordinates { \$(join(string.(data), " ")) }; \\end{smithchart}")


(pixelation due to pdf2png)

#4

If you know a Python package and how to use it already, how about just calling it via PyCall?

#5

My initial reaction was to try and use the pyplot version but i am completely unfamiliar with PyCall, so I wanted to see what other options were available. also it’s a bit kludgy. I wanted this for a julia package I’m working on and I really didn’t want to have to deal with pulling in the python-only code for another project to make it work. much cleaner if i could use a plot package already in julia.