FED3Viz

45 views
Skip to first unread message

Alexandra Porczak

unread,
May 16, 2022, 7:28:21 PM5/16/22
to FEDforum
Hi,
I am curious if there is a way to manually set an axis on FED3Viz. In my attached chronograms, my mut axis goes to 35 pellets, while the wt goes to 30. I would like to set both to 35. Thank you!
Alex

wt chronogram.PNG
mut chronogram.PNG

Lex Kravitz

unread,
May 16, 2022, 9:30:32 PM5/16/22
to FEDforum
Hi Alex!
Unfortunately there is not a one-click way to scale axes within FED3Viz.  What may help you is to plot your two groups on top of each other on a single circle plot though.  To do this, import all of your files into FED3Viz and assign them to two groups, using the "Create Groups" button.  As an example, I've split 5 files into "Group1" and "Group2" below.
Ex0.png

Now if you run the circle plot again it will overlay the groups on the same axes, which may accomplish what you want.
Plot0.png

There is also a way to do what you originally asked, it just requires you to re-create the plot in Python and do the tweaks there.  The developer of FED3Viz, Tom Earnest, added a really useful feature for re-making the plots in Python, which you can use to change plot parameters for any plots that FED3Viz generates. Here's a step-by-step guide:

1. First make your plot in FED3Viz, as you've done.  Then click "Plot Code" on the left, and a text window will pop up containing the code to re-create that plot.  Copy everything in this window to your clipboard.
plot1.png

plot2.png

2. This code includes everything needed to recreate the figure you created in FED3Viz, the file paths you selected, plot parameters, etc.  So now open any Python interpreter (I'm using Spyder in the example below), paste the plotting code into the sketch window, and run it.  It should re-create your plot within the Python environment.
plot3.png

3. Finally, scroll to the bottom of the code and you can add lines to tweak things like axis limits or labels.  To change the y-axis limits from 0 to 35 you can add plt.ylim(0, 35) to the bottom of the code (line 431 in my example).  This will redraw the plot exactly the same but with the y-axis going from 0 to 35.  If you want to get into more complicated tweaks (starting angles, colors, shading, etc) you will have to experiment with the actual plotting code, but it's all there in the code you pasted.
plot4.png

Hope this helps! -Lex

Tom Earnest

unread,
May 16, 2022, 11:41:07 PM5/16/22
to FEDforum
Thanks Lex for the detailed answer!  Pretty much everything I wanted to say, but with nicer pictures : )

Alex, As Lex indicated, the program is not flexible enough to handle those sort of aesthetic tweaks (even though the one you describe is very useful).  The catch-all fix is to use the plotting code.  I also tried doing `plt.ylim(0, 35)` as suggested, but I saw that it weirdly doesn't extend the shading indicating the light cycle (shown in last picture above).   If this bothers you (like it did me), the best I could think of is the following.  There's a section of the code around line 389-393 (I think) which has the following statements:

ax.set_xlabel('Hours (since start of light cycle)')
ax.set_xticks(np.linspace(0, 2*np.pi, 5))
ax.set_xticklabels([0, 6, 12, 18, None])
ax.set_title('Chronogram ({})'.format(circ_value), pad=10)


You can add another `ax.set_...` line, which has the same effect, but will also extend the shaded area:

ax.set_ylim(0, 35)

Now the 35 limit is hard-coded, so you may want to edit it or do something more flexible for new data.  But for your current specific plot, would be a quick fix. 

Let me know if I can help with any other tweaks!  

Best,
Tom
Reply all
Reply to author
Forward
0 new messages